PCI: Run ACPI _OSC method on root bridges only

According to the PCI Firmware Specification Revision 3.0 section 4.5, _OSC
should only be called on a root brdige. Here is the relevant passage: "The
_OSC interface defined in this section applies only to Host Bridge ACPI
devices that originate PCI, PCI-X, or PCI Express hierarchies". Changed the
code to find the parent root bridge of the device and call _OSC on that.

Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by Andrew Patterson and committed by Greg Kroah-Hartman 3c75e237 d8634ddd

+6 -16
+6 -16
drivers/pci/pcie/aer/aerdrv_acpi.c
··· 31 { 32 acpi_status status = AE_NOT_FOUND; 33 struct pci_dev *pdev = pciedev->port; 34 - acpi_handle handle = DEVICE_ACPI_HANDLE(&pdev->dev); 35 - struct pci_bus *parent; 36 37 - while (!handle) { 38 - if (!pdev || !pdev->bus->parent) 39 - break; 40 - parent = pdev->bus->parent; 41 - if (!parent->self) 42 - /* Parent must be a host bridge */ 43 - handle = acpi_get_pci_rootbridge_handle( 44 - pci_domain_nr(parent), 45 - parent->number); 46 - else 47 - handle = DEVICE_ACPI_HANDLE( 48 - &(parent->self->dev)); 49 - pdev = parent->self; 50 - } 51 52 if (handle) { 53 pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT);
··· 31 { 32 acpi_status status = AE_NOT_FOUND; 33 struct pci_dev *pdev = pciedev->port; 34 + acpi_handle handle = 0; 35 36 + /* Find root host bridge */ 37 + while (pdev->bus && pdev->bus->self) 38 + pdev = pdev->bus->self; 39 + handle = acpi_get_pci_rootbridge_handle( 40 + pci_domain_nr(pdev->bus), pdev->bus->number); 41 42 if (handle) { 43 pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT);