PCI: Convert dynamic sysfs objects into static
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest20 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/20 | PCI: Convert dynamic "config" sysfs object into staticdrivers/ | +25 | 0 replies | |
| 2/20 | PCI: Convert dynamic "rom" sysfs object into staticdrivers/ include/ | +29 | 0 replies | |
| 3/20 | PCI: Convert dynamic "reset" sysfs object into staticdrivers/ drivers/ | +26 | 0 replies | |
| 4/20 | PCI/VPD: Convert dynamic "vpd" sysfs object into staticdrivers/ drivers/ drivers/ | +18 | 0 replies | |
| 5/20 | PCI: Convert dynamic "index" and "label" sysfs objects into staticdrivers/ drivers/ drivers/ | +80 | 0 replies | |
| 6/20 | sysfs: Introduce BIN_ATTR_ADMIN_RO and BIN_ATTR_ADMIN_RWinclude/ | +23 | 0 replies | |
| 7/20 | PCI: Convert PCI sysfs objects to use BIN_ATTR_ADMIN_RW macrodrivers/ drivers/ | +23 | 0 replies | |
| 8/20 | PCI: Move to kstrtobool() to handle user inputdrivers/ | +45 | 0 replies | |
| 9/20 | PCI: Use sysfs_emit() and sysfs_emit_at() in "show" functionsdrivers/ drivers/ | +56 | 0 replies | |
| 10/20 | PCI: Update style to be more consistentdrivers/ | +251 | 0 replies | |
| 11/20 | PCI: Rearrange attributes from the pci_dev_groupdrivers/ | +369 | 0 replies | |
| 12/20 | PCI: Rearrange attributes from the pci_dev_config_attr_groupdrivers/ | +168 | 0 replies | |
| 13/20 | PCI: Rearrange attributes from the pci_dev_rom_attr_groupdrivers/ | +93 | 0 replies | |
| 14/20 | PCI: Rearrange attributes from the pci_dev_reset_attr_groupdrivers/ | +45 | 0 replies | |
| 15/20 | PCI: Rearrange attributes from the pci_dev_attr_groupdrivers/ | +37 | 0 replies | |
| 16/20 | PCI: Rearrange attributes from the pci_dev_hp_attr_groupdrivers/ | +60 | 0 replies | |
| 17/20 | PCI: Rearrange attributes from the pci_bridge_attr_groupdrivers/ | +54 | 0 replies | |
| 18/20 | PCI: Rearrange attributes from the pcie_dev_attr_groupdrivers/ | +53 | 0 replies | |
| 19/20 | PCI: Rearrange attributes from the pci_bus_groupdrivers/ | +24 | 0 replies | |
| 20/20 | PCI: Rearrange attributes from the pcibus_groupdrivers/ | +25 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/20] PCI: Convert dynamic sysfs objects into static
Hello,
Currently, a lot of PCI-related sysfs objects that are created when either the PCI driver is initialised or when a new device is added are dynamically created under the "/sys/bus/pci/devices/..." path.
All the attributes are added when late_initcall() function executes when the PCI driver, and hence the PCI sub-system, is initialised, and also when the function pci_bus_add_devices() executes when a device is added:
late_initcall()
pci_sysfs_init()
pci_create_sysfs_dev_files()
sysfs_create_bin_file()
pci_bus_add_devices()
pci_bus_add_device()
pci_create_sysfs_dev_files()
...When a device is stopped and removed the pci_remove_sysfs_dev_files() function executes dynamically removing all the attributes that were previously added:
pci_stop_bus_device()
pci_stop_dev()
pci_remove_sysfs_dev_files()
sysfs_remove_bin_file()The current implementation is known to cause problems [1].
As most of the PCI-related attributes does not need to be created and removed dynamically, and thus there is no need to also manage their create and remove life cycle manually.
This series aims to convert the majority of the dynamic sysfs objects into static ones so that the PCI driver core can manage them automatically when the device is either added or removed.
The aim is also to first reduce the reliance on using late_initcall() and eventually remove the need for it completely - this hopefully should move everything closer towards addressing the issue that has been identified in [1].
Aside from converting sysfs objects, this series also offers a series of style clean-up patches offering updates, style changes, etc.
1. https://lore.kernel.org/linux-pci/20200716110423.xtfyb3n6tn5ixedh@pali/
Krzysztof
Krzysztof Wilczyński (20):
PCI: Convert dynamic "config" sysfs object into static
PCI: Convert dynamic "rom" sysfs object into static
PCI: Convert dynamic "reset" sysfs object into static PCI/VPD: Convert dynamic "vpd" sysfs object into static
PCI: Convert dynamic "index" and "label" sysfs objects into static
sysfs: Introduce BIN_ATTR_ADMIN_RO and BIN_ATTR_ADMIN_RW
PCI: Convert PCI sysfs objects to use BIN_ATTR_ADMIN_RW macro
PCI: Move to kstrtobool() to handle user input
PCI: Use sysfs_emit() and sysfs_emit_at() in "show" functions
PCI: Update style to be more consistent
PCI: Rearrange attributes from the pci_dev_group
PCI: Rearrange attributes from the pci_dev_config_attr_group
PCI: Rearrange attributes from the pci_dev_rom_attr_group
PCI: Rearrange attributes from the pci_dev_reset_attr_group
PCI: Rearrange attributes from the pci_dev_attr_group
PCI: Rearrange attributes from the pci_dev_hp_attr_group
PCI: Rearrange attributes from the pci_bridge_attr_group
PCI: Rearrange attributes from the pcie_dev_attr_group
PCI: Rearrange attributes from the pci_bus_group
PCI: Rearrange attributes from the pcibus_group
drivers/pci/pci-label.c | 241 ++---- drivers/pci/pci-sysfs.c | 1655 ++++++++++++++++++++------------------- drivers/pci/pci.h | 16 +- drivers/pci/remove.c | 2 + drivers/pci/vpd.c | 58 +- include/linux/pci.h | 1 - include/linux/sysfs.h | 23 + 7 files changed, 976 insertions(+), 1020 deletions(-)
Signature · 1 line
2.31.0