From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Clark Wang <xiaoning.wang@nxp.com>
Cc: conor.culhane@silvaco.com, alexandre.belloni@bootlin.com,
linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i3c: master: svc: add NACK check after start byte sent
Date: Mon, 22 May 2023 10:33:27 +0200 [thread overview]
Message-ID: <20230522103327.16e95d02@xps-13> (raw)
In-Reply-To: <20230517033030.3068085-3-xiaoning.wang@nxp.com>
Hi Clark,
xiaoning.wang@nxp.com wrote on Wed, 17 May 2023 11:30:30 +0800:
> Add NACK check after start byte is sent.
> It is possible to detect early that a device is not on the bus
> and avoid invalid transmissions thereafter.
>
> Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Nice addition.
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.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 4edf33ed207d..0d63b732ef0c 100644
> --- a/drivers/i3c/master/svc-i3c-master.c
> +++ b/drivers/i3c/master/svc-i3c-master.c
> @@ -92,6 +92,7 @@
> #define SVC_I3C_MINTCLR 0x094
> #define SVC_I3C_MINTMASKED 0x098
> #define SVC_I3C_MERRWARN 0x09C
> +#define SVC_I3C_MERRWARN_NACK BIT(2)
> #define SVC_I3C_MDMACTRL 0x0A0
> #define SVC_I3C_MDATACTRL 0x0AC
> #define SVC_I3C_MDATACTRL_FLUSHTB BIT(0)
> @@ -1014,6 +1015,11 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master,
> if (ret)
> goto emit_stop;
>
> + if (readl(master->regs + SVC_I3C_MERRWARN) & SVC_I3C_MERRWARN_NACK) {
> + ret = -ENXIO;
> + goto emit_stop;
> + }
> +
> if (rnw)
> ret = svc_i3c_master_read(master, in, xfer_len);
> else
Thanks,
Miquèl
next prev parent reply other threads:[~2023-05-22 8:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 3:30 [PATCH] i3c: master: svc: fix i3c suspend/resume issue Clark Wang
2023-05-17 3:30 ` [PATCH] i3c: master: svc: fix cpu schedule in spin lock Clark Wang
2023-05-22 8:32 ` Miquel Raynal
2023-06-04 22:52 ` (subset) " Alexandre Belloni
2023-05-17 3:30 ` [PATCH] i3c: master: svc: add NACK check after start byte sent Clark Wang
2023-05-22 8:33 ` Miquel Raynal [this message]
2023-05-22 8:31 ` [PATCH] i3c: master: svc: fix i3c suspend/resume issue Miquel Raynal
2023-06-04 22:52 ` (subset) " 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=20230522103327.16e95d02@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=alexandre.belloni@bootlin.com \
--cc=conor.culhane@silvaco.com \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiaoning.wang@nxp.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