mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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>
This commit is contained in:
parent
d8634ddd37
commit
3c75e23784
@ -31,23 +31,13 @@ int aer_osc_setup(struct pcie_device *pciedev)
|
|||||||
{
|
{
|
||||||
acpi_status status = AE_NOT_FOUND;
|
acpi_status status = AE_NOT_FOUND;
|
||||||
struct pci_dev *pdev = pciedev->port;
|
struct pci_dev *pdev = pciedev->port;
|
||||||
acpi_handle handle = DEVICE_ACPI_HANDLE(&pdev->dev);
|
acpi_handle handle = 0;
|
||||||
struct pci_bus *parent;
|
|
||||||
|
|
||||||
while (!handle) {
|
/* Find root host bridge */
|
||||||
if (!pdev || !pdev->bus->parent)
|
while (pdev->bus && pdev->bus->self)
|
||||||
break;
|
pdev = pdev->bus->self;
|
||||||
parent = pdev->bus->parent;
|
handle = acpi_get_pci_rootbridge_handle(
|
||||||
if (!parent->self)
|
pci_domain_nr(pdev->bus), pdev->bus->number);
|
||||||
/* Parent must be a host bridge */
|
|
||||||
handle = acpi_get_pci_rootbridge_handle(
|
|
||||||
pci_domain_nr(parent),
|
|
||||||
parent->number);
|
|
||||||
else
|
|
||||||
handle = DEVICE_ACPI_HANDLE(
|
|
||||||
&(parent->self->dev));
|
|
||||||
pdev = parent->self;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (handle) {
|
if (handle) {
|
||||||
pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT);
|
pcie_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user