This is a note to let you know that I've just added the patch titled i3c: master: svc: add NACK check after start byte sent to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: i3c-master-svc-add-nack-check-after-start-byte-sent.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 63edfd1abeecaa4b7901057c36ff7aeb65698316 Author: Clark Wang <xiaoning.wang@xxxxxxx> Date: Wed May 17 11:30:30 2023 +0800 i3c: master: svc: add NACK check after start byte sent [ Upstream commit 49b472ebc61de3d4aa7cc57539246bb39f6c5128 ] 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@xxxxxxx> Reviewed-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx> Link: https://lore.kernel.org/r/20230517033030.3068085-3-xiaoning.wang@xxxxxxx Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx> Stable-dep-of: 9aaeef113c55 ("i3c: master: svc: fix random hot join failure since timeout error") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 0454f16ac9aae..0263f30bae82e 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) @@ -1028,6 +1029,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