]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ipmi: Use dev_warn_ratelimited() for incorrect message warnings
authorBreno Leitao <leitao@debian.org>
Thu, 10 Jul 2025 12:57:26 +0000 (05:57 -0700)
committerCorey Minyard <corey@minyard.net>
Thu, 10 Jul 2025 12:59:43 +0000 (07:59 -0500)
During BMC firmware upgrades on live systems, the ipmi_msghandler
generates excessive "BMC returned incorrect response" warnings
while the BMC is temporarily offline. This can flood system logs
in large deployments.

Replace dev_warn() with dev_warn_ratelimited() to throttle these
warnings and prevent log spam during BMC maintenance operations.

Signed-off-by: Breno Leitao <leitao@debian.org>
Message-ID: <20250710-ipmi_ratelimit-v1-1-6d417015ebe9@debian.org>
Signed-off-by: Corey Minyard <corey@minyard.net>
drivers/char/ipmi/ipmi_msghandler.c

index 064944ae9fdc39f8d866df2f1b23aba87627951d..8e9050f99e9effcbf9abf18a1f59a6c46e2373a5 100644 (file)
@@ -4607,10 +4607,10 @@ return_unspecified:
                 * The NetFN and Command in the response is not even
                 * marginally correct.
                 */
-               dev_warn(intf->si_dev,
-                        "BMC returned incorrect response, expected netfn %x cmd %x, got netfn %x cmd %x\n",
-                        (msg->data[0] >> 2) | 1, msg->data[1],
-                        msg->rsp[0] >> 2, msg->rsp[1]);
+               dev_warn_ratelimited(intf->si_dev,
+                                    "BMC returned incorrect response, expected netfn %x cmd %x, got netfn %x cmd %x\n",
+                                    (msg->data[0] >> 2) | 1, msg->data[1],
+                                    msg->rsp[0] >> 2, msg->rsp[1]);
 
                goto return_unspecified;
        }