linux-gbmc: Support MCTP retry and recover for i2c-ast2600.c
add retry mechanism for mctp over i2c-ast2600
The current aspeed in-kernel mctp i2c binding stack has two issues:
1) No retry of TX mctp packet on certain errors
2) MCTP TX patch is stuck at busy state after certain condition and
ast2600_i2c_recover_bus is skipped because multi_master is enabled
The two patches tries try to address the two issues by:
1) In include/uapi/linux/i2c.h, define two new flags for i2c_msg.flags:
I2C_M_IS_MCTP and I2C_M_LAST_RETRY
2) In mctp-i2c.c layer, the new mctp_i2c_transfer_with_retry function
will perform TX mctp packet retry logic, approximately
20 ms x 10 times = 2 seconds.
3) In i2c-ast2600.c layer, the new function ast2600_i2c_should_recover
will decide whether we need to call ast2600_i2c_recover_bus to
recover the bus.
Tested:
https://paste.googleplex.com/4510192766550016
https://paste.googleplex.com/5871967458033664
https://paste.googleplex.com/4694425082527744
Google-Bug-Id: 334134061
Google-Bug-Id: 334170933
Google-Bug-Id: 286397121
Fusion-Link: Won't affect presubmit platforms
Change-Id: Ie8e0d6f67339ade75b6defa1503bd50d13d95b54
Signed-off-by: Jinliang Wang <jinliangw@google.com>
(cherry picked from commit 6ba13046870843d41b7d3f5a25d97ee3365e24ce)
2 files changed