linux/drivers
Frank Shew 94327d009e i2c: Blackfin TWI: fix transfer errors with repeat start
We have a custom BF537 board with an I2C RTC (MAX DS3231) running
uclinux 2007R1 for some time. Recently during migration to 2008R1.5-RC3
we losted access to the RTC. The RTC driver calls 'i2c_transfer()' which
in turns calls 'bfin_twi_master_xfer()' in i2c-bfin-twi.c.

Compared with 2007R1, it looks like the 2008R1.5 version of i2c-bin-twi.c
has a new mode 'TWI_I2C-MODE_REPEAT' which corresponds to the Repeat Start
Condition described in the HRM. However, according to the HRM, at XMIT or
RECV interrupt and when the data count is 0, not only is the RESTART bit
supposed to be set, but MDIR must also be set if the next operation is a
receive sequence, and cleared if not. Currently there is no code that looks
at the I2C_M_RD bit in the flag from the next cur_msg and set/clear the MDIR
flag accordingly at the same time that the RSTART bit is set. Instead, MDIR
is set or cleared (by OR'ing with 0?) after the RESTART bit has been cleared
during handling of MCOMP interrupt.

It appears that this is causing our failure with reading the RTC, as a
quick patch to set/clear MDIR when RESTART is set seem to solve our problem.

Signed-off-by: Frank Shew <fshew@geometrics.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
[ben-linux@fluff.org: shorted subject]
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-13 10:39:25 +01:00
..
accessibility
acpi Merge branch 'irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-06-10 15:25:41 -07:00
amba
ata Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev 2009-06-11 11:23:17 -07:00
atm Replace all DMA_nBIT_MASK macro with DMA_BIT_MASK(n) 2009-04-13 15:04:33 -07:00
auxdisplay
base Driver Core: Rework platform suspend/resume, print warning 2009-06-12 21:32:32 +02:00
block Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze 2009-06-12 13:15:17 -07:00
bluetooth tty: fix bluetooth scribbling on low latency flags 2009-06-11 08:51:05 -07:00
cdrom block: Use accessor functions for queue limits 2009-05-22 23:22:54 +02:00
char Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2009-06-12 18:09:18 -07:00
clocksource clocksource: sh_mtu2/cmt_register() should be static. 2009-05-03 18:05:42 +09:00
connector
cpufreq cpumask: alloc zeroed cpumask for static cpumask_var_ts 2009-06-09 22:30:27 +09:30
cpuidle
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2009-05-17 15:48:05 -07:00
dca
dio
dma Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2009-05-30 07:57:44 -07:00
edac EDAC: do not enable modules by default 2009-06-10 12:19:41 +02:00
eisa
firewire
firmware [libata] ahci: Restore SB600 SATA controller 64 bit DMA 2009-06-10 11:05:00 -04:00
gpio microblaze: Kconfig: Enable drivers for Microblaze 2009-05-21 15:56:04 +02:00
gpu Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2009-06-12 18:09:18 -07:00
hid HID: add NOGET quirk for devices from CH Products 2009-05-11 17:09:21 +02:00
hwmon hwmon: (lm78) Add missing __devexit_p() 2009-06-01 13:46:49 +02:00
i2c i2c: Blackfin TWI: fix transfer errors with repeat start 2009-06-13 10:39:25 +01:00
ide Merge branch 'for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6 2009-06-12 09:29:42 -07:00
idle i7300_idle: allow testing on i5000-series hardware w/o re-compile 2009-05-28 20:52:40 -04:00
ieee1394 fs: Remove i_cindex from struct inode 2009-06-11 21:36:09 -04:00
infiniband [SCSI] libiscsi: add task aborted state 2009-05-23 15:44:13 -05:00
input Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze 2009-06-12 13:15:17 -07:00
isdn gigaset: beyond ARRAY_SIZE of iwb->data 2009-05-21 15:04:15 -07:00
leds
lguest Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-lguest 2009-06-12 09:32:26 -07:00
macintosh Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6 2009-04-24 08:16:05 -07:00
mca
md Merge branch 'for-2.6.31' of git://git.kernel.dk/linux-2.6-block 2009-06-11 11:10:35 -07:00
media ivtv: Fix PCI DMA direction 2009-06-05 08:05:23 -07:00
memstick block: Do away with the notion of hardsect_size 2009-05-22 23:22:54 +02:00
message [SCSI] Merge branch 'linus' 2009-06-12 10:02:03 -05:00
mfd mfd: pcf50633: fix unsafe disable_irq() 2009-05-19 22:22:28 +02:00
misc [SCSI] ses: fix problems caused by empty SES provided name 2009-05-15 12:20:57 -04:00
mmc Merge branch 'for-2.6.31' of git://git.kernel.dk/linux-2.6-block 2009-06-11 11:10:35 -07:00
mtd Merge branch 'for-2.6.31' of git://git.kernel.dk/linux-2.6-block 2009-06-11 11:10:35 -07:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-06-12 09:50:42 -07:00
nubus
of microblaze: Kconfig: Enable drivers for Microblaze 2009-05-21 15:56:04 +02:00
oprofile oprofile: fix cpu buffer size 2009-05-07 17:28:59 +02:00
parisc irq: change ->set_affinity() to return status 2009-04-28 12:21:16 +02:00
parport parport_pc: clean up the modified while loops using for 2009-06-11 08:51:03 -07:00
pci Merge branch 'irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-06-10 15:25:41 -07:00
pcmcia [ARM] 5458/1: pcmcia: pxa2xx-sharpsl: check if we do have Scoop config 2009-04-23 23:25:40 +01:00
platform eeepc-laptop: unregister_rfkill_notifier on failure 2009-05-14 11:28:27 -04:00
pnp Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2009-06-12 18:09:18 -07:00
power Merge git://git.infradead.org/battery-2.6 2009-04-08 17:45:02 -07:00
ps3
rapidio
regulator regulator: da903x: add missing __devexit_p() 2009-05-18 11:21:10 +01:00
rtc Merge branches 'sh/stable-updates' and 'sh/sparseirq' 2009-05-22 13:29:37 +09:00
s390 Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6 2009-06-12 18:18:05 -07:00
sbus block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
scsi [SCSI] Merge branch 'linus' 2009-06-12 10:02:03 -05:00
serial Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2009-06-11 10:08:33 -07:00
sh sh: Tie sparseirq in to Kconfig. 2009-06-11 10:33:09 +03:00
sn
spi microblaze: Kconfig: Enable drivers for Microblaze 2009-05-21 15:56:04 +02:00
ssb SSB: BCM47xx: Export ssb_watchdog_timer_set 2009-06-08 16:57:50 +01:00
staging Staging: comedi: David doesn't want to get comedi patches 2009-05-08 19:39:28 -07:00
tc
telephony
thermal thermal: fix off-by-1 error in trip point trigger condition 2009-05-14 13:40:53 -04:00
uio UIO: fix specific device driver missing statement for depmod 2009-04-16 16:17:11 -07:00
usb Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze 2009-06-12 13:15:17 -07:00
uwb
video Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze 2009-06-12 13:15:17 -07:00
virtio virtio: enhance id_matching for virtio drivers 2009-06-12 22:16:40 +09:30
w1
watchdog [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
xen PM core: rename suspend and resume functions 2009-06-12 21:32:31 +02:00
zorro
Kconfig
Makefile V4L/DVB (11561a): move media after i2c 2009-04-29 15:41:13 -03:00