linux-stable/drivers/pci/pcie
Bjorn Helgaas e0217c5ba1 Revert "PCI: Use to_pci_driver() instead of pci_dev->driver"
This reverts commit 2a4d9408c9.

Robert reported a NULL pointer dereference caused by the PCI core
(local_pci_probe()) calling the i2c_designware_pci driver's
.runtime_resume() method before the .probe() method.  i2c_dw_pci_resume()
depends on initialization done by i2c_dw_pci_probe().

Prior to 2a4d9408c9 ("PCI: Use to_pci_driver() instead of
pci_dev->driver"), pci_pm_runtime_resume() avoided calling the
.runtime_resume() method because pci_dev->driver had not been set yet.

2a4d9408c9 and b5f9c644eb ("PCI: Remove struct pci_dev->driver"),
removed pci_dev->driver, replacing it by device->driver, which *has* been
set by this time, so pci_pm_runtime_resume() called the .runtime_resume()
method when it previously had not.

Fixes: 2a4d9408c9 ("PCI: Use to_pci_driver() instead of pci_dev->driver")
Link: https://lore.kernel.org/linux-i2c/CAP145pgdrdiMAT7=-iB1DMgA7t_bMqTcJL4N0=6u8kNY3EU0dw@mail.gmail.com/
Reported-by: Robert Święcki <robert@swiecki.net>
Tested-by: Robert Święcki <robert@swiecki.net>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2021-11-11 13:36:22 -06:00
..
Kconfig PCI/LINK: Remove bandwidth notification 2021-02-02 14:25:11 -06:00
Makefile PCI/ERR: Reduce compile time for CONFIG_PCIEAER=n 2021-10-16 09:16:59 -05:00
aer.c PCI: Correct misspelled and remove duplicated words 2021-10-08 17:14:04 -05:00
aer_inject.c PCI/AER: Add RCEC AER error injection support 2020-12-05 15:26:02 -06:00
aspm.c PCI: Use kstrtobool() directly, sans strtobool() wrapper 2021-09-28 18:06:29 -05:00
dpc.c PCI: pciehp: Ignore Link Down/Up caused by DPC 2021-06-16 17:16:57 -05:00
edr.c PCI/EDR: Log only ACPI_NOTIFY_DISCONNECT_RECOVER events 2020-04-24 18:33:29 -05:00
err.c Revert "PCI: Use to_pci_driver() instead of pci_dev->driver" 2021-11-11 13:36:22 -06:00
pme.c PCI: Fix kernel-doc errors 2021-03-11 17:37:20 -06:00
portdrv.h PCI/portdrv: Remove unused pcie_port_bus_{,un}register() declarations 2021-10-15 14:25:18 -05:00
portdrv_core.c Merge branch 'pci/portdrv' 2021-11-05 11:28:45 -05:00
portdrv_pci.c PCI/portdrv: Remove unused resume err_handler 2021-10-15 14:25:08 -05:00
ptm.c pci-v5.15-changes 2021-09-07 19:13:42 -07:00
rcec.c PCI/RCEC: Fix RCiEP device to RCEC association 2021-03-10 15:10:46 -06:00