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 3/3] i3c: master: svc: fix npcm845 invalid slvstart event
Date: Wed, 19 Feb 2025 16:11:23 -0500 [thread overview]
Message-ID: <Z7ZI+9//uliW58+j@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20250219011019.1600058-4-yschu@nuvoton.com>
On Wed, Feb 19, 2025 at 09:10:19AM +0800, Stanley Chu wrote:
> I3C HW may generate an invalid SlvStart event when emitting a STOP.
> If it is a true SlvStart, the MSTATUS state should be SLVREQ.
> Check the MSTATUS state to ignore the false event.
>
> Signed-off-by: Stanley Chu <yschu@nuvoton.com>
> ---
> drivers/i3c/master/svc-i3c-master.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
> index 22cb1f1c1fdc..14cedcb81c52 100644
> --- a/drivers/i3c/master/svc-i3c-master.c
> +++ b/drivers/i3c/master/svc-i3c-master.c
> @@ -59,6 +59,7 @@
> #define SVC_I3C_MSTATUS_STATE(x) FIELD_GET(GENMASK(2, 0), (x))
> #define SVC_I3C_MSTATUS_STATE_DAA(x) (SVC_I3C_MSTATUS_STATE(x) == 5)
> #define SVC_I3C_MSTATUS_STATE_IDLE(x) (SVC_I3C_MSTATUS_STATE(x) == 0)
> +#define SVC_I3C_MSTATUS_STATE_SLVREQ(x) (SVC_I3C_MSTATUS_STATE(x) == 1)
> #define SVC_I3C_MSTATUS_BETWEEN(x) FIELD_GET(BIT(4), (x))
> #define SVC_I3C_MSTATUS_NACKED(x) FIELD_GET(BIT(5), (x))
> #define SVC_I3C_MSTATUS_IBITYPE(x) FIELD_GET(GENMASK(7, 6), (x))
> @@ -143,6 +144,12 @@
> * Fill the FIFO in advance to prevent FIFO from becoming empty.
> */
> #define SVC_I3C_QUIRK_FIFO_EMPTY BIT(0)
> +/*
> + * SVC_I3C_QUIRK_FLASE_SLVSTART:
> + * I3C HW may generate an invalid SlvStart event when emitting a STOP.
> + * If it is a true SlvStart, the MSTATUS state should be SLVREQ.
> + */
> +#define SVC_I3C_QUIRK_FALSE_SLVSTART BIT(1)
>
> struct svc_i3c_cmd {
> u8 addr;
> @@ -576,6 +583,11 @@ static irqreturn_t svc_i3c_master_irq_handler(int irq, void *dev_id)
> /* Clear the interrupt status */
> writel(SVC_I3C_MINT_SLVSTART, master->regs + SVC_I3C_MSTATUS);
>
> + /* Ignore the false event */
> + if ((master->quirks & SVC_I3C_QUIRK_FIFO_EMPTY) &&
You should check SVC_I3C_QUIRK_FALSE_SLVSTART, not SVC_I3C_QUIRK_FIFO_EMPTY
Frank
> + !SVC_I3C_MSTATUS_STATE_SLVREQ(active))
> + return IRQ_HANDLED;
> +
> svc_i3c_master_disable_interrupts(master);
>
> /* Handle the interrupt in a non atomic context */
> @@ -1915,7 +1927,8 @@ static int svc_i3c_master_probe(struct platform_device *pdev)
> svc_i3c_master_reset(master);
>
> if (device_is_compatible(master->dev, "nuvoton,npcm845-i3c"))
> - master->quirks = SVC_I3C_QUIRK_FIFO_EMPTY;
> + master->quirks = SVC_I3C_QUIRK_FIFO_EMPTY |
> + SVC_I3C_QUIRK_FALSE_SLVSTART;
>
> /* Register the master */
> ret = i3c_master_register(&master->base, &pdev->dev,
> --
> 2.34.1
>
prev parent reply other threads:[~2025-02-19 21:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 1:10 [PATCH v1 0/3] Add support for Nuvoton npcm845 i3c controller Stanley Chu
2025-02-19 1:10 ` [PATCH v1 1/3] i3c: master: svc: add support for Nuvoton npcm845 i3c Stanley Chu
2025-02-19 20:43 ` Frank Li
2025-02-19 1:10 ` [PATCH v1 2/3] i3c: master: svc: fix npcm845 FIFO empty issue Stanley Chu
2025-02-19 8:28 ` Miquel Raynal
2025-02-19 21:09 ` Frank Li
2025-02-19 1:10 ` [PATCH v1 3/3] i3c: master: svc: fix npcm845 invalid slvstart event Stanley Chu
2025-02-19 21:11 ` 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=Z7ZI+9//uliW58+j@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
all inboxes | Powered by JetHome®