Skip to content

driver core: Add device link related sysfs files

Saravana Kannan linux-samsung-soc lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 11 repliesIn review
  2. v24 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Dropped patch 1/4 from v2 since it was already picked up. So numbering has shifted.
Patch 1/3
- Added documentation

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3driver core: Expose device link details in sysfsDocumentation/ABI/testing/sysfs-class-devlink Documentation/ABI/testing/sysfs-devices-consumer Documentation/ABI/testing/sysfs-devices-supplier +2 more+375 -362 replies
2/3driver core: Add state_synced sysfs file for devices that support itDocumentation/ABI/testing/sysfs-devices-state_synced drivers/base/dd.c+46 -00 replies
3/3driver core: Add waiting_for_supplier sysfs file for devicesDocumentation/ABI/testing/sysfs-devices-waiting_for_supplier drivers/base/core.c+43 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/3] driver core: Add device link related sysfs files

With fw_devlink and with sync_state() callback features, there's a lot of device/device link related information that's not available in sysfs.

Exposing these details to user space can be very useful in understanding suspend/resume issues, runtime pm issues, probing issues, figuring out the modules that'd be needed for first stage init, etc. In fact, an earlier verion of this series was very helpful in debugging and validating the recent memory leak fix[1].

This series is based on driver-core-next and [1] cherry-picked on top of it.

[1] - https://lore.kernel.org/lkml/[email protected]/

v1->v2:
Patch 1/4
- New patch
Patch 2/4
- Fixed the warnings I saw before that were related to incorrect sysfs removal code when a device link is deleted.
- Fixed error handling in device_link_add()
- Split up flags into more meaningful files.
- Added status file.
Patch 3/4
- Fixed error handling that Greg pointed out before. Patch 4/4
- New patch

v2->v3:
- Dropped patch 1/4 from v2 since it was already picked up. So numbering has shifted.
Patch 1/3
- Added documentation

Saravana Kannan (3):
driver core: Expose device link details in sysfs
driver core: Add state_synced sysfs file for devices that support it driver core: Add waiting_for_supplier sysfs file for devices

 Documentation/ABI/testing/sysfs-class-devlink | 126 ++++++++++
 .../ABI/testing/sysfs-devices-consumer        |   8 +
 .../ABI/testing/sysfs-devices-state_synced    |  24 ++
 .../ABI/testing/sysfs-devices-supplier        |   8 +
 .../sysfs-devices-waiting_for_supplier        |  17 ++
 drivers/base/core.c                           | 237 +++++++++++++++++-
 drivers/base/dd.c                             |  22 ++
 include/linux/device.h                        |  58 ++---
 8 files changed, 464 insertions(+), 36 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-class-devlink
 create mode 100644 Documentation/ABI/testing/sysfs-devices-consumer
 create mode 100644 Documentation/ABI/testing/sysfs-devices-state_synced
 create mode 100644 Documentation/ABI/testing/sysfs-devices-supplier
 create mode 100644 Documentation/ABI/testing/sysfs-devices-waiting_for_supplier
Signature · 1 line
2.27.0.rc0.183.gde8f92d652-goog