Ziang Wang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/75739?usp=email )
Change subject: drivers/ipmi: retry ipmi_get_device_id in ipmi_kcs_init ......................................................................
drivers/ipmi: retry ipmi_get_device_id in ipmi_kcs_init
Based on our test, there is probability that ipmi init fails in DC Cycle stress test, so we add this retry mechanism.
Change-Id: I2b2b15170c3ac9785b6e1cc7f93738f7badc7435 Signed-off-by: wanghao11 wanghao11@inspur.com Signed-off-by: Ziang Wang ziang.wang@intel.com --- M src/drivers/ipmi/ipmi_kcs_ops.c 1 file changed, 18 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/75739/1
diff --git a/src/drivers/ipmi/ipmi_kcs_ops.c b/src/drivers/ipmi/ipmi_kcs_ops.c index 2e5378f..9bf3e14 100644 --- a/src/drivers/ipmi/ipmi_kcs_ops.c +++ b/src/drivers/ipmi/ipmi_kcs_ops.c @@ -65,6 +65,8 @@ uint32_t man_id = 0, prod_id = 0; struct drivers_ipmi_config *conf = dev->chip_info; const struct gpio_operations *gpio_ops; + struct ipmi_selftest_rsp selftestrsp = {0}; + int retries = 10;
if (!conf) { printk(BIOS_WARNING, "IPMI: chip_info is missing! Skip init.\n"); @@ -127,6 +129,22 @@ return; }
+ while (ipmi_get_device_id(dev, &rsp)) { + retries--; + printk(BIOS_DEBUG, "IPMI: BMC does not respond to get device id, %d retries left\n", + retries); + if (retries == 0) { + dev->enabled = 0; + break; + } + mdelay(1000); + } + + if (!dev->enabled) { + printk(BIOS_ERR, "IPMI: BMC does not respond to get device id even after retries.\n"); + return; + } + /* Queried the IPMI revision from BMC */ ipmi_revision_minor = IPMI_IPMI_VERSION_MINOR(rsp.ipmi_version); ipmi_revision_major = IPMI_IPMI_VERSION_MAJOR(rsp.ipmi_version);