Jean-Philippe Brucker 6bd65974de PCI/ACPI: Don't reset a fwnode set by OF
Commit 375553a93201 ("PCI: Setup ACPI fwnode early and at the same time
with OF") added a call to pci_set_acpi_fwnode() in pci_setup_device(),
which unconditionally clears any fwnode previously set by
pci_set_of_node().

pci_set_acpi_fwnode() looks for ACPI_COMPANION(), which only returns the
existing fwnode if it was set by ACPI_COMPANION_SET(). If it was set by
OF instead, ACPI_COMPANION() returns NULL and pci_set_acpi_fwnode()
accidentally clears the fwnode. To fix this, look for any fwnode instead
of just ACPI companions.

Fixes a virtio-iommu boot regression in v5.15-rc1.

Fixes: 375553a93201 ("PCI: Setup ACPI fwnode early and at the same time with OF")
Link: https://lore.kernel.org/r/20210913172358.1775381-1-jean-philippe@linaro.org
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-09-15 16:26:59 -05:00
..
2021-09-08 16:33:21 -07:00
2021-09-07 19:13:42 -07:00
2021-09-02 14:56:42 -05:00
2021-09-07 19:13:42 -07:00
2020-08-05 18:24:16 -05:00
2021-06-16 17:20:40 -05:00
2021-07-06 10:56:26 -05:00
2020-07-29 14:25:18 -05:00
2020-10-22 12:41:00 -07:00
2021-07-06 10:56:25 -05:00
2021-09-02 13:41:33 -07:00
2021-09-07 19:13:42 -07:00
2021-09-07 19:13:42 -07:00
2021-09-07 19:13:42 -07:00
2021-09-07 19:13:42 -07:00
2021-09-07 19:13:42 -07:00
2021-02-10 16:46:29 -06:00
2020-08-05 18:23:14 -05:00