From: Frank Li <Frank.li@oss.nxp.com>
To: Rui Wang <wr574332525@163.com>
Cc: alexandre.belloni@bootlin.com, Frank.Li@nxp.com,
linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] i3c: dw: Prevent premature transfer completion on IBI
Date: Fri, 13 Nov 2026 16:07:56 -0500 [thread overview]
Message-ID: <avd8LPup7jOtWmdY@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20261112090538.1917-1-wr574332525@163.com>
On Thu, Nov 12, 2026 at 05:05:38PM +0800, Rui Wang wrote:
> An IBI threshold interrupt can arrive while a transfer is pending and
> before its command responses are ready. The IRQ handler calls
> dw_i3c_master_end_xfer_locked() even for an IBI-only interrupt. If the
> response queue is empty, the function completes the transfer with a
> return value of zero. Later responses can remain unconsumed and keep the
> response-ready interrupt asserted.
>
> Only call the transfer completion handler when INTR_MASTER_MASK
> indicates that responses are ready or a transfer error has occurred.
> An IBI-only interrupt leaves the transfer pending.
>
> The fix was tested successfully on FPGA hardware.
>
> Fixes: e389b1d72a624 ("i3c: dw: Add support for in-band interrupts")
> Signed-off-by: Rui Wang <wr574332525@163.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Changes in v2
> - Use Rui Wang in the author and sign-off fields.
>
> The possible queue stall reported by Sashiko is in the timeout recovery
> path and predates this patch. If I can reproduce it, I'll send a
> separate fix.
>
> drivers/i3c/master/dw-i3c-master.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index 34aa8f8..19735ec 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -1527,7 +1527,8 @@ static irqreturn_t dw_i3c_master_irq_handler(int irq, void *dev_id)
> }
>
> spin_lock(&master->xferqueue.lock);
> - dw_i3c_master_end_xfer_locked(master, status);
> + if (status & INTR_MASTER_MASK)
> + dw_i3c_master_end_xfer_locked(master, status);
> if (status & INTR_TRANSFER_ERR_STAT)
> writel(INTR_TRANSFER_ERR_STAT, master->regs + INTR_STATUS);
> spin_unlock(&master->xferqueue.lock);
>
> base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
> --
> 2.53.0.windows.2
>
prev parent reply other threads:[~2026-11-13 21:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 9:05 Rui Wang
2026-11-13 21:07 ` Frank Li [this message]
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=avd8LPup7jOtWmdY@lizhi-Precision-Tower-5810 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wr574332525@163.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
all inboxes | Powered by JetHome®