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@xxxxxxxxx> --- 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