Skip to content

ACPI: Get rid of the list of children in struct acpi_device

Rafael J. Wysocki alsa-devel linux-acpi linux-mmc linux-pm linux-usb lkml platform-driver-x86 2 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am 2653857.mvXUDI8C0e@kreacher

Versions newest first · linked by author and title

  1. v2 Latest16 patches 18 repliesApplied
  2. v116 patches 25 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/16ACPI: glue: Use acpi_dev_for_each_child()drivers/acpi/glue.c+63 -400 replies
2/16ACPI: glue: Introduce acpi_dev_has_children()drivers/acpi/glue.c+11 -10 replies
3/16ACPI: glue: Introduce acpi_find_child_by_adr()drivers/acpi/glue.c include/acpi/acpi_bus.h+26 -40 replies
4/16thunderbolt: ACPI: Replace tb_acpi_find_port() with acpi_find_child_by_adr()drivers/thunderbolt/acpi.c+4 -236 replies
5/16USB: ACPI: Replace usb_acpi_find_port() with acpi_find_child_by_adr()drivers/usb/core/usb-acpi.c+1 -172 replies
6/16ACPI: container: Use acpi_dev_for_each_child()drivers/acpi/container.c+9 -80 replies
7/16ACPI: property: Use acpi_dev_for_each_child() for child lookupdrivers/acpi/property.c+25 -220 replies
8/16ACPI: bus: Export acpi_dev_for_each_child() to modulesdrivers/acpi/bus.c+1 -00 replies
9/16ACPI: video: Use acpi_dev_for_each_child()drivers/acpi/acpi_video.c+16 -250 replies
10/16ACPI: bus: Introduce acpi_dev_for_each_child_reverse()drivers/acpi/bus.c include/acpi/acpi_bus.h+15 -00 replies
11/16ACPI: scan: Walk ACPI device's children using driver coredrivers/acpi/scan.c+29 -300 replies
12/16platform/x86/thinkpad_acpi: Use acpi_dev_for_each_child()drivers/platform/x86/thinkpad_acpi.c+27 -262 replies
13/16mfd: core: Use acpi_dev_for_each_child()drivers/mfd/mfd-core.c+24 -74 replies
14/16soundwire: Use acpi_dev_for_each_child()drivers/soundwire/slave.c+67 -504 replies
15/16ACPI / MMC: PM: Unify fixing up device powerdrivers/acpi/device_pm.c drivers/mmc/host/sdhci-acpi.c drivers/mmc/host/sdhci-pci-core.c +1 more+28 -130 replies
16/16ACPI: bus: Drop unused list heads from struct acpi_devicedrivers/acpi/scan.c include/acpi/acpi_bus.h+1 -120 replies

Reviews trailers per patch

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

PatchPierre-Louis BossartAndy ShevchenkoAdrian HunterUlf HanssonHans de GoedeMika WesterbergHeikki KrogerusVinod Koul
1/16R-b
2/16R-b
3/16R-b
4/16R-b A-b R-b
5/16R-b R-b
6/16R-b
7/16R-b
8/16R-b
9/16R-b
10/16R-b
11/16R-b
12/16R-b R-b
13/16R-b
14/16R-b T-b A-b
15/16R-b A-b A-b
16/16R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 8 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/16] ACPI: Get rid of the list of children in struct acpi_device
Quoted 16 lines · CEST Rafael J. Wysocki

Hi All,

Confusingly enough, the ACPI subsystem stores the information on the given ACPI device's children in two places: as the list of children in struct acpi_device and (as a result of device registration) in the list of children in the embedded struct device.

These two lists agree with each other most of the time, but not always (like in error paths in some cases), and the list of children in struct acpi_device is not generally safe to use without locking. In principle, it should always be walked under acpi_device_lock, but in practice holding acpi_scan_lock is sufficient for that too. However, its users may not know whether or not they operate under acpi_scan_lock and at least in some cases it is not accessed in a safe way (note that ACPI devices may go away as a result of hot-remove, unlike OF nodes).

Quoted 8 lines

For this reason, it is better to consolidate the code that needs to walk the children of an ACPI device which is the purpose of this patch series.

Overall, it switches over all of the users of the list of children in struct acpi_device to using helpers based on the driver core's mechanics and finally drops that list, but some extra cleanups are done on the way.

Please refer to the patch changelogs for details.

Here's a v2 of this series, mostly addressing review comments, but the subjects of the Thunderbolt and USB patches have been changed too.

Thanks!