[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z7dpwL6GGN/Msm8+@lizhi-Precision-Tower-5810>
Date: Thu, 20 Feb 2025 12:43:28 -0500
From: Frank Li <Frank.li@....com>
To: Stanley Chu <stanley.chuys@...il.com>
Cc: miquel.raynal@...tlin.com, alexandre.belloni@...tlin.com,
linux-i3c@...ts.infradead.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, tomer.maimon@...oton.com,
kwliu@...oton.com, yschu@...oton.com
Subject: Re: [PATCH RESEND v2 4/4] i3c: master: svc: Fix npcm845 invalid
slvstart event
On Thu, Feb 20, 2025 at 02:11:07PM +0800, Stanley Chu wrote:
> From: Stanley Chu <yschu@...oton.com>
>
> 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
^^^ is? "should be"
look like unconfirmed.
> the MSTATUS state to ignore the false event.
>
> Signed-off-by: Stanley Chu <yschu@...oton.com>
Reviewed-by: Frank Li <Frank.Li@....com>
> ---
> drivers/i3c/master/svc-i3c-master.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
> index 2140da3f5187..5861358eb9e5 100644
> --- a/drivers/i3c/master/svc-i3c-master.c
> +++ b/drivers/i3c/master/svc-i3c-master.c
> @@ -58,6 +58,7 @@
> #define SVC_I3C_MSTATUS 0x088
> #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_SLVREQ(x) (SVC_I3C_MSTATUS_STATE(x) == 1)
> #define SVC_I3C_MSTATUS_STATE_IDLE(x) (SVC_I3C_MSTATUS_STATE(x) == 0)
> #define SVC_I3C_MSTATUS_BETWEEN(x) FIELD_GET(BIT(4), (x))
> #define SVC_I3C_MSTATUS_NACKED(x) FIELD_GET(BIT(5), (x))
> @@ -589,6 +590,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_FALSE_SLVSTART) &&
> + !SVC_I3C_MSTATUS_STATE_SLVREQ(active))
> + return IRQ_HANDLED;
> +
> svc_i3c_master_disable_interrupts(master);
>
> /* Handle the interrupt in a non atomic context */
> --
> 2.34.1
>
Powered by blists - more mailing lists