public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: host-generic: Avoid reporting incorrect "missing "reg" property" error
@ 2026-01-19  5:06 Jess
  2026-01-19 16:49 ` Will Deacon
  0 siblings, 1 reply; 5+ messages in thread
From: Jess @ 2026-01-19  5:06 UTC (permalink / raw)
  To: will, lpieralisi, kwilczynski, mani, robh, bhelgaas, linux-pci; +Cc: Jess

When the function pci_host_common_ecam_create() calls
of_address_to_resource() it assumes all errors from that callsite are due
to a missing "reg" property in the device tree node.

This can manifest when running the qemu "virt" board, with a 32-bit kernel
and `highmem=on`.

After the following calls:
of_address_to_resource()
  -> __of_address_to_resource()
  -> __of_address_resource_bounds()

this overflow check can fail due to PCI being out of range:
if (overflows_type(start, r->start))
	return -EOVERFLOW;

This leads to the very confusing error message:
pci-host-generic 4010000000.pcie: host bridge /pcie@10000000 ranges:
pci-host-generic 4010000000.pcie:       IO 0x003eff0000..0x003effffff -> 0x0000000000
pci-host-generic 4010000000.pcie:      MEM 0x0010000000..0x003efeffff -> 0x0010000000
pci-host-generic 4010000000.pcie:      MEM 0x8000000000..0xffffffffff -> 0x8000000000
pci-host-generic 4010000000.pcie: missing "reg" property
pci-host-generic 4010000000.pcie: probe with driver pci-host-generic failed with error -75

This commit gets rid of the confusing error message.

Link: https://www.qemu.org/docs/master/system/arm/virt.html
Signed-off-by: Jess <jess@jessie.cafe>
---
 drivers/pci/controller/pci-host-common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c
index c473e7c03bac..04e1fef70c9c 100644
--- a/drivers/pci/controller/pci-host-common.c
+++ b/drivers/pci/controller/pci-host-common.c
@@ -31,10 +31,8 @@ struct pci_config_window *pci_host_common_ecam_create(struct device *dev,
 	struct pci_config_window *cfg;
 
 	err = of_address_to_resource(dev->of_node, 0, &cfgres);
-	if (err) {
-		dev_err(dev, "missing \"reg\" property\n");
+	if (err)
 		return ERR_PTR(err);
-	}
 
 	bus = resource_list_first_type(&bridge->windows, IORESOURCE_BUS);
 	if (!bus)
-- 
2.51.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-06 22:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-19  5:06 [PATCH] PCI: host-generic: Avoid reporting incorrect "missing "reg" property" error Jess
2026-01-19 16:49 ` Will Deacon
2026-01-20  0:44   ` [PATCH v2] " Jess
2026-01-20 11:22     ` Will Deacon
2026-02-06 22:49     ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox