Thread (15 messages) 15 messages, 5 authors, 2021-05-14

[RFC v2 6/7] PCI: arm64: Allow pci_config_window::parent to be NULL

flat view
STALE1997d SUPERSEDED

From: Boqun Feng <hidden>
Date: 2021-05-03 14:48:07
Also in: linux-arm-kernel, linux-mips, linux-pci, lkml
Subsystem: arm64 port (aarch64 architecture), the rest · Maintainers: Catalin Marinas, Will Deacon, Linus Torvalds

Status: Superseded by v6 (posted 2021-07-26). [go to v6]

Revision v2 (5 revisions archived).

Revisions (5)
  1. v2 current
  2. v3 [diff against previous]
  3. v4 [diff against previous]
  4. v5 [diff against previous]
  5. v6 [diff against previous]
This is purely a hack, for ARM64 Hyper-V guest, there is no
corresponding ACPI device for the root bridge, so the best we can
provide is an all-zeroed pci_config_window, and in this case make
pcibios_root_bridge_prepare() act as the ACPI device is NULL.

Signed-off-by: Boqun Feng <redacted>
---
 arch/arm64/kernel/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
index e9a6eeb6a694..f159df903ccb 100644
--- a/arch/arm64/kernel/pci.c
+++ b/arch/arm64/kernel/pci.c
@@ -83,7 +83,7 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
 {
 	if (!acpi_disabled) {
 		struct pci_config_window *cfg = bridge->bus->sysdata;
-		struct acpi_device *adev = to_acpi_device(cfg->parent);
+		struct acpi_device *adev = cfg->parent ? to_acpi_device(cfg->parent) : NULL;
 		struct device *bus_dev = &bridge->bus->dev;
 
 		ACPI_COMPANION_SET(&bridge->dev, adev);
-- 
2.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help