linux-gbmc: i2c-npcm7xx.c: add multi_master bus recoevery

The previous multi_master hack bypassed the npcm_i2c_recovery_tgclk.
Also, some NVMe-Mi device may reset their i2c module without notify
BMC i2c driver. In this case, the i2c-npcm7xx.c will enter a bad state
(bus_busy is false but bus->ber_state is true ) and it cannot send out
MCTP packet anymore.

Here we introduced the multi_master bus recovery mechanism:
When the accumulated bus->busy_cnt exceeds the adap->retries, we will
trigger npcm_i2c_reset and i2c_recover_bus.

Tested:
Before the fix, when stressing NVMe-Mi device i2c reset, we will
observe a lot of failure messages in kernel log:

Oct 30 23:17:18  kernel: i2c i2c-6: __i2c_transfer failed -11
Oct 30 23:17:18  kernel: i2c i2c-6: __i2c_transfer failed -11
Oct 30 23:17:18  kernel: i2c i2c-6: __i2c_transfer failed -11

After the fix, when stressing NVMe-Mi device i2c reset, there
is only a limited number of __i2c_transfer failed.

Google-Bug-Id: 297058513
Google-Bug-Id: 301615133
Google-Bug-Id: 305746801#comment11
Google-Bug-Id: 308495306

Change-Id: Ifeccfecc22f9ae92a7284975abea11e2593f1581
Signed-off-by: Jinliang Wang <jinliangw@google.com>
(cherry picked from commit 0dfc2659dbbb3ae4d8aac4a3bb70e40692af837c)
1 file changed
tree: 3b5347d57f1c07cddc3faccf56092a5506c89423
  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. recipes-support/
  12. LICENSE
  13. 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.