Skip to content

RFC ACPI / hotplug / PCI: Major rework + Thunderbolt workarounds

Rafael J. Wysocki linux-acpi linux-pci lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest30 patches 42 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/30ACPI / PCI: Make bus registration and unregistration symmetricdrivers/acpi/pci_slot.c drivers/pci/hotplug/acpiphp_glue.c drivers/pci/pci-acpi.c +1 more+21 -260 replies
1/30ACPI / PCI: Make bus registration and unregistration symmetricdrivers/acpi/pci_slot.c drivers/pci/hotplug/acpiphp_glue.c drivers/pci/pci-acpi.c +1 more+21 -251 reply
2/30ACPI / hotplug / PCI: Consolidate acpiphp_enumerate_slots()drivers/pci/hotplug/acpiphp_glue.c+46 -480 replies
2/30ACPI / hotplug / PCI: Consolidate acpiphp_enumerate_slots()drivers/pci/hotplug/acpiphp_glue.c+45 -472 replies
3/30ACPI / hotplug / PCI: Always return success after adding a functiondrivers/pci/hotplug/acpiphp_glue.c+2 -30 replies
3/30ACPI / hotplug / PCI: Always return success after adding a functiondrivers/pci/hotplug/acpiphp_glue.c+2 -30 replies
4/30ACPI / hotplug / PCI: Hotplug context objects for bridges and functionsdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+146 -440 replies
4/30ACPI / hotplug / PCI: Hotplug context objects for bridges and functionsdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+146 -433 replies
5/30ACPI / hotplug / PCI: Unified notify handler for hotplug eventsdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+54 -800 replies
5/30ACPI / hotplug / PCI: Unified notify handler for hotplug eventsdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+53 -802 replies
6/30ACPI / hotplug / PCI: Rework acpiphp_handle_to_bridge()drivers/pci/hotplug/acpiphp_glue.c+11 -90 replies
6/30ACPI / hotplug / PCI: Rework acpiphp_handle_to_bridge()drivers/pci/hotplug/acpiphp_glue.c+11 -90 replies
7/30ACPI / hotplug / PCI: Pass hotplug context objects to event handlersdrivers/pci/hotplug/acpiphp_glue.c+8 -80 replies
7/30ACPI / hotplug / PCI: Pass hotplug context objects to event handlersdrivers/pci/hotplug/acpiphp_glue.c+8 -80 replies
8/30ACPI / hotplug / PCI: Merge hotplug event handling functionsdrivers/pci/hotplug/acpiphp_glue.c+63 -850 replies
8/30ACPI / hotplug / PCI: Merge hotplug event handling functionsdrivers/pci/hotplug/acpiphp_glue.c+65 -870 replies
9/30ACPI / hotplug / PCI: Drop func field from struct acpiphp_bridgedrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+1 -40 replies
9/30ACPI / hotplug / PCI: Drop func field from struct acpiphp_bridgedrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+1 -40 replies
10/30ACPI / hotplug / PCI: Refactor slot allocation code in register_slot()drivers/pci/hotplug/acpiphp_glue.c+36 -380 replies
10/30ACPI / hotplug / PCI: Refactor slot allocation code in register_slot()drivers/pci/hotplug/acpiphp_glue.c+36 -380 replies
11/30ACPI / hotplug / PCI: Register all devices under the given bridgedrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+75 -1572 replies
11/30ACPI / hotplug / PCI: Register all devices under the given bridgedrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+75 -1560 replies
12/30ACPI / hotplug / PCI: Drop sun field from struct acpiphp_slotdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_core.c drivers/pci/hotplug/acpiphp_glue.c+7 -90 replies
12/30ACPI / hotplug / PCI: Drop sun field from struct acpiphp_slotdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_core.c drivers/pci/hotplug/acpiphp_glue.c +1 more+10 -100 replies
13/30ACPI / hotplug / PCI: Use common slot count variable in register_slot()drivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+4 -50 replies
13/30ACPI / hotplug / PCI: Drop flags field from struct acpiphp_bridgedrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+0 -140 replies
14/30ACPI / hotplug / PCI: Drop flags field from struct acpiphp_bridgedrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+0 -140 replies
14/30ACPI / hotplug / PCI: Embed function struct into struct acpiphp_contextdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+22 -300 replies
15/30ACPI / hotplug / PCI: Embed function struct into struct acpiphp_contextdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+21 -290 replies
15/30ACPI / hotplug / PCI: Drop handle field from struct acpiphp_funcdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+36 -240 replies
16/30ACPI / hotplug / PCI: Drop handle field from struct acpiphp_funcdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+30 -180 replies
16/30ACPI / hotplug / PCI: Drop handle field from struct acpiphp_bridgedrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+2 -40 replies
17/30ACPI / hotplug / PCI: Drop handle field from struct acpiphp_bridgedrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+2 -40 replies
17/30ACPI / hotplug / PCI: Store parent in functions and bus in slotsdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_core.c drivers/pci/hotplug/acpiphp_glue.c+18 -180 replies
18/30ACPI / hotplug / PCI: Store parent in functions and bus in slotsdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_core.c drivers/pci/hotplug/acpiphp_glue.c+18 -180 replies
18/30ACPI / hotplug / PCI: Rework namespace scanning and trimming routinesdrivers/pci/hotplug/acpiphp_glue.c+13 -390 replies
19/30ACPI / hotplug / PCI: Rework namespace scanning and trimming routinesdrivers/pci/hotplug/acpiphp_glue.c+13 -390 replies
19/30ACPI / hotplug / PCI: Drop redundant checks from check_hotplug_bridge()drivers/pci/hotplug/acpiphp_glue.c+0 -60 replies
20/30ACPI / hotplug / PCI: Drop redundant checks from check_hotplug_bridge()drivers/pci/hotplug/acpiphp_glue.c+0 -60 replies
20/30ACPI / hotplug / PCI: Consolidate slot disabling and ejectingdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_core.c drivers/pci/hotplug/acpiphp_glue.c+20 -390 replies
21/30ACPI / hotplug / PCI: Consolidate slot disabling and ejectingdrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_core.c drivers/pci/hotplug/acpiphp_glue.c+33 -500 replies
21/30ACPI / hotplug / PCI: Do not queue up event handling work items in vaindrivers/pci/hotplug/acpiphp_glue.c+29 -350 replies
22/30ACPI / hotplug / PCI: Do not queue up event handling work items in vaindrivers/pci/hotplug/acpiphp_glue.c+29 -350 replies
22/30ACPI / hotplug / PCI: Do not exectute _PS0 and _PS3 directlydrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+10 -1030 replies
23/30ACPI / hotplug / PCI: Do not exectute _PS0 and _PS3 directlydrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_glue.c+10 -1032 replies
23/30ACPI / hotplug / PCI: Do not check SLOT_ENABLED in enable_device()drivers/pci/hotplug/acpiphp_glue.c+5 -50 replies
24/30ACPI / hotplug / PCI: Do not check SLOT_ENABLED in enable_device()drivers/pci/hotplug/acpiphp_glue.c+5 -50 replies
24/30ACPI / hotplug / PCI: Allow slots without new devices to be rescanneddrivers/pci/hotplug/acpiphp_glue.c+2 -90 replies
25/30ACPI / hotplug / PCI: Allow slots without new devices to be rescanneddrivers/pci/hotplug/acpiphp_glue.c+2 -90 replies
25/30ACPI / hotplug / PCI: Check for new devices on enabled slotsdrivers/pci/hotplug/acpiphp_glue.c+60 -2735 replies
26/30ACPI / hotplug / PCI: Check for new devices on enabled slotsdrivers/pci/hotplug/acpiphp_glue.c drivers/pci/remove.c include/linux/pci.h+42 -280 replies
26/30ACPI / hotplug / PCI: Get rid of unused constants in acpiphp.hdrivers/pci/hotplug/acpiphp.h+1 -50 replies
27/30ACPI / hotplug / PCI: Get rid of unused constants in acpiphp.hdrivers/pci/hotplug/acpiphp.h+1 -50 replies
27/30ACPI / hotplug / PCI: Sanitize acpiphp_get_(latch)|(adapter)_status()drivers/pci/hotplug/acpiphp_glue.c+2 -100 replies
28/30ACPI / hotplug / PCI: Sanitize acpiphp_get_(latch)|(adapter)_status()drivers/pci/hotplug/acpiphp_glue.c+2 -100 replies
28/30ACPI / hotplug / PCI: Redefine enable_device() and disable_device()drivers/pci/hotplug/acpiphp_glue.c+12 -210 replies
29/30ACPI / hotplug / PCI: Redefine enable_device() and disable_device()drivers/pci/hotplug/acpiphp_glue.c+12 -210 replies
29/30ACPI / hotplug / PCI: Clean up bridge_mutex usagedrivers/pci/hotplug/acpiphp_glue.c+7 -70 replies
30/30ACPI / hotplug / PCI: Clean up bridge_mutex usagedrivers/pci/hotplug/acpiphp_glue.c+7 -70 replies
30/30ACPI / hotplug / PCI: Get rid of check_sub_bridges()drivers/pci/hotplug/acpiphp_glue.c+0 -250 replies

Reviews trailers per patch

2 of 60 patches have a Reviewed-by or Acked-by.

PatchMika WesterbergYinghai LuAlex Williamson
SeriesT-b Reported-and-tested-by
1/30A-b
1/30A-b
2/30
2/30
3/30
3/30
4/30
4/30
5/30
5/30
6/30
6/30
7/30
7/30
8/30
8/30
9/30
9/30
10/30
10/30
11/30
11/30
12/30
12/30
13/30
13/30
14/30
14/30
15/30
15/30
16/30
16/30
17/30
17/30
18/30
18/30
19/30
19/30
20/30
20/30
21/30
21/30
22/30
22/30
23/30
23/30
24/30
24/30
25/30T-b T-b T-b
25/30T-b T-b T-b
26/30
26/30
27/30
27/30
28/30
28/30
29/30
29/30
30/30
30/30

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

Read the v1 thread

Cover letter [RFC][PATCH 0/30] ACPI / hotplug / PCI: Major rework + Thunderbolt workarounds

Hi,

I've made some progress with my ACPIPHP rework since I posted the series last time and here goes an update.

First off, the previous series was somewhat racy, which should be fixed now. Apart from this there's quite some new material on top of the patches I posted last time (or rather on top of their new versions) and I integrated the Thunderbolt series from Mika with that. As a result,

https://patchwork.kernel.org/patch/2817341/

is required to be applied.

Still untested, still based on 3.10 with ACPI+PM 3.11 material merged on top, but this time I don't have any plans to add more patches to the series for the time being. Also 3.11-rc1 should be out in a couple of days, so I'll be able to integrate this work with the previous cleanups series from Gerry and myself on top of it.

I did my best not to change too much at a time and some steps add stuff that is removed by the subsequent ones, so hopefully it is bisectable.

If anyone finds something questionable or outright bogus in these patches, please let me know before it's too late. ;-)

[ 1/30] Make bus registration and unregistration symmetric. [Resend]
[ 2/30] Consolidate acpiphp_enumerate_slots(). [Resend]
[ 3/30] Fix error code path in register_slot(). [Resend]
[ 4/30] Introduce hotplug context objects for ACPI device objects corresponding
to PCI hotplug devices. [Update]
[ 5/30] Unified notify handler for hotplug events. [Update]
[ 6/30] Drop acpiphp_handle_to_bridge() and use context objects instead of it. [Update] [ 7/30] Pass entire hotplug context objects (instead of their fields
individually) to event handling work functions. [Update]
[ 8/30] Merge hotplug event handling functions. [Update]
[ 9/30] Drop func field from struct acpiphp_bridge.
[10/30] Refactor slot allocation code in register_slot().
[11/30] Make acpiphp_enumerate_slots() to register all devices on the given bus
and install the notification handler for all of them.
[12/30] Drop sun field from struct acpiphp_slot.
[13/30] Use common slot count variable in register_slot().
[14/30] Drop flags field from struct acpiphp_bridge.
[15/30] Embed function structure into struct acpiphp_context.
[16/30] Drop handle field from struct acpiphp_func.
[17/30] Drop handle field from struct acpiphp_bridge.
[18/30] Store parent bridge pointer in function objects and bus pointer in slot
objects.
[19/30] Rework ACPI namespace scanning and trimming routines.
[20/30] Drop redundant checks from check_hotplug_bridge().
[21/30] Consolidate slot disabling and ejecting
[22/30] Do not queue up event handling work items for non-hotplug events. [23/30] Do not execute _PS0 and _PS3 directly.
[24/30] Do not check SLOT_ENABLED in enable_device(). [Thunderbolt series] [25/30] Allow slots without new devices to be rescanned. [Thunderbolt series] [26/30] Check for new devices on enabled slots. [Thunderbolt series, TBD] [27/30] Get rid of unused constands in acpiphp.h. [Thunderbolt series] [28/30] Sanitize acpiphp_get_(latch)|(adapter)_status(). [Thunderbolt series] [29/30] Redefine enable_device() and disable_device() (rename and change to void). [30/30] Clean up the usage of bridge_mutex.

Patch [26/30] seems to go over the top with dropping the non-responsive devices and it probaby needs some more thought. Also the algorithm of bus checks and device checks may need to be improved in the future, but for the time being I think it is good enough.

Comments welcome!

Rafael

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.