Linux PCI subsystem development
 help / color / mirror / Atom feed
* Subject: [PATCH 1/1] PCI: of: avoid warning for 4 GiB non-prefetchable
@ 2024-11-14 14:05 Wannes Bouwen (Nokia)
  2025-02-28 18:27 ` Bjorn Helgaas
  0 siblings, 1 reply; 8+ messages in thread
From: Wannes Bouwen (Nokia) @ 2024-11-14 14:05 UTC (permalink / raw)
  To: bhelgaas@google.com; +Cc: linux-pci@vger.kernel.org

Subject: [PATCH 1/1] PCI: of: avoid warning for 4 GiB non-prefetchable
windows.

According to the PCIe spec, non-prefetchable memory supports only 32-bit
BAR registers and are hence limited to 4 GiB. In the kernel there is a
check that prints a warning if a non-prefetchable resource exceeds the
32-bit limit.

This check however prints a warning when a 4 GiB window on the host
bridge is used. This is perfectly possible according to the PCIe spec,
so in my opinion the warning is a bit too strict. This changeset
subtracts 1 from the resource_size to avoid printing a warning in the
case of a 4 GiB non-prefetchable window.

Signed-off-by: Wannes Bouwen <wannes.bouwen@nokia.com>
---
 drivers/pci/of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index dacea3fc5128..ccbb1f1c2212 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -622,7 +622,7 @@ static int pci_parse_request_of_pci_ranges(struct device *dev,
            res_valid |= !(res->flags & IORESOURCE_PREFETCH);

            if (!(res->flags & IORESOURCE_PREFETCH))
-               if (upper_32_bits(resource_size(res)))
+               if (upper_32_bits(resource_size(res) - 1))
                    dev_warn(dev, "Memory resource size exceeds max for 32 bits\n");

            break;
--
2.39.3

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

end of thread, other threads:[~2025-03-04 21:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14 14:05 Subject: [PATCH 1/1] PCI: of: avoid warning for 4 GiB non-prefetchable Wannes Bouwen (Nokia)
2025-02-28 18:27 ` Bjorn Helgaas
2025-02-28 23:01   ` Rob Herring
2025-02-28 23:17     ` Bjorn Helgaas
2025-03-03 10:35       ` Wannes Bouwen (Nokia)
2025-03-03 15:53         ` Bjorn Helgaas
2025-03-04  9:15           ` Wannes Bouwen (Nokia)
2025-03-04 21:30             ` Bjorn Helgaas

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