linux/drivers/i2c/busses
Alexander Kochetkov 27caca9d2e i2c: omap: fix NACK and Arbitration Lost irq handling
commit 1d7afc9594 (i2c: omap: ack IRQ in parts)
changed the interrupt handler to complete transfers without clearing
XRDY (AL case) and ARDY (NACK case) flags. XRDY or ARDY interrupts will be
fired again. As a result, ISR keep processing transfer after it was already
complete (from the driver code point of view).

A didn't see real impacts of the 1d7afc9, but it is really bad idea to
have ISR running on user data after transfer was complete.

It looks, what 1d7afc9 violate TI specs in what how AL and NACK should be
handled (see Note 1, sprugn4r, Figure 17-31 and Figure 17-32).

According to specs (if I understood correctly), in case of NACK and AL driver
must reset NACK, AL, ARDY, RDR, and RRDY (Master Receive Mode), and
NACK, AL, ARDY, and XDR (Master Transmitter Mode).

All that is done down the code under the if condition:
if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) ...

The patch restore pre 1d7afc9 logic of handling NACK and AL interrupts, so
no interrupts is fired after ISR informs the rest of driver what transfer
complete.

Note: instead of removing break under NACK case, we could just replace 'break'
with 'continue' and allow NACK transfer to finish using ARDY event. I found
that NACK and ARDY bits usually set together. That case confirm TI wiki:
http://processors.wiki.ti.com/index.php/I2C_Tips#Detecting_and_handling_NACK

In order if someone interested in the event traces for NACK and AL cases,
I sent them to mailing list.

Tested on Beagleboard XM C.

Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
Fixes: 1d7afc9 i2c: omap: ack IRQ in parts
Cc: <stable@vger.kernel.org> # v3.7+
Acked-by: Felipe Balbi <balbi@ti.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-11-21 08:06:31 +01:00
..
i2c-acorn.c i2c: acorn: is tristate and should use module.h 2014-01-24 18:21:11 +01:00
i2c-ali15x3.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-ali1535.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-ali1563.c i2c: ali1563: fix checkpatch.pl issues 2014-05-22 10:09:21 +02:00
i2c-amd756-s4882.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-amd756.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-amd8111.c i2c: remove DEFINE_PCI_DEVICE_TABLE macro 2014-03-13 09:44:59 +01:00
i2c-at91.c i2c: at91: don't account as iowait 2014-11-07 18:56:31 +01:00
i2c-au1550.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-axxia.c i2c: axxia: Add I2C driver for AXM55xx 2014-10-03 14:11:53 +02:00
i2c-bcm2835.c i2c: i2c-bcm2835: Drop class based scanning to improve bootup time 2014-07-16 22:59:57 +02:00
i2c-bcm-kona.c i2c: i2c-bcm-kona: Fix module build 2013-11-26 14:00:57 +01:00
i2c-bfin-twi.c i2c: i2c-bfin-twi: Drop class based scanning to improve bootup time 2014-07-16 22:59:58 +02:00
i2c-cadence.c i2c: Add driver for Cadence I2C controller 2014-04-06 17:47:19 +02:00
i2c-cbus-gpio.c i2c: delete non-required instances of include <linux/init.h> 2014-01-24 18:24:31 +01:00
i2c-cpm.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-cros-ec-tunnel.c Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2014-10-19 12:50:44 -07:00
i2c-davinci.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-designware-core.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-designware-core.h i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-designware-pcidrv.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-designware-platdrv.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-diolan-u2c.c i2c: remove unnecessary OOM messages 2014-06-02 19:24:33 +02:00
i2c-efm32.c i2c: efm32: correct namespacing of location property 2014-07-17 15:38:49 +02:00
i2c-eg20t.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-elektor.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-exynos5.c i2c: exynos: add support for HSI2C module on Exynos7 2014-10-03 03:35:49 +02:00
i2c-gpio.c i2c: gpio: Drop dead code in i2c_gpio_remove 2014-08-01 20:01:41 +02:00
i2c-highlander.c i2c: delete non-required instances of include <linux/init.h> 2014-01-24 18:24:31 +01:00
i2c-hix5hd2.c i2c: hix5hd2: add i2c controller driver 2014-10-16 09:14:17 +02:00
i2c-hydra.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-i801.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-ibm_iic.c i2c: delete non-required instances of include <linux/init.h> 2014-01-24 18:24:31 +01:00
i2c-ibm_iic.h
i2c-imx.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-iop3xx.c i2c: delete non-required instances of include <linux/init.h> 2014-01-24 18:24:31 +01:00
i2c-iop3xx.h i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-isch.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-ismt.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-kempld.c i2c: Fix Kontron PLD prescaler calculation 2013-08-05 10:31:18 +02:00
i2c-mpc.c i2c: mpc: delete unneeded test before of_node_put 2014-08-08 18:45:30 +02:00
i2c-mv64xxx.c i2c: mv64xxx: continue probe when clock-frequency is missing 2014-09-02 12:34:08 +02:00
i2c-mxs.c i2c: mxs: detect No Slave Ack on SELECT in PIO mode 2014-10-03 03:35:49 +02:00
i2c-nforce2-s4985.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-nforce2.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-nomadik.c i2c: i2c-nomadik: Drop class based scanning to improve bootup time 2014-07-16 23:00:01 +02:00
i2c-ocores.c i2c: i2c-ocores: Drop class based scanning to improve bootup time 2014-07-16 23:00:02 +02:00
i2c-octeon.c i2c: delete non-required instances of include <linux/init.h> 2014-01-24 18:24:31 +01:00
i2c-omap.c i2c: omap: fix NACK and Arbitration Lost irq handling 2014-11-21 08:06:31 +01:00
i2c-parport-light.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-parport.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-parport.h i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-pasemi.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-pca-isa.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-pca-platform.c i2c: delete non-required instances of include <linux/init.h> 2014-01-24 18:24:31 +01:00
i2c-piix4.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-pmcmsp.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-pnx.c i2c: pnx: Use devm_*() functions 2014-01-16 11:15:50 +01:00
i2c-powermac.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-puv3.c i2c: delete non-required instances of include <linux/init.h> 2014-01-24 18:24:31 +01:00
i2c-pxa-pci.c i2c: remove DEFINE_PCI_DEVICE_TABLE macro 2014-03-13 09:44:59 +01:00
i2c-pxa.c i2c: Make of_device_id array const 2014-06-02 19:29:37 +02:00
i2c-qup.c i2c: qup: Fix order of runtime pm initialization 2014-10-03 03:20:47 +02:00
i2c-rcar.c i2c: rcar: remove sign-compare flaw 2014-09-29 22:43:25 +02:00
i2c-riic.c i2c: Make of_device_id array const 2014-06-02 19:29:37 +02:00
i2c-rk3x.c Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2014-10-19 12:50:44 -07:00
i2c-robotfuzz-osif.c i2c: Add bus driver for for OSIF USB i2c device. 2014-01-13 13:56:56 +01:00
i2c-s3c2410.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-scmi.c i2c: delete non-required instances of include <linux/init.h> 2014-01-24 18:24:31 +01:00
i2c-sh7760.c i2c: delete non-required instances of include <linux/init.h> 2014-01-24 18:24:31 +01:00
i2c-sh_mobile.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-sibyte.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-simtec.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-sirf.c i2c: i2c-sirf: Drop class based scanning to improve bootup time 2014-07-16 23:00:06 +02:00
i2c-sis96x.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-sis630.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-sis5595.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-st.c i2c: st: Update i2c timings 2014-08-01 19:47:17 +02:00
i2c-stu300.c i2c: i2c-stu300: Drop class based scanning to improve bootup time 2014-07-16 23:00:06 +02:00
i2c-sun6i-p2wi.c i2c: sun6i-p2wi: Remove duplicate inclusion of module.h 2014-06-27 14:39:36 +02:00
i2c-taos-evm.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-tegra.c i2c: tegra: Move clk_prepare/clk_set_rate to probe 2014-09-20 11:15:23 +02:00
i2c-tiny-usb.c i2c: i2c-tiny-usb: Remove RobotFuzz USB vendor:product ID 2014-01-13 13:56:52 +01:00
i2c-versatile.c i2c: move OF helpers into the core 2013-08-23 10:22:20 +02:00
i2c-via.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-viapro.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-viperboard.c i2c: viperboard: remove superfluous assignment 2014-01-09 22:18:33 +01:00
i2c-wmt.c i2c: Make of_device_id array const 2014-06-02 19:29:37 +02:00
i2c-xiic.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-xlr.c i2c: delete non-required instances of include <linux/init.h> 2014-01-24 18:24:31 +01:00
Kconfig Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2014-10-19 12:50:44 -07:00
Makefile i2c: hix5hd2: add i2c controller driver 2014-10-16 09:14:17 +02:00
scx200_acb.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00