1
0
Fork 0
remarkable-uboot/drivers
Marek Vasut 124913556c i2c: mxs_i2c: Squash endless loop
The endless waiting for a bit to be set can cause a hang, add a timeout
so we prevent such situation. A testcase for such a hang is below. The
testcase assumes a device to be present at address 0x50 and a device to
NOT be present at address 0x42 . Also note that the "sleep 1" induced
delays are imperative for this bug to manifest .

i2c read 0x42 0x0.2 0x10 0x42000000 ; sleep 1 ; \
i2c read 0x50 0x0.2 0x10 0x42000000 ; sleep 1 ; \
i2c read 0x42 0x0.2 0x10 0x42000000

The expected result of the above command is:

Error reading the chip.
Error reading the chip.

While without this patch, we observe a hang in the last read from 0x42
precisely when waiting for this bit to be set.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
2013-11-13 06:08:31 +01:00
..
bios_emulator drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
block drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
bootcount Merge branch 'iu-boot/master' into 'u-boot-arm/master' 2013-11-09 22:59:47 +01:00
crypto drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
dfu usb: dfu: make nand upload working 2013-11-08 20:46:20 +01:00
dma drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
fpga fpga: zynqpl: Do not place bitstream below 1MB 2013-11-06 09:15:12 +01:00
gpio Add support for SX151x SPI GPIO Expanders 2013-11-08 09:39:13 -05:00
hwmon cosmetic: remove empty lines at the top of file 2013-11-08 09:41:37 -05:00
i2c i2c: mxs_i2c: Squash endless loop 2013-11-13 06:08:31 +01:00
input drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
misc drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
mmc drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
mtd Merge branch 'iu-boot/master' into 'u-boot-arm/master' 2013-11-09 22:59:47 +01:00
net MPC824x: remove obsolete "PN62" board 2013-11-11 14:46:24 -05:00
pci malta: support for coreFPGA6 boards 2013-11-09 17:21:01 +01:00
pcmcia drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
power drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
qe drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
rtc Merge branch 'master' of git://git.denx.de/u-boot-mips 2013-11-11 09:40:34 -05:00
serial serial: s5p: Staticize local functions 2013-11-08 15:25:14 -05:00
sound drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
spi spi: omap3: add support for more word lengths 2013-11-12 10:02:44 +01:00
tpm drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
twserial drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
usb Merge branch 'iu-boot/master' into 'u-boot-arm/master' 2013-11-09 22:59:47 +01:00
video lcd: add DataImage SCF0403x LCD panel support 2013-11-12 10:08:48 +01:00
watchdog Merge branch 'iu-boot/master' into 'u-boot-arm/master' 2013-11-09 22:59:47 +01:00
Makefile drivers: move some drivers to drivers/Makefile 2013-10-31 13:26:44 -04:00