Merge branch 'pci/pm'

- Blacklist Gigabyte X299 Root Port power management to fix Thunderbolt
    hotplug (Mika Westerberg)

  - Revert runtime PM suspend/resume callbacks that broke PME on network
    cable plug (Mika Westerberg)

  - Disable Data Link State Changed interrupts to prevent wakeup
    immediately after suspend (Mika Westerberg)

* pci/pm:
  PCI/PME: Fix possible use-after-free on remove
  PCI/PME: Fix hotplug/sysfs remove deadlock in pcie_pme_remove()
  PCI: pciehp: Disable Data Link Layer State Changed event on suspend
  Revert "PCI/PME: Implement runtime PM callbacks"
  PCI: Blacklist power management of Gigabyte X299 DESIGNARE EX PCIe ports
This commit is contained in:
Bjorn Helgaas
2019-03-06 15:30:15 -06:00
کامیت 7733f69288
3فایلهای تغییر یافته به همراه53 افزوده شده و 36 حذف شده

مشاهده پرونده

@@ -363,6 +363,16 @@ static bool pcie_pme_check_wakeup(struct pci_bus *bus)
return false;
}
static void pcie_pme_disable_interrupt(struct pci_dev *port,
struct pcie_pme_service_data *data)
{
spin_lock_irq(&data->lock);
pcie_pme_interrupt_enable(port, false);
pcie_clear_root_pme_status(port);
data->noirq = true;
spin_unlock_irq(&data->lock);
}
/**
* pcie_pme_suspend - Suspend PCIe PME service device.
* @srv: PCIe service device to suspend.
@@ -387,11 +397,7 @@ static int pcie_pme_suspend(struct pcie_device *srv)
return 0;
}
spin_lock_irq(&data->lock);
pcie_pme_interrupt_enable(port, false);
pcie_clear_root_pme_status(port);
data->noirq = true;
spin_unlock_irq(&data->lock);
pcie_pme_disable_interrupt(port, data);
synchronize_irq(srv->irq);
@@ -427,34 +433,12 @@ static int pcie_pme_resume(struct pcie_device *srv)
*/
static void pcie_pme_remove(struct pcie_device *srv)
{
pcie_pme_suspend(srv);
struct pcie_pme_service_data *data = get_service_data(srv);
pcie_pme_disable_interrupt(srv->port, data);
free_irq(srv->irq, srv);
kfree(get_service_data(srv));
}
static int pcie_pme_runtime_suspend(struct pcie_device *srv)
{
struct pcie_pme_service_data *data = get_service_data(srv);
spin_lock_irq(&data->lock);
pcie_pme_interrupt_enable(srv->port, false);
pcie_clear_root_pme_status(srv->port);
data->noirq = true;
spin_unlock_irq(&data->lock);
return 0;
}
static int pcie_pme_runtime_resume(struct pcie_device *srv)
{
struct pcie_pme_service_data *data = get_service_data(srv);
spin_lock_irq(&data->lock);
pcie_pme_interrupt_enable(srv->port, true);
data->noirq = false;
spin_unlock_irq(&data->lock);
return 0;
cancel_work_sync(&data->work);
kfree(data);
}
static struct pcie_port_service_driver pcie_pme_driver = {
@@ -464,8 +448,6 @@ static struct pcie_port_service_driver pcie_pme_driver = {
.probe = pcie_pme_probe,
.suspend = pcie_pme_suspend,
.runtime_suspend = pcie_pme_runtime_suspend,
.runtime_resume = pcie_pme_runtime_resume,
.resume = pcie_pme_resume,
.remove = pcie_pme_remove,
};