Hi Corey,

On 2/24/2021 6:34 PM, Corey Minyard wrote:
On Mon, Feb 22, 2021 at 08:41:58AM -0800, Jae Hyun Yoo wrote:
From: Terry Duncan <terry.s.dun...@intel.com>

Rarely but still failures are observed while getting BMC device ID
so this commit adds more conditions to retry to get device id.

I suppose this is ok.  Any more and I'd say just retry on any error.


Yes, that makes sense. I'll change the condition to make it retry
when cc isn't IPMI_CC_NO_ERROR. Will submit v2 soon.

Thanks,
Jae

-corey


Signed-off-by: Terry Duncan <terry.s.dun...@intel.com>
Signed-off-by: Jae Hyun Yoo <jae.hyun....@linux.intel.com>
---
  drivers/char/ipmi/ipmi_msghandler.c | 5 ++++-
  drivers/char/ipmi/ipmi_si_intf.c    | 5 ++++-
  include/uapi/linux/ipmi_msgdefs.h   | 1 +
  3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
b/drivers/char/ipmi/ipmi_msghandler.c
index c44ad18464f1..decd33535ff7 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -2449,7 +2449,10 @@ static int __get_device_id(struct ipmi_smi *intf, struct 
bmc_device *bmc)
        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)
+                    || bmc->cc ==  IPMI_NOT_IN_MY_STATE_ERR
+                    || bmc->cc ==  IPMI_TIMEOUT_ERR
+                    || bmc->cc ==  IPMI_RESPONSE_UNAVAILABLE
+                    || bmc->cc ==  IPMI_NODE_BUSY_ERR)
                     && ++retry_count <= GET_DEVICE_ID_MAX_RETRY) {
                        msleep(500);
                        dev_warn(intf->si_dev,
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 5eac94cf4ff8..c315f3fb0fc2 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1348,7 +1348,10 @@ static int try_get_dev_id(struct smi_info *smi_info)
if ((cc == IPMI_DEVICE_IN_FW_UPDATE_ERR
                    || cc == IPMI_DEVICE_IN_INIT_ERR
-                   || cc == IPMI_NOT_IN_MY_STATE_ERR)
+                   || cc == IPMI_NOT_IN_MY_STATE_ERR
+                   || cc == IPMI_TIMEOUT_ERR
+                   || cc == IPMI_RESPONSE_UNAVAILABLE
+                   || cc == IPMI_NODE_BUSY_ERR)
                    && ++retry_count <= GET_DEVICE_ID_MAX_RETRY) {
                        dev_warn(smi_info->io.dev,
                            "BMC returned 0x%2.2x, retry get bmc device id\n",
diff --git a/include/uapi/linux/ipmi_msgdefs.h 
b/include/uapi/linux/ipmi_msgdefs.h
index 0934af3b8037..dbadbad71930 100644
--- a/include/uapi/linux/ipmi_msgdefs.h
+++ b/include/uapi/linux/ipmi_msgdefs.h
@@ -69,6 +69,7 @@
  #define IPMI_ERR_MSG_TRUNCATED                0xc6
  #define IPMI_REQ_LEN_INVALID_ERR      0xc7
  #define IPMI_REQ_LEN_EXCEEDED_ERR     0xc8
+#define IPMI_RESPONSE_UNAVAILABLE      0xce
  #define IPMI_DEVICE_IN_FW_UPDATE_ERR  0xd1
  #define IPMI_DEVICE_IN_INIT_ERR               0xd2
  #define IPMI_NOT_IN_MY_STATE_ERR      0xd5    /* IPMI 2.0 */
--
2.17.1



_______________________________________________
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to