summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanley Chu <yschu@nuvoton.com>2026-08-10 09:30:59 +0800
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2026-09-17 16:51:06 +0200
commit591980aaaa4645e6511f1387cc6092378a6bb84f (patch)
tree3ecb3d07dca52770ee012ef995f4d2316f6426f7
parentcee9395acd8043be0644b25c34bfa86623f2b935 (diff)
downloadlinux-next-591980aaaa4645e6511f1387cc6092378a6bb84f.tar.gz
linux-next-591980aaaa4645e6511f1387cc6092378a6bb84f.zip
i3c: master: allocate IBI workqueue with WQ_HIGHPRI
The IBI (In-Band Interrupt) workqueue is allocated with only WQ_MEM_RECLAIM, which places IBI payload processing at normal worker priority. This is inadequate given the time-sensitive nature of IBI handling. In the I3C protocol, when a target asserts an IBI, the SDA line is held low until the master acknowledges and completes the exchange. The IRQ handler (top half) ACKs the IBI, reads the payload, emits a STOP, and immediately queues the payload processing to the per-device ordered workqueue via i3c_master_queue_ibi() — effectively the bottom half of the IBI interrupt path. If this workqueue worker is delayed by competing normal-priority tasks, the IBI notification reaches the client driver late. For latency-sensitive clients (e.g. sensors reporting alerts, hotplug events), this defeats the purpose of using IBI over polling. Furthermore, because the ordered workqueue serialises slots, a backlog of delayed slots can exhaust the pre-allocated IBI slot pool, causing subsequent IBIs to be dropped at the hardware level. Add WQ_HIGHPRI to ensure IBI bottom-half work is scheduled promptly after the top-half IRQ handler enqueues it, keeping the IBI processing pipeline consistent with the interrupt-like semantics the protocol demands. Signed-off-by: Stanley Chu <yschu@nuvoton.com> Acked-by: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com> Link: https://patch.msgid.link/20260810013059.3055787-1-yschu@nuvoton.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r--drivers/i3c/master.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index afcd7a21a3e6..4fa90013290f 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -3945,7 +3945,8 @@ int i3c_dev_request_ibi_locked(struct i3c_dev_desc *dev,
if (!ibi)
return -ENOMEM;
- ibi->wq = alloc_ordered_workqueue(dev_name(i3cdev_to_dev(dev->dev)), WQ_MEM_RECLAIM);
+ ibi->wq = alloc_ordered_workqueue(dev_name(i3cdev_to_dev(dev->dev)),
+ WQ_MEM_RECLAIM | WQ_HIGHPRI);
if (!ibi->wq) {
kfree(ibi);
return -ENOMEM;