i2c: designware: fix IO timeout issue for AMD controller
authorXiangliang Yu <Xiangliang.Yu@amd.com>
Fri, 11 Dec 2015 12:02:53 +0000 (20:02 +0800)
committerWolfram Sang <wsa@the-dreams.de>
Sat, 12 Dec 2015 17:00:16 +0000 (18:00 +0100)
commit2d244c81481fa5142a2ba6656ab7a8e40c849c27
treefebadcdd309a628e2f002b31bb8bbc667704d1a0
parent5212f9ae519a3e108205f27eb22929266e688e3e
i2c: designware: fix IO timeout issue for AMD controller

Because of some hardware limitation, AMD I2C controller can't
trigger pending interrupt if interrupt status has been changed
after clearing interrupt status bits. Then, I2C will lost
interrupt and IO timeout.

According to hardware design, this patch implements a workaround
to disable i2c controller interrupt and re-enable i2c interrupt
before exiting ISR.

To reduce the performance impacts on other vendors, use unlikely
function to check flag in ISR.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
drivers/i2c/busses/i2c-designware-core.c
drivers/i2c/busses/i2c-designware-core.h
drivers/i2c/busses/i2c-designware-platdrv.c