From: tze.yee.ng@altera.com
To: "Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Frank Li" <Frank.Li@nxp.com>,
"Adrian Ng Ho Yin" <adrian.ho.yin.ng@altera.com>,
"Felix Gu" <ustc.gu@gmail.com>,
"Wolfram Sang" <wsa+renesas@sang-engineering.com>,
"Manikanta Guntupalli" <manikanta.guntupalli@amd.com>,
"Jorge Marques" <jorge.marques@analog.com>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org,
"Przemysław Gaj" <pgaj@cadence.com>,
"Tommaso Merciai" <tommaso.merciai.xr@bp.renesas.com>,
"Miquel Raynal" <miquel.raynal@bootlin.com>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"Jarkko Nikula" <jarkko.nikula@linux.intel.com>,
imx@lists.linux.dev
Subject: [PATCH v4 0/3] i3c: Improve CCC reliability for DesignWare master
Date: Tue, 30 Jun 2026 06:20:24 -0700 [thread overview]
Message-ID: <cover.1782824628.git.tze.yee.ng@altera.com> (raw)
From: Tze Yee Ng <tze.yee.ng@altera.com>
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
next reply other threads:[~2026-06-30 13:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 13:20 tze.yee.ng [this message]
2026-06-30 13:20 ` [PATCH v4 1/3] i3c: master: dw: Report actual GET CCC payload length on success tze.yee.ng
2026-06-30 17:03 ` Frank Li
2026-07-01 2:46 ` NG, TZE YEE
2026-07-01 10:37 ` Alexandre Mergnat
2026-06-30 13:20 ` [PATCH v4 2/3] i3c: master: dw: Map CCC hardware errors to I3C M0/M2 tze.yee.ng
2026-07-01 10:37 ` Alexandre Mergnat
2026-06-30 13:20 ` [PATCH v4 3/3] i3c: master: Validate GET CCC payload length and retry Direct GET once tze.yee.ng
2026-06-30 18:48 ` Frank Li
2026-07-01 10:37 ` Alexandre Mergnat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1782824628.git.tze.yee.ng@altera.com \
--to=tze.yee.ng@altera.com \
--cc=Frank.Li@nxp.com \
--cc=adrian.ho.yin.ng@altera.com \
--cc=adrian.hunter@intel.com \
--cc=alexandre.belloni@bootlin.com \
--cc=imx@lists.linux.dev \
--cc=jarkko.nikula@linux.intel.com \
--cc=jorge.marques@analog.com \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manikanta.guntupalli@amd.com \
--cc=miquel.raynal@bootlin.com \
--cc=pgaj@cadence.com \
--cc=sakari.ailus@linux.intel.com \
--cc=tommaso.merciai.xr@bp.renesas.com \
--cc=ustc.gu@gmail.com \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox