Commit ca8c1c53 authored by Wen Yang's avatar Wen Yang Committed by Corey Minyard

ipmi: rate limit ipmi smi_event failure message

Sometimes we can't get a valid si_sm_data, and we print an error
message accordingly. But the ipmi module seem to like retrying a lot,
in which case we flood the kernel log with a lot of messages, eg:

[46318019.164726] ipmi_si IPI0001:00: Could not set the global enables: 0xc1.
[46318020.109700] ipmi_si IPI0001:00: Could not set the global enables: 0xc1.
[46318021.158677] ipmi_si IPI0001:00: Could not set the global enables: 0xc1.
[46318022.212598] ipmi_si IPI0001:00: Could not set the global enables: 0xc1.
[46318023.258564] ipmi_si IPI0001:00: Could not set the global enables: 0xc1.
[46318024.210455] ipmi_si IPI0001:00: Could not set the global enables: 0xc1.
[46318025.260473] ipmi_si IPI0001:00: Could not set the global enables: 0xc1.
[46318026.308445] ipmi_si IPI0001:00: Could not set the global enables: 0xc1.
[46318027.356389] ipmi_si IPI0001:00: Could not set the global enables: 0xc1.
[46318028.298288] ipmi_si IPI0001:00: Could not set the global enables: 0xc1.
[46318029.363302] ipmi_si IPI0001:00: Could not set the global enables: 0xc1.
Signed-off-by: default avatarWen Yang <wenyang@linux.alibaba.com>
Cc: Baoyou Xie <baoyou.xie@alibaba-inc.com>
Cc: Corey Minyard <minyard@acm.org>
Cc: openipmi-developer@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Message-Id: <20210729093228.77098-1-wenyang@linux.alibaba.com>
[Added a missing comma]
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
parent 8baef638
...@@ -591,7 +591,7 @@ static void handle_transaction_done(struct smi_info *smi_info) ...@@ -591,7 +591,7 @@ static void handle_transaction_done(struct smi_info *smi_info)
smi_info->handlers->get_result(smi_info->si_sm, msg, 3); smi_info->handlers->get_result(smi_info->si_sm, msg, 3);
if (msg[2] != 0) { if (msg[2] != 0) {
/* Error clearing flags */ /* Error clearing flags */
dev_warn(smi_info->io.dev, dev_warn_ratelimited(smi_info->io.dev,
"Error clearing flags: %2.2x\n", msg[2]); "Error clearing flags: %2.2x\n", msg[2]);
} }
smi_info->si_state = SI_NORMAL; smi_info->si_state = SI_NORMAL;
...@@ -683,10 +683,10 @@ static void handle_transaction_done(struct smi_info *smi_info) ...@@ -683,10 +683,10 @@ static void handle_transaction_done(struct smi_info *smi_info)
/* We got the flags from the SMI, now handle them. */ /* We got the flags from the SMI, now handle them. */
smi_info->handlers->get_result(smi_info->si_sm, msg, 4); smi_info->handlers->get_result(smi_info->si_sm, msg, 4);
if (msg[2] != 0) { if (msg[2] != 0) {
dev_warn(smi_info->io.dev, dev_warn_ratelimited(smi_info->io.dev,
"Couldn't get irq info: %x.\n", msg[2]); "Couldn't get irq info: %x,\n"
dev_warn(smi_info->io.dev, "Maybe ok, but ipmi might run very slowly.\n",
"Maybe ok, but ipmi might run very slowly.\n"); msg[2]);
smi_info->si_state = SI_NORMAL; smi_info->si_state = SI_NORMAL;
break; break;
} }
...@@ -721,7 +721,7 @@ static void handle_transaction_done(struct smi_info *smi_info) ...@@ -721,7 +721,7 @@ static void handle_transaction_done(struct smi_info *smi_info)
smi_info->handlers->get_result(smi_info->si_sm, msg, 4); smi_info->handlers->get_result(smi_info->si_sm, msg, 4);
if (msg[2] != 0) if (msg[2] != 0)
dev_warn(smi_info->io.dev, dev_warn_ratelimited(smi_info->io.dev,
"Could not set the global enables: 0x%x.\n", "Could not set the global enables: 0x%x.\n",
msg[2]); msg[2]);
...@@ -1343,7 +1343,7 @@ static int try_get_dev_id(struct smi_info *smi_info) ...@@ -1343,7 +1343,7 @@ static int try_get_dev_id(struct smi_info *smi_info)
if (cc != IPMI_CC_NO_ERROR && if (cc != IPMI_CC_NO_ERROR &&
++retry_count <= GET_DEVICE_ID_MAX_RETRY) { ++retry_count <= GET_DEVICE_ID_MAX_RETRY) {
dev_warn(smi_info->io.dev, dev_warn_ratelimited(smi_info->io.dev,
"BMC returned 0x%2.2x, retry get bmc device id\n", "BMC returned 0x%2.2x, retry get bmc device id\n",
cc); cc);
goto retry; goto retry;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment