linux-gbmc: i2c-npcm7xx.c: add msleep in polling loop to avoid RCU stall
When some malfunctional I2C device hangs the bus, the npcm_i2c_master_xfer
will almost stall the current CPU because there is a do {} while loop (used to
detect I2C bus idle condition) which will keep calling spin_lock_irqsave again and again.
Adding a msleep_interruptible(10) can help release the current CPU so it can do
other tasks.
Tested:
Before the fix, when dealing with hanging I2C device:
kernel: i2c i2c-10: __i2c_transfer failed -11
kernel: rcu: INFO: rcu_sched self-detected stall on CPU
After the fix, when dealing with hanging I2C device, there
is only :
kernel: i2c i2c-6: __i2c_transfer failed -11
Also, we built staging image 91.23.18.200 and tested passed on 3 machines.
Google-Bug-Id: 295580753
Change-Id: I96538284a7d11fe19374a2f17696bf2e0f3ba29a
Signed-off-by: Jinliang Wang <jinliangw@google.com>
(cherry picked from commit 36886d473729667e51852f4c61de5661181dedaa)
1 file changed