From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94C521DED40 for ; Mon, 10 Aug 2026 01:31:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786325468; cv=none; b=SzD/BXnkFw7G45+mKODA4RHh0G3LeYVqJenavVJQ2QjIiIsmbHtmeVXTcEoHoK9J1nBHw0pt253u75yV/MXqmwwJEsWUAkorM16G6V937BNF1SMS4u2SkJ3cESqOFY0j1G+M0yL8doVs8ap1Ej4ipgTf22n7621QelfcZ+tAfXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786325468; c=relaxed/simple; bh=Yitd1FyosFoz0otnvmJ0c0ezDSLwtslcpE7nTXOsnds=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=OHXOmJisqBvinidriExfYT0QeZV3gHY7b4PvKnWUPC9nDwrji1K/k8TrptxG055PBEE1lxCnbCh8R3XjmEf5k6VEONdCOZqUGex6cu+acdaeqngpb9Aq33RuK9xs4cQQPa4hlZ2jW25CMZU1cL4Wo3aOz6t7+tMlLfgcq8uPKUQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UtyiY0py; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UtyiY0py" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-381b831d535so1678835a91.0 for ; Sun, 09 Aug 2026 18:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786325467; x=1786930267; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=FZgz3ItH2Xd3Ug8izPKPXju25py60rR+KSsgX4sTFoY=; b=UtyiY0pyBxgPz6R9wnpV5DVcI3xjMUj4QMCHRd07tHKDY4N07mmWwWHmCWj329SdMa oLx1+vcnf614wEM7uPk3AX4mHKCueDMj26eJ/8W0WWvLWNUF0iKqo7rISBhGRZ69lR0D 6/6grj+tmEOWpyphe4WBNGp6V/It2OTqYKA7FRX8GwocXrie+yPM507z66plbP3M77CV 8gaoAxMttXCp/iI6RiX/dJJdwWdpHnLz92oiy9FJltvBnbgm99KlM8I9ubPbGsDQoUwm XIxO+2GmeomX7/WxcTsevfYaNhbCVM+gn5p9Ht4X8dRrYovJdBngY4bvMx4apETf4mz3 HFGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786325467; x=1786930267; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=FZgz3ItH2Xd3Ug8izPKPXju25py60rR+KSsgX4sTFoY=; b=BT/PybHOCgZTNSbCLhNRytGLUz2xs3Zt+ajYwEITQitYdM2/Xrwo11t22CNT1ZORss L3G4aSgl/vVjODaZDvPWftMhoSLmP9k99Ckb5ZeUlwzh130vX8yJVT3hrMF8aIQ+l5Ht +OM5wy1xcBHaYNUOT8kSebuSwZGz8Tgf9UX5IsvA89Ae8jmPYGuPKJ/xCrFsgoD1bEgL ylcBwO3m5TBsB9DPrz+cLEZ1qwsOQZv4LdnLjJKO3NE93NHtr83zz4NYeC5emtStjakn xn+QMxM3k0ZBDOHR8r9moShTQwiwnUa2wGqqL+mhSfy1HCAnFvVYJvha4JKaRpIGblpb lQuw== X-Gm-Message-State: AOJu0YybJRsIvuEjjRMHwWD+ZvEQ7m+nRf05hY7TyYRcgGIRuGMcVwEG fVnD1u00vDmDkffso3qTfXuOnKX1NNi7HbkGaPP5emmJlGYgN8+5Cw84 X-Gm-Gg: AR+sD112h6t1v8Nib10l0m/lJ2h5v4TDaWPb4xCc4uPwbjcrYtnxGUiS+f9MTinVDQe KMeyzmU44vFE9HxevjyloKxt4SmlL+X4pcRWCHYblMT8imXXSeL0yL301UJKNGjPrp9dokXMb8/ qd5SrOUn9245QoMAjlpctfXanDUGmFteMeqYxIW65RRuAVoUPLEvwsAgkVgVER08Ad/M1T+R83j ix7SQUFLOS70TDDUjs8/QhFBjSH+KEmpzeEMdc8soJ/C44uIi5s4v5h5JJSB8zuuYnCUfYiSoEe uCPbhZPTowMvi6aMq+bvSe//3i46jxf+TdKbtn1Cy+hzZScG+vD/1Er68qzRwweHkHDVBObfiw9 51HQnBaMWAw1ADbF5WA2sZi7NOHRcdqe25FYCpQtYS4r0Zqik5rjBU3C/SB185Fs/Mu4m9fGu/R aWOb/uInFYyv31aFD2fs3A5/TRe63fNua5AZfRfunxfJFq5qNSnkAoBXHnmmwKx+c6L1A= X-Received: by 2002:a17:90b:4c03:b0:38e:655c:6516 with SMTP id 98e67ed59e1d1-39261d10765mr15210520a91.0.1786325466885; Sun, 09 Aug 2026 18:31:06 -0700 (PDT) Received: from cs20-buildserver.. ([2402:7500:502:897d:707a:c9da:8c8a:cc]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-390b15ab898sm4941419a91.1.2026.08.09.18.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Aug 2026 18:31:06 -0700 (PDT) From: Stanley Chu X-Google-Original-From: Stanley Chu To: frank.li@nxp.com, miquel.raynal@bootlin.com, alexandre.belloni@bootlin.com, linux-i3c@lists.infradead.org Cc: linux-kernel@vger.kernel.org, tomer.maimon@nuvoton.com, kwliu@nuvoton.com, yschu@nuvoton.com Subject: [PATCH v1] i3c: master: allocate IBI workqueue with WQ_HIGHPRI Date: Mon, 10 Aug 2026 09:30:59 +0800 Message-Id: <20260810013059.3055787-1-yschu@nuvoton.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Stanley Chu 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 --- drivers/i3c/master.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index f1be38a640ca..8fdd67a031ff 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -3505,7 +3505,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; -- 2.34.1