]> www.infradead.org Git - users/dwmw2/linux.git/commit
i2c: sprd: use a specific timeout to avoid system hang up issue
authorChunyan Zhang <chunyan.zhang@unisoc.com>
Mon, 14 Dec 2020 04:58:50 +0000 (12:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Jan 2021 12:58:59 +0000 (13:58 +0100)
commit3d87acd7e4ac0df83d8c8bb445923c415bf7171a
treeea811168cf0d6f1c316afdb39fa24273abb0c360
parentc18eee29f080757a7ed964e53d1ccd643943c2a3
i2c: sprd: use a specific timeout to avoid system hang up issue

commit 0b884fe71f9ee6a5df35e677154256ea2099ebb8 upstream.

If the i2c device SCL bus being pulled up due to some exception before
message transfer done, the system cannot receive the completing interrupt
signal any more, it would not exit waiting loop until MAX_SCHEDULE_TIMEOUT
jiffies eclipse, that would make the system seemed hang up. To avoid that
happen, this patch adds a specific timeout for message transfer.

Fixes: 8b9ec0719834 ("i2c: Add Spreadtrum I2C controller driver")
Signed-off-by: Linhua Xu <linhua.xu@unisoc.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
[wsa: changed errno to ETIMEDOUT]
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-sprd.c