|
|
Log in / Subscribe / Register

i3c: Improve CCC reliability for DesignWare master

From:  tze.yee.ng-AT-altera.com
To:  Alexandre Belloni <alexandre.belloni-AT-bootlin.com>, Frank Li <Frank.Li-AT-nxp.com>, Adrian Ng Ho Yin <adrian.ho.yin.ng-AT-altera.com>, Felix Gu <ustc.gu-AT-gmail.com>, Wolfram Sang <wsa+renesas-AT-sang-engineering.com>, Manikanta Guntupalli <manikanta.guntupalli-AT-amd.com>, Jorge Marques <jorge.marques-AT-analog.com>, Sakari Ailus <sakari.ailus-AT-linux.intel.com>, linux-i3c-AT-lists.infradead.org, linux-kernel-AT-vger.kernel.org
Subject:  [PATCH v2 0/3] i3c: Improve CCC reliability for DesignWare master
Date:  Tue, 09 Jun 2026 03:18:04 -0700
Message-ID:  <cover.1780999511.git.tze.yee.ng@altera.com>
Archive-link:  Article

From: Tze Yee Ng <tze.yee.ng@altera.com>

Improve I3C CCC handling on the DesignWare master used on SoCFPGA
platforms: report the actual GET payload length, map hardware errors
to I3C M0/M2, and validate GET responses with a single retry for
transient failures.

Patch 1/3 fixes a DW driver bug: on successful GET CCC, set
dests[0].payload.len from RESPONSE_PORT_DATA_LEN.

Patch 2/3 maps DesignWare response-queue errors to ccc->err (M2 for
IBA/address NACK; M0 for CRC/parity/frame/transfer-abort).

Patch 3/3 moves protocol handling into the I3C core: validate GET
payload length (GETMRL: 2 or 3 bytes; GETMXDS: 2 or 5 bytes), retry
GET CCCs once on M0/M2, restore requested payload.len on retry/error,
and use a stack buffer for the common single-destination GET case.

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 M0/M2 once

 drivers/i3c/master.c               | 111 ++++++++++++++++++++++++++++-
 drivers/i3c/master/dw-i3c-master.c |  39 ++++++++--
 2 files changed, 143 insertions(+), 7 deletions(-)

-- 
2.43.7




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds