[PATCH v4 0/3] i3c: Improve CCC reliability for DesignWare master
| Newsgroups | org.infradead.lists.linux-i3c,dev.linux.lists.imx,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
From: Tze Yee Ng <[email protected]> This series improves I3C Common Command Code (CCC) handling for the DesignWare I3C master used on SoCFPGA platforms, and adds core infrastructure so the I3C subsystem can validate GET CCC responses and retry failed Direct GET transfers. Patch 1/3 adds actual_len to struct i3c_ccc_cmd_payload and has the DesignWare driver report the number of bytes actually received on successful GET CCC transfers, without overwriting the caller's requested buffer size in len. Patch 2/3 maps DesignWare response-queue errors to I3C M0/M2 in ccc->err. M2 is reported only when the broadcast address (7'h7E) is not ACKed. Target-address NACK returns -EIO and is not reported as M2. Patch 3/3 adds optional_bytes and a per-command retries field, validates GET payload length generically in i3c_master_send_ccc_cmd_locked(), and retries failed Direct GET CCCs once by default. GETMRL and GETMXDS describe their variable-length responses at the call site via optional_bytes. Other I3C master drivers are updated to set actual_len on successful GET transfers. Changes in v4: - Add actual_len to keep requested and received lengths separate. - Map M2 only for broadcast-address NACK; not for target-address NACK. - Replace CCC-ID-specific validation with generic actual_len / optional_bytes checks. - Retry Direct GET CCCs on any error (default once), not only M0/M2. - Add optional_bytes and cmd->retries to ccc.h; drop req_len and payload.len save/restore in the core. - Update SVC, Cadence, ADI, Renesas, and MIPI HCI master drivers. Changes in v3: - In dw_i3c_master_end_xfer_locked(), move RESPONSE_ERROR_ADDRESS_NACK to return -EIO. Changes in v2: - Split the monolithic patch into three patches (per review feedback). - Move GET payload validation and CCC retry from the DW driver to drivers/i3c/master.c. - Validate GET CCCs only; drop SET payload-length checks (DW RESPONSE_PORT_DATA_LEN is 0 on SET). - Retry GET CCCs only; do not repeat side-effecting SET CCCs. - Tighten GETMRL validation to exactly 2 or 3 bytes; add GETMXDS 2/5-byte handling. - Expand M0 mapping to CRC/parity/transfer-abort, not only frame errors. - Restore dests[].payload.len before retry and on error return. - Avoid kmalloc on the common single-destination GET path. Adrian Ng Ho Yin (3): i3c: master: dw: Report actual GET CCC payload length on success i3c: master: dw: Map CCC hardware errors to I3C M0/M2 i3c: master: Validate GET CCC payload length and retry Direct GET once drivers/i3c/master.c | 92 ++++++++++++++++++++++---- drivers/i3c/master/adi-i3c-master.c | 2 + drivers/i3c/master/dw-i3c-master.c | 31 +++++++-- drivers/i3c/master/i3c-master-cdns.c | 2 + drivers/i3c/master/mipi-i3c-hci/core.c | 5 +- drivers/i3c/master/renesas-i3c.c | 2 + drivers/i3c/master/svc-i3c-master.c | 4 +- include/linux/i3c/ccc.h | 11 ++- 8 files changed, 127 insertions(+), 22 deletions(-) -- 2.43.7 -- linux-i3c mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-i3c