diff options
author | Andrew Patterson <andrew.patterson@hp.com> | 2008-01-22 19:18:27 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 18:04:30 -0500 |
commit | 3c75e23784e6ed5f4841de43d0750fd9b37bafcb (patch) | |
tree | 34c54566b3dfe8411464f49bdaec0cbcdd7170e9 /drivers/pci/pcie | |
parent | d8634ddd371515740110d5658c3465a373894243 (diff) |
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>
Diffstat (limited to 'drivers/pci/pcie')
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_acpi.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c index f685bf5cdab..8c199ae84f6 100644 --- a/drivers/pci/pcie/aer/aerdrv_acpi.c +++ b/drivers/pci/pcie/aer/aerdrv_acpi.c | |||
@@ -31,23 +31,13 @@ int aer_osc_setup(struct pcie_device *pciedev) | |||
31 | { | 31 | { |
32 | acpi_status status = AE_NOT_FOUND; | 32 | acpi_status status = AE_NOT_FOUND; |
33 | struct pci_dev *pdev = pciedev->port; | 33 | struct pci_dev *pdev = pciedev->port; |
34 | acpi_handle handle = DEVICE_ACPI_HANDLE(&pdev->dev); | 34 | acpi_handle handle = 0; |
35 | struct pci_bus *parent; | ||
36 | 35 | ||
37 | while (!handle) { | 36 | /* Find root host bridge */ |
38 | if (!pdev || !pdev->bus->parent) | 37 | while (pdev->bus && pdev->bus->self) |
39 | break; | 38 | pdev = pdev->bus->self; |
40 | parent = pdev->bus->parent; | 39 | handle = acpi_get_pci_rootbridge_handle( |
41 | if (!parent->self) | 40 | pci_domain_nr(pdev->bus), pdev->bus->number); |
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 | 41 | ||
52 | if (handle) { | 42 | if (handle) { |
53 | pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT); | 43 | pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT); |