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
tree: b792f7154d923ec47d2ffd167cdcb388232313b0
  1. conf/
  2. dynamic-layers/
  3. meta-nuvoton-npcm8xx/
  4. recipes-connectivity/
  5. recipes-core/
  6. recipes-devtools/
  7. recipes-extended/
  8. recipes-google/
  9. recipes-kernel/
  10. recipes-phosphor/
  11. LICENSE
  12. README.md
README.md

meta-gbmc-staging

This repository contains additions to the openbmc/meta-google layer that are not yet ready for OpenBMC inclusion.

How to use this layer

  1. Clone openbmc/openbmc from GitHub.
  2. Clone this layer from GitHub into a subdirectory of openbmc.