Skip to content

Commit ca8c1c5

Browse files
tasksetcminyard
authored andcommitted
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. [4631802.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: Wen 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: Corey Minyard <cminyard@mvista.com>
1 parent 8baef63 commit ca8c1c5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/char/ipmi/ipmi_si_intf.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ static void handle_transaction_done(struct smi_info *smi_info)
591591
smi_info->handlers->get_result(smi_info->si_sm, msg, 3);
592592
if (msg[2] != 0) {
593593
/* Error clearing flags */
594-
dev_warn(smi_info->io.dev,
594+
dev_warn_ratelimited(smi_info->io.dev,
595595
"Error clearing flags: %2.2x\n", msg[2]);
596596
}
597597
smi_info->si_state = SI_NORMAL;
@@ -683,10 +683,10 @@ static void handle_transaction_done(struct smi_info *smi_info)
683683
/* We got the flags from the SMI, now handle them. */
684684
smi_info->handlers->get_result(smi_info->si_sm, msg, 4);
685685
if (msg[2] != 0) {
686-
dev_warn(smi_info->io.dev,
687-
"Couldn't get irq info: %x.\n", msg[2]);
688-
dev_warn(smi_info->io.dev,
689-
"Maybe ok, but ipmi might run very slowly.\n");
686+
dev_warn_ratelimited(smi_info->io.dev,
687+
"Couldn't get irq info: %x,\n"
688+
"Maybe ok, but ipmi might run very slowly.\n",
689+
msg[2]);
690690
smi_info->si_state = SI_NORMAL;
691691
break;
692692
}
@@ -721,7 +721,7 @@ static void handle_transaction_done(struct smi_info *smi_info)
721721

722722
smi_info->handlers->get_result(smi_info->si_sm, msg, 4);
723723
if (msg[2] != 0)
724-
dev_warn(smi_info->io.dev,
724+
dev_warn_ratelimited(smi_info->io.dev,
725725
"Could not set the global enables: 0x%x.\n",
726726
msg[2]);
727727

@@ -1343,7 +1343,7 @@ static int try_get_dev_id(struct smi_info *smi_info)
13431343

13441344
if (cc != IPMI_CC_NO_ERROR &&
13451345
++retry_count <= GET_DEVICE_ID_MAX_RETRY) {
1346-
dev_warn(smi_info->io.dev,
1346+
dev_warn_ratelimited(smi_info->io.dev,
13471347
"BMC returned 0x%2.2x, retry get bmc device id\n",
13481348
cc);
13491349
goto retry;

0 commit comments

Comments
 (0)