From: Terry Duncan <[email protected]>

Rarely but still failures are observed while getting BMC device ID
so this commit changes the condition to retry to get device id
when cc is not IPMI_CC_NO_ERROR.

Signed-off-by: Terry Duncan <[email protected]>
Signed-off-by: Jae Hyun Yoo <[email protected]>
---
Changes since v1:
 - Changed the condition to make it retry when cc isn't IPMI_CC_NO_ERROR.

 drivers/char/ipmi/ipmi_msghandler.c | 6 ++----
 drivers/char/ipmi/ipmi_si_intf.c    | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
b/drivers/char/ipmi/ipmi_msghandler.c
index c44ad18464f1..f19f0f967e28 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -2447,10 +2447,8 @@ static int __get_device_id(struct ipmi_smi *intf, struct 
bmc_device *bmc)
        wait_event(intf->waitq, bmc->dyn_id_set != 2);
 
        if (!bmc->dyn_id_set) {
-               if ((bmc->cc == IPMI_DEVICE_IN_FW_UPDATE_ERR
-                    || bmc->cc ==  IPMI_DEVICE_IN_INIT_ERR
-                    || bmc->cc ==  IPMI_NOT_IN_MY_STATE_ERR)
-                    && ++retry_count <= GET_DEVICE_ID_MAX_RETRY) {
+               if (bmc->cc != IPMI_CC_NO_ERROR &&
+                   ++retry_count <= GET_DEVICE_ID_MAX_RETRY) {
                        msleep(500);
                        dev_warn(intf->si_dev,
                            "BMC returned 0x%2.2x, retry get bmc device id\n",
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 5eac94cf4ff8..be41a473e3c2 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1346,10 +1346,8 @@ static int try_get_dev_id(struct smi_info *smi_info)
                /* record completion code */
                unsigned char cc = *(resp + 2);
 
-               if ((cc == IPMI_DEVICE_IN_FW_UPDATE_ERR
-                   || cc == IPMI_DEVICE_IN_INIT_ERR
-                   || cc == IPMI_NOT_IN_MY_STATE_ERR)
-                   && ++retry_count <= GET_DEVICE_ID_MAX_RETRY) {
+               if (cc != IPMI_CC_NO_ERROR &&
+                   ++retry_count <= GET_DEVICE_ID_MAX_RETRY) {
                        dev_warn(smi_info->io.dev,
                            "BMC returned 0x%2.2x, retry get bmc device id\n",
                            cc);
-- 
2.17.1



_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to