Rework pciehp event handling & add runtime PM
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest32 patches 33 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/32 | PCI: hotplug: Don't leak pci_slot on registration failuredrivers/ | +9 | 0 replies | |
| 2/32 | PCI: pciehp: Fix UAF on unplugdrivers/ drivers/ drivers/ | +9 | 0 replies | |
| 3/32 | PCI: pciehp: Fix deadlock on unplugdrivers/ | +26 | 3 replies | |
| 4/32 | PCI: pciehp: Fix unprotected list iteration in IRQ handlerdrivers/ | +3 | 0 replies | |
| 5/32 | PCI: pciehp: Drop unnecessary NULL pointer checkdrivers/ | +0 | 0 replies | |
| 6/32 | PCI: pciehp: Declare pciehp_unconfigure_device() voiddrivers/ drivers/ drivers/ | +7 | 0 replies | |
| 7/32 | PCI: pciehp: Document struct slot and struct controllerdrivers/ | +44 | 0 replies | |
| 8/32 | genirq: Synchronize only with single thread on free_irq()kernel/ | +14 | 5 replies | |
| 9/32 | PCI: pciehp: Convert to threaded IRQdrivers/ drivers/ | +41 | 2 replies | |
| 10/32 | PCI: pciehp: Convert to threaded pollingdrivers/ drivers/ | +34 | 0 replies | |
| 11/32 | PCI: pciehp: Stop blinking on slot enable failuredrivers/ drivers/ | +42 | 0 replies | |
| 12/32 | PCI: pciehp: Handle events synchronouslydrivers/ drivers/ drivers/ | +67 | 0 replies | |
| 13/32 | PCI: pciehp: Drop slot workqueuedrivers/ drivers/ drivers/ +1 more | +2 | 0 replies | |
| 14/32 | PCI: hotplug: Demidlayer registration with the coredrivers/ drivers/ drivers/ +14 more | +171 | 3 replies | |
| 15/32 | PCI: pciehp: Publish to user space last on probedrivers/ | +15 | 0 replies | |
| 16/32 | PCI: pciehp: Track enable/disable statusdrivers/ drivers/ drivers/ | +35 | 0 replies | |
| 17/32 | PCI: pciehp: Enable/disable exclusively from IRQ threaddrivers/ drivers/ drivers/ +1 more | +93 | 1 reply | |
| 18/32 | PCI: pciehp: Drop enable/disable lockdrivers/ drivers/ drivers/ | +0 | 0 replies | |
| 19/32 | PCI: pciehp: Declare pciehp_enable/disable_slot() staticdrivers/ drivers/ | +5 | 0 replies | |
| 20/32 | PCI: pciehp: Tolerate initially unstable linkdrivers/ | +5 | 0 replies | |
| 21/32 | PCI: pciehp: Become resilient to missed eventsdrivers/ drivers/ drivers/ | +40 | 0 replies | |
| 22/32 | PCI: pciehp: Always enable occupied slot on probedrivers/ drivers/ | +6 | 0 replies | |
| 23/32 | PCI: pciehp: Avoid slot access during resetdrivers/ drivers/ drivers/ | +14 | 3 replies | |
| 24/32 | PCI: portdrv: Deduplicate PM callback iteratordrivers/ | +12 | 0 replies | |
| 25/32 | PCI: pciehp: Clear spurious events earlier on resumedrivers/ drivers/ drivers/ +3 more | +30 | 0 replies | |
| 26/32 | PCI: pciehp: Obey compulsory command delay after resumedrivers/ | +4 | 0 replies | |
| 27/32 | PCI: pciehp: Support interrupts sent from D3hotdrivers/ drivers/ | +48 | 1 reply | |
| 28/32 | PCI: pciehp: Resume to D0 on enable/disabledrivers/ | +6 | 0 replies | |
| 29/32 | PCI: pciehp: Resume parent to D0 on config space accessdrivers/ drivers/ | +21 | 0 replies | |
| 30/32 | PCI: sysfs: Resume to D0 on function resetdrivers/ | +2 | 0 replies | |
| 31/32 | PCI: Whitelist native hotplug ports for runtime D3drivers/ | +10 | 0 replies | |
| 32/32 | PCI: Whitelist Thunderbolt ports for runtime D3drivers/ | +5 | 5 replies |
Reviews trailers per patch
2 of 32 patches have a Reviewed-by or Acked-by.
| Patch | Mika Westerberg | Andy Shevchenko |
|---|---|---|
| 1/32 | ||
| 2/32 | ||
| 3/32 | ||
| 4/32 | ||
| 5/32 | ||
| 6/32 | ||
| 7/32 | ||
| 8/32 | ||
| 9/32 | ||
| 10/32 | ||
| 11/32 | ||
| 12/32 | ||
| 13/32 | ||
| 14/32 | A-b A-b | |
| 15/32 | ||
| 16/32 | ||
| 17/32 | ||
| 18/32 | ||
| 19/32 | ||
| 20/32 | ||
| 21/32 | ||
| 22/32 | ||
| 23/32 | ||
| 24/32 | ||
| 25/32 | ||
| 26/32 | ||
| 27/32 | ||
| 28/32 | ||
| 29/32 | ||
| 30/32 | ||
| 31/32 | ||
| 32/32 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/32] Rework pciehp event handling & add runtime PM
Rework pciehp to use modern, threaded IRQ handling. The slot is powered on and off synchronously in the IRQ thread, no indirection via a work queue anymore.
When the slot is enabled/disabled by the user via sysfs or an Attention Button press, a request is sent to the IRQ thread. The IRQ thread is thus the sole entity enabling/disabling the slot.
The IRQ thread can cope with missed events, e.g. if a card is inserted and immediately pulled out before the IRQ thread had a chance to react. It also tolerates an initially unstable link as observed in the wild by Stefan Roese.
Finally, runtime PM support is added. This was the original motivation of the series because runtime suspending hotplug ports is needed to power down Thunderbolt controllers on idle, which saves ~1.5W per controller. Runtime resuming ports takes tenths of milliseconds during which events may be missed, this in turn necessitated the event handling rework.
I've pushed the series to GitHub to ease reviewing/fetching:
https://github.com/l1k/linux/commits/pciehp_runpm_v2
Please review and test.
Thanks,
Lukas
Lukas Wunner (32):
PCI: hotplug: Don't leak pci_slot on registration failure
PCI: pciehp: Fix UAF on unplug
PCI: pciehp: Fix deadlock on unplug
PCI: pciehp: Fix unprotected list iteration in IRQ handler
PCI: pciehp: Drop unnecessary NULL pointer check
PCI: pciehp: Declare pciehp_unconfigure_device() void
PCI: pciehp: Document struct slot and struct controller
genirq: Synchronize only with single thread on free_irq()
PCI: pciehp: Convert to threaded IRQ
PCI: pciehp: Convert to threaded polling
PCI: pciehp: Stop blinking on slot enable failure
PCI: pciehp: Handle events synchronously
PCI: pciehp: Drop slot workqueue
PCI: hotplug: Demidlayer registration with the core
PCI: pciehp: Publish to user space last on probe
PCI: pciehp: Track enable/disable status
PCI: pciehp: Enable/disable exclusively from IRQ thread
PCI: pciehp: Drop enable/disable lock
PCI: pciehp: Declare pciehp_enable/disable_slot() static
PCI: pciehp: Tolerate initially unstable link
PCI: pciehp: Become resilient to missed events
PCI: pciehp: Always enable occupied slot on probe
PCI: pciehp: Avoid slot access during reset
PCI: portdrv: Deduplicate PM callback iterator
PCI: pciehp: Clear spurious events earlier on resume
PCI: pciehp: Obey compulsory command delay after resume
PCI: pciehp: Support interrupts sent from D3hot
PCI: pciehp: Resume to D0 on enable/disable
PCI: pciehp: Resume parent to D0 on config space access
PCI: sysfs: Resume to D0 on function reset
PCI: Whitelist native hotplug ports for runtime D3
PCI: Whitelist Thunderbolt ports for runtime D3
drivers/pci/hotplug/acpiphp_core.c | 22 +- drivers/pci/hotplug/cpci_hotplug_core.c | 14 +- drivers/pci/hotplug/cpqphp_core.c | 16 +- drivers/pci/hotplug/ibmphp_core.c | 15 +- drivers/pci/hotplug/ibmphp_ebda.c | 20 -- drivers/pci/hotplug/pci_hotplug_core.c | 134 +++++++-- drivers/pci/hotplug/pciehp.h | 117 ++++++-- drivers/pci/hotplug/pciehp_core.c | 104 ++++--- drivers/pci/hotplug/pciehp_ctrl.c | 352 ++++++++++-------------- drivers/pci/hotplug/pciehp_hpc.c | 261 ++++++++++-------- drivers/pci/hotplug/pciehp_pci.c | 42 ++- drivers/pci/hotplug/pcihp_skeleton.c | 16 +- drivers/pci/hotplug/pnv_php.c | 5 +- drivers/pci/hotplug/rpaphp_core.c | 2 +- drivers/pci/hotplug/rpaphp_slot.c | 13 +- drivers/pci/hotplug/s390_pci_hpc.c | 13 +- drivers/pci/hotplug/sgi_hotplug.c | 9 +- drivers/pci/hotplug/shpchp_core.c | 20 +- drivers/pci/pci-sysfs.c | 2 + drivers/pci/pci.c | 21 +- drivers/pci/pcie/portdrv.h | 2 + drivers/pci/pcie/portdrv_core.c | 30 +- drivers/pci/pcie/portdrv_pci.c | 2 + drivers/platform/x86/asus-wmi.c | 12 +- drivers/platform/x86/eeepc-laptop.c | 12 +- include/linux/pci_hotplug.h | 15 +- kernel/irq/manage.c | 21 +- 27 files changed, 687 insertions(+), 605 deletions(-)
Signature · 1 line
2.17.1