From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 2DF791D7995 for ; Mon, 13 Apr 2026 00:51:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776041475; cv=none; b=CoCUbvrDe/oG3VbLu7n3t01+q95AUlH64sjjjN1ruuj8ZOdDXQFmgPuE91LoWAbQLgd1c1iqhLg/AR++J4KaH/0XD4r7e+GL4LP0kWey6cMo+ks6cB8G2JHVQB3mogZW32UfHl2vb/kbaISuco+UYFNRp03liY5saQTVvoPyoSc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776041475; c=relaxed/simple; bh=J5JCMO0mybBMJ0j6iqUg+QqWCY+W840OH1XVFXt6gsM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bes3V+nFAHgDuvoVRzHTXiF6RKdA1bnsA43ba0QInBhg8JpJcfX7/REQAnXDSR8/r9QRcl1S9b/+5QsKTaJZAKhzWQh3/OcpPragNWtnTxBoazF8j9b967tCXPscf6yrTUS2e7yL8flpldUdhSRYM6Kc5+ePtHrgrXh2nuT5JdE= 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=oF778ici; arc=none smtp.client-ip=209.85.214.181 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="oF778ici" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2b2d3a9e149so9389945ad.1 for ; Sun, 12 Apr 2026 17:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776041473; x=1776646273; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fCdLQUwKUq/TaTvCHPiaOA9I4AIEnq8NxSjBkqK9qpc=; b=oF778iciysPB0+FxiuZGwNJXGyodoTUELIfyMaPWP/AsHHjXpK8PufpkcFx8GI8FrC fEUNgqTb4CZP4THw1nLSUSn9aNf86hn3sQCU12Vnim6Nd/7G1en74ReTLTO9DcAz38o0 Uu9uioFwUT8U1h0S713XKNkFWNSAnJUemlg7Z6wvubprT982rDLWPjwSclcvPDS1Q5rI HWF5OB4PRo5jtDPMFdTlNl3xePKwNZv649sPMg1crsOd99KWSw7JU9J9oyrcdmgCX2iW YrwSaJVRWBbgQx2OqjAitrzpNZLbuFwUEyDR85PNMcWBAo73WKpQBZh1D1hG/GXDyipy PdGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776041473; x=1776646273; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fCdLQUwKUq/TaTvCHPiaOA9I4AIEnq8NxSjBkqK9qpc=; b=rvx1EezVyr+VS+7d3MxBvGkJjm6WoQYS7auCHEb/rhtlz4k1b6JV5o3hm6hdK3reOp MZmgDaea+yRTXnq8p9oA4FZERiprMSLddjG/g84QFNvrbiCKngYALRwrn/8k/PWcu9UQ dMVwwDfuxSCg9L1OngUIyqD19BZkgCL9ms7VmPXTuR/VxVnC6nNThneTJtHcPlO7E43a yNRxHdxZDrjnvLudVYeNhBwA+0lsDS2YCJJL9eMLT6rQPt0QTjMJ4Sj5pwdm6RoFMfSY KLvs6MbZ7wHoafZP9SURXB225WIhrgq3Y8sAzKYV682lG3ibjAoQjD5EFLAf8hNysJ02 eSaw== X-Gm-Message-State: AOJu0YxYqIbEmmpap49gEf18rqLSWoU74UEtASJRXawa06K0IWioyaK/ 2eqGu0K0kVhfygJ5PilNhE27UPM6Opq84mTrjqafyc1qPT38Hm5xITHD X-Gm-Gg: AeBDieuC/80ub3IW7PMna4UKR3PduYWHPr0rI3hkgHuBLysPAfNU4AMy4RPAhbGgyg7 cfFGLRLzTomsFyC/EMJxh03blSTaj0tQNemIA4kubRPLgS/yvVnwbEJgRT5JyeEzKDp9YVIHpQ1 2aPXR0rKUbXuG/xcHtaXvLTK9fH99XsJ7HrWiVmDmHmvIpVJ/jkk1TkEc5pj7o+SCnu3itZwiDr Pasd4iVu9eF4+buBSfKerQSzQas7k7EKSOvX+02bob6h2rJhluPp5ZDg6zJ/Z/kEVCuHTne5cpO 5jYM6Iz80msBq2D/+J/pqM7zeRNR6qMPTJa9Z3halRZwr4T2cJbJ9NtOIS1wwhKn63QpbkZqM45 V6d2KD8DrrQCYevy1eQ5EIy7ai6zdsUyRtA0iYWOoMdINaPbMQvyDd2c5Z9Iag2y0rIYhQcMd20 /5cQR2HWaaHxPjNqFNqsqHgwn3mZIHeDcM X-Received: by 2002:a17:903:2ed0:b0:2ae:5346:d4e6 with SMTP id d9443c01a7336-2b2c73a4423mr142859085ad.28.1776041473608; Sun, 12 Apr 2026 17:51:13 -0700 (PDT) Received: from cs20-buildserver.lan ([2402:7500:400:8d94:2e0:4cff:fe68:863]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b45f6c0219sm10828465ad.10.2026.04.12.17.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Apr 2026 17:51:13 -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 2/2] i3c: master: svc: Prevent IRQ storm from false SLVSTART on NPCM845 Date: Mon, 13 Apr 2026 08:50:40 +0800 Message-Id: <20260413005040.1211107-3-yschu@nuvoton.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260413005040.1211107-1-yschu@nuvoton.com> References: <20260413005040.1211107-1-yschu@nuvoton.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Stanley Chu On NPCM845, when a target on the I3C bus gets stuck holding SDA low, the controller reports a false Master Request (MR) in-band interrupt event. The driver handles this by emitting a STOP condition to restore the bus. However, the hardware quirk SVC_I3C_QUIRK_FALSE_SLVSTART indicates that emitting a STOP condition may spuriously set the SLVSTART interrupt status bit. In the Master Request case, this creates a feedback loop: the STOP triggers a new SLVSTART event, the IRQ handler fires again, the controller still reports an MR type, another STOP is emitted, and the cycle repeats indefinitely, resulting in an IRQ storm that can lock up the CPU. Clear the SLVSTART status bit explicitly after emitting the STOP in the Master Request IBI handler when the SVC_I3C_QUIRK_FALSE_SLVSTART quirk is set. This breaks the feedback loop without affecting normal SLVSTART processing, which is already guarded in the top-level IRQ handler by checking that MSTATUS is in SLVREQ state. Signed-off-by: Stanley Chu --- drivers/i3c/master/svc-i3c-master.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 7d88e8fe3742..c16397013334 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -655,6 +655,15 @@ static void svc_i3c_master_ibi_isr(struct svc_i3c_master *master) break; case SVC_I3C_MSTATUS_IBITYPE_MASTER_REQUEST: svc_i3c_master_emit_stop(master); + + /* + * If a target gets stuck holding SDA low, the controller reports a MR. + * On NPCM845, emitting STOP may spuriously set SLVSTART, retriggering + * the interrupt and re-entering MR handling, leading to an IRQ storm. + * Clear SLVSTART after STOP to break the loop. + */ + if (svc_has_quirk(master, SVC_I3C_QUIRK_FALSE_SLVSTART)) + writel(SVC_I3C_MINT_SLVSTART, master->regs + SVC_I3C_MSTATUS); break; default: break; -- 2.34.1