mirror-linux/drivers/i3c/master
Billy Tsai d35a6db887 i3c: mipi-i3c-hci: fix IBI payload length calculation for final status
In DMA mode, the IBI status descriptor encodes the payload using
CHUNKS (number of chunks) and DATA_LENGTH (valid bytes in the last
chunk). All preceding chunks are implicitly full-sized.

The current code accumulates full chunk sizes for non-final status
descriptors, but for the final status descriptor it only adds
DATA_LENGTH. This ignores the contribution of the preceding full
chunks described by the same final status entry.

As a result, the computed IBI payload length is truncated whenever
the final status spans multiple chunks. For example, with a chunk
size of 4 bytes, CHUNKS=2 and DATA_LENGTH=1 should result in a total
payload size of 5 bytes, but the current code reports only 1 byte.

Fix the calculation by adding the size of (CHUNKS - 1) full chunks
plus DATA_LENGTH for the last chunk.

Fixes: 9ad9a52cce ("i3c/master: introduce the mipi-i3c-hci driver")
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260407-i3c-hci-dma-v2-1-a583187b9d22@aspeedtech.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2026-04-12 22:06:02 +02:00
..
mipi-i3c-hci i3c: mipi-i3c-hci: fix IBI payload length calculation for final status 2026-04-12 22:06:02 +02:00
Kconfig i3c: mipi-i3c-hci-pci: Convert to MFD driver 2026-01-14 15:53:34 +01:00
Makefile i3c: master: Add driver for Analog Devices I3C Controller IP 2025-09-16 17:06:43 +02:00
adi-i3c-master.c i3c: master: adi: Fix error propagation for CCCs 2026-04-12 16:54:37 +02:00
ast2600-i3c-master.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
dw-i3c-master.c i3c: dw: Simplify xfer cleanup with __free(kfree) 2026-04-12 16:52:32 +02:00
dw-i3c-master.h i3c: dw: Add quirk to address OD/PP timing issue on AMD platform 2024-11-18 14:27:29 +01:00
i3c-master-cdns.c i3c: master: Move entdaa error suppression 2026-04-12 16:54:37 +02:00
renesas-i3c.c i3c: master: renesas: Use __free(kfree) for xfer cleanup in renesas_i3c_send_ccc_cmd() 2026-04-12 16:47:13 +02:00
svc-i3c-master.c i3c: fix missing newline in dev_err messages 2026-04-12 16:32:12 +02:00