public inbox for linux-i3c@lists.infradead.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: Stanley Chu <stanley.chuys@gmail.com>
Cc: miquel.raynal@bootlin.com, alexandre.belloni@bootlin.com,
	linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org,
	tomer.maimon@nuvoton.com, kwliu@nuvoton.com, yschu@nuvoton.com
Subject: Re: [PATCH v1 2/2] i3c: master: svc: Prevent IRQ storm from false SLVSTART on NPCM845
Date: Wed, 22 Apr 2026 05:20:25 -0400	[thread overview]
Message-ID: <aeiS2dvbWw_o-tl5@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260413005040.1211107-3-yschu@nuvoton.com>

On Mon, Apr 13, 2026 at 08:50:40AM +0800, Stanley Chu wrote:
> From: Stanley Chu <yschu@nuvoton.com>
>
> 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 <yschu@nuvoton.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  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
>

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

  reply	other threads:[~2026-04-22  9:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13  0:50 [PATCH v1 0/2] i3c: master: svc: Fix false SLVSTART issues on NPCM845 Stanley Chu
2026-04-13  0:50 ` [PATCH v1 1/2] i3c: master: svc: Fix missed IBI after false SLVSTART " Stanley Chu
2026-04-13  1:16   ` Frank Li
2026-04-13  1:40     ` Stanley Chu
2026-04-13  3:00       ` Frank Li
2026-04-13  3:59         ` Stanley Chu
2026-04-22  9:19           ` Frank Li
2026-04-13  0:50 ` [PATCH v1 2/2] i3c: master: svc: Prevent IRQ storm from " Stanley Chu
2026-04-22  9:20   ` Frank Li [this message]
2026-04-30 10:01 ` [PATCH v1 0/2] i3c: master: svc: Fix false SLVSTART issues " Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aeiS2dvbWw_o-tl5@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=kwliu@nuvoton.com \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=stanley.chuys@gmail.com \
    --cc=tomer.maimon@nuvoton.com \
    --cc=yschu@nuvoton.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox