]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: arm_scmi: Rate-limit queue-full warnings in IRQ context
authorPushpendra Singh <pushpendra.singh@oss.qualcomm.com>
Wed, 8 Jul 2026 07:23:39 +0000 (12:53 +0530)
committerSudeep Holla <sudeep.holla@arm.com>
Thu, 9 Jul 2026 13:34:41 +0000 (14:34 +0100)
The scmi_notify() function is called from interrupt context to queue
received notification events onto a per-protocol kfifo. When the kfifo
is full, it logs a warning via dev_warn() for every dropped event.

Under conditions where the platform sends a burst of SCMI notifications
faster than the deferred worker can drain the queue, this results in a
flood of dev_warn() calls from IRQ context. Each call acquires the
console lock and may execute blocking console writes, causing the CPU
to be held in interrupt context for an extended period and leading to
observable system stalls.

Fix this by switching to dev_warn_ratelimited() to limit the frequency
of log messages when the notification queue is full. This reduces
console overhead in interrupt context and prevents CPU stalls caused by
excessive logging, while still preserving diagnostic visibility.

Fixes: bd31b249692e ("firmware: arm_scmi: Add notification dispatch and delivery")
Signed-off-by: Pushpendra Singh <pushpendra.singh@oss.qualcomm.com>
Link: https://patch.msgid.link/20260708072339.3021140-1-pushpendra.singh@oss.qualcomm.com
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
drivers/firmware/arm_scmi/notify.c

index 40ec184eedaecc31c9f8b67c607dfbaae23fc911..0a192cf2deab62471d85b204a2d48ad12f2276b6 100644 (file)
@@ -600,9 +600,9 @@ int scmi_notify(const struct scmi_handle *handle, u8 proto_id, u8 evt_id,
                return -EINVAL;
        }
        if (kfifo_avail(&r_evt->proto->equeue.kfifo) < sizeof(eh) + len) {
-               dev_warn(handle->dev,
-                        "queue full, dropping proto_id:%d  evt_id:%d  ts:%lld\n",
-                        proto_id, evt_id, ktime_to_ns(ts));
+               dev_warn_ratelimited(handle->dev,
+                                    "queue full, dropping proto_id:%d  evt_id:%d  ts:%lld\n",
+                                    proto_id, evt_id, ktime_to_ns(ts));
                return -ENOMEM;
        }