i3c: master: svc: Use readsb helper for reading MDB
commitc06acf7143upstream. The target can send the MDB byte followed by additional data bytes. The readl on MRDATAB reads one actual byte, but the readsl advances the destination pointer by 4 bytes. This causes the subsequent payload to be copied to wrong position in the destination buffer. Cc: stable@kernel.org Fixes:dd3c52846d("i3c: master: svc: Add Silvaco I3C master driver") Signed-off-by: Stanley Chu <yschu@nuvoton.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20250318053606.3087121-3-yschu@nuvoton.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5d74f8a5fb
commit
c658e1302e
@@ -315,7 +315,7 @@ static int svc_i3c_master_handle_ibi(struct svc_i3c_master *master,
|
||||
slot->len < SVC_I3C_FIFO_SIZE) {
|
||||
mdatactrl = readl(master->regs + SVC_I3C_MDATACTRL);
|
||||
count = SVC_I3C_MDATACTRL_RXCOUNT(mdatactrl);
|
||||
readsl(master->regs + SVC_I3C_MRDATAB, buf, count);
|
||||
readsb(master->regs + SVC_I3C_MRDATAB, buf, count);
|
||||
slot->len += count;
|
||||
buf += count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user