Skip to content

Commit a00e771

Browse files
committed
Merge back ACPI power management material for 6.20
2 parents 7edf6f7 + 057edc5 commit a00e771

4 files changed

Lines changed: 10 additions & 13 deletions

File tree

drivers/acpi/device_pm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,7 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
586586
goto out;
587587

588588
mutex_lock(&acpi_pm_notifier_lock);
589-
adev->wakeup.ws = wakeup_source_register(&adev->dev,
590-
dev_name(&adev->dev));
589+
adev->wakeup.ws = wakeup_source_register(dev, dev_name(&adev->dev));
591590
adev->wakeup.context.dev = dev;
592591
adev->wakeup.context.func = func;
593592
adev->wakeup.flags.notifier_present = true;

drivers/acpi/pci_root.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
738738
if (no_aspm)
739739
pcie_no_aspm();
740740

741-
pci_acpi_add_bus_pm_notifier(device);
741+
pci_acpi_add_root_pm_notifier(device, root);
742742
device_set_wakeup_capable(root->bus->bridge, device->wakeup.flags.valid);
743743

744744
if (hotadd) {

drivers/pci/pci-acpi.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -847,12 +847,7 @@ bool shpchp_is_native(struct pci_dev *bridge)
847847
*/
848848
static void pci_acpi_wake_bus(struct acpi_device_wakeup_context *context)
849849
{
850-
struct acpi_device *adev;
851-
struct acpi_pci_root *root;
852-
853-
adev = container_of(context, struct acpi_device, wakeup.context);
854-
root = acpi_driver_data(adev);
855-
pci_pme_wakeup_bus(root->bus);
850+
pci_pme_wakeup_bus(to_pci_host_bridge(context->dev)->bus);
856851
}
857852

858853
/**
@@ -885,12 +880,14 @@ static void pci_acpi_wake_dev(struct acpi_device_wakeup_context *context)
885880
}
886881

887882
/**
888-
* pci_acpi_add_bus_pm_notifier - Register PM notifier for root PCI bus.
883+
* pci_acpi_add_root_pm_notifier - Register PM notifier for root PCI bus.
889884
* @dev: PCI root bridge ACPI device.
885+
* @root: PCI root corresponding to @dev.
890886
*/
891-
acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev)
887+
acpi_status pci_acpi_add_root_pm_notifier(struct acpi_device *dev,
888+
struct acpi_pci_root *root)
892889
{
893-
return acpi_add_pm_notifier(dev, NULL, pci_acpi_wake_bus);
890+
return acpi_add_pm_notifier(dev, root->bus->bridge, pci_acpi_wake_bus);
894891
}
895892

896893
/**

include/linux/pci-acpi.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
#include <linux/acpi.h>
1313

1414
#ifdef CONFIG_ACPI
15-
extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev);
15+
extern acpi_status pci_acpi_add_root_pm_notifier(struct acpi_device *dev,
16+
struct acpi_pci_root *pci_root);
1617
static inline acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev)
1718
{
1819
return acpi_remove_pm_notifier(dev);

0 commit comments

Comments
 (0)