Skip to content

i3c: dw-i3c: Enable support for dw-i3c controller NACK retry sysfs and DAT restore fix

[email protected] linux-i3c lkml 8 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest4 patches 1 replyApplied
  2. v75 patches 4 repliesSuperseded
  3. v65 patches 2 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v55 patches4 repliesSuperseded
v45 patches1 replySuperseded
v33 patches6 repliesSuperseded
v23 patches4 repliesSuperseded
v14 patches4 repliesSuperseded

Changes in v8 from the cover letter

* Squashed patch 1 and 2 into single commit.
* Refactor and update naming to match sysfs documentation.

Patches in v8 Applied

#Subject and filesSizeRepliesApplied
1/4i3c: add sysfs entry and attribute for Device NACK Retry countDocumentation/ABI/testing/sysfs-bus-i3c drivers/i3c/master.c include/linux/i3c/master.h+56 -00 replies
2/4i3c: dw: Add support for Device NACK Retry configurationdrivers/i3c/master/dw-i3c-master.c+40 -00 replies
3/4i3c: dw: use FIELD_PREP for device address table macrosdrivers/i3c/master/dw-i3c-master.c+4 -20 replies
4/4i3c: dw: Preserve DAT entry bits when restoring addressesdrivers/i3c/master/dw-i3c-master.c+9 -40 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchFrank Li
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH v8 0/4] i3c: dw-i3c: Enable support for dw-i3c controller NACK retry sysfs and DAT restore fix

From: Adrian Ng Ho Yin <[email protected]>

This patch series adds a controller-wide sysfs attribute dev_nack_retry_count for the DesignWare I3C controller, allowing runtime control of the automatic retry mechanism when a device NACKs. Some I3C slave devices may temporarily be busy and unable to respond immediately; automatic retries improve robustness in such cases. Writes are clamped to the hardware maximum of 3, and the value is applied to all active DAT entries.

The series also fixes dw_i3c_master_restore_addrs() to preserve existing DAT entry bits, preventing overwrites during runtime PM resume.
---
changelog:
v7->v8
* Squashed patch 1 and 2 into single commit.
* Refactor and update naming to match sysfs documentation.

v7 patch link:
https://lore.kernel.org/all/[email protected]/

v6->v7
* Update dev_nack_retry_show to remove redundant i3cbus variable.
* Refactor dev_nack_retry_store to store dev_nack_retry val only if set_dev_nack_retry does not return error.
* Update set_dev_nack_retry in master and dw-i3c-master to take additional param which is the dev_nack_retry_cnt.

v6 patch link:
https://lore.kernel.org/all/[email protected]/

v5->v6
* Use dev_to_i3cmaster to get i3cmaster insteasd of direct assignment.
* Remove redundant set_dev_nack_retry callback function check.
* Update kernel doc for set_dev_nack_retry.
* Add macro for dev nack retry mask.

v5 patch link:
https://lore.kernel.org/all/[email protected]/

v4->v5
* Revert changes that made bus_maintenance_lock and bus_maintenance_unlock helpers public.
* Move dev_nack_retry sysfs attribute to master.c; create it only if the master implements the dev_nack_retry callback.
* Add dev_nack_retry field to i3c_master_controller; updates are applied under bus maintenance lock.
* Add optional ops to configure dev_nack_retry in the DAT entry in dw-i3c-master.

v4 patch link:
https://lore.kernel.org/all/[email protected]/

v3->v4
* Make bus_maintenance_lock and bus_maintenance_unlock helpers public.
* Replace taking spinlock during DAT update with bus_maintenance_lock.
* Add macro for static and dynamic addr for device addr table.
* Replace GENMASK calls with the appropriate macros when updating addr table.

v3 patch link:
https://lore.kernel.org/all/[email protected]/

v2->v3
* Update commit message for better clarity
* Update function name to maintain consistency.
* Update store function to return error when retry value exceeds hw limit.
* Add lock to protect DAT to avoid concurrent during transfers.
* Clear the address field in the DAT entry before setting new values to ensure correct dynamic/static address configuration

v2 patch link:
https://lore.kernel.org/all/[email protected]/

v1->v2
* Drop dev_nack_retry_cnt binding and device tree changes.
* Update commit message for better clarity.
* Update to use controller wide sysfs attribute that configures dev_nack_retry_cnt during runtime.

v1 patch link:
https://lore.kernel.org/all/[email protected]/
---

Adrian Ng Ho Yin (4):
i3c: add sysfs entry and attribute for Device NACK Retry count
i3c: dw: Add support for Device NACK Retry configuration
i3c: dw: use FIELD_PREP for device address table macros
i3c: dw: Preserve DAT entry bits when restoring addresses

 Documentation/ABI/testing/sysfs-bus-i3c | 11 +++++
 drivers/i3c/master.c                    | 39 ++++++++++++++++
 drivers/i3c/master/dw-i3c-master.c      | 59 ++++++++++++++++++++++---
 include/linux/i3c/master.h              |  6 +++
 4 files changed, 109 insertions(+), 6 deletions(-)
Signature · 1 line
2.49.GIT