i3c: master: svc: fix race condition in ibi work thread
authorFrank Li <Frank.Li@nxp.com>
Mon, 23 Oct 2023 16:16:53 +0000 (12:16 -0400)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 3 Nov 2023 18:48:17 +0000 (19:48 +0100)
commit6bf3fc268183816856c96b8794cd66146bc27b35
tree8e1afc820aa9fcc8e65310d75a20f755a84bbcc0
parent57ec42b9a1b7e4db4a1c2aa4fcc4eefe6d31bcb8
i3c: master: svc: fix race condition in ibi work thread

The ibi work thread operates asynchronously with other transfers, such as
svc_i3c_master_priv_xfers(). Introduce mutex protection to ensure the
completion of the entire i3c/i2c transaction.

Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver")
Cc: <stable@vger.kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20231023161658.3890811-2-Frank.Li@nxp.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master/svc-i3c-master.c