From: Bjorn Helgaas <helgaas@kernel.org>
To: Jess <jess@jessie.cafe>
Cc: will@kernel.org, bhelgaas@google.com, kwilczynski@kernel.org,
linux-pci@vger.kernel.org, lpieralisi@kernel.org,
mani@kernel.org, robh@kernel.org
Subject: Re: [PATCH v2] PCI: host-generic: Avoid reporting incorrect "missing "reg" property" error
Date: Fri, 6 Feb 2026 16:49:07 -0600 [thread overview]
Message-ID: <20260206224907.GA100198@bhelgaas> (raw)
In-Reply-To: <20260120004444.191093-1-jess@jessie.cafe>
On Tue, Jan 20, 2026 at 01:44:44PM +1300, Jess wrote:
> 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
>
> Make the error message more generic.
>
> Link: https://www.qemu.org/docs/master/system/arm/virt.html
> Signed-off-by: Jess <jess@jessie.cafe>
Applied to pci/controller/generic for v6.20, thanks!
> ---
> drivers/pci/controller/pci-host-common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c
> index c473e7c03bac..d6258c1cffe5 100644
> --- a/drivers/pci/controller/pci-host-common.c
> +++ b/drivers/pci/controller/pci-host-common.c
> @@ -32,7 +32,7 @@ struct pci_config_window *pci_host_common_ecam_create(struct device *dev,
>
> err = of_address_to_resource(dev->of_node, 0, &cfgres);
> if (err) {
> - dev_err(dev, "missing \"reg\" property\n");
> + dev_err(dev, "missing or malformed \"reg\" property\n");
> return ERR_PTR(err);
> }
>
> --
> 2.51.2
>
prev parent reply other threads:[~2026-02-06 22:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260206224907.GA100198@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=jess@jessie.cafe \
--cc=kwilczynski@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=robh@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox