diff options
author | Vidya Sagar <vidyas@nvidia.com> | 2020-11-18 20:16:25 +0530 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2020-11-18 16:16:38 +0000 |
commit | fede8526cc4880d2a1ac4cfe357c299c4e1fd848 (patch) | |
tree | 5cb12a16c514a3f810cfe3c2b4fa0e4fed44e112 | |
parent | 9f9e59a4809563f24e3d1377aa804a4b7386a418 (diff) | |
download | linux-fede8526cc4880d2a1ac4cfe357c299c4e1fd848.tar.bz2 |
PCI: of: Warn if non-prefetchable memory aperture size is > 32-bit
As per PCIe spec r5.0, sec 7.5.1.3.8 only 32-bit BAR registers are defined
for non-prefetchable memory and hence a warning should be reported when
the size of them go beyond 32-bits.
Link: https://lore.kernel.org/r/20201118144626.32189-2-vidyas@nvidia.com
Tested-by: Thierry Reding <treding@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Rob Herring <robh@kernel.org>
-rw-r--r-- | drivers/pci/of.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/pci/of.c b/drivers/pci/of.c index ac24cd5439a9..5ea472ae22ac 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -556,6 +556,11 @@ static int pci_parse_request_of_pci_ranges(struct device *dev, break; case IORESOURCE_MEM: res_valid |= !(res->flags & IORESOURCE_PREFETCH); + + if (!(res->flags & IORESOURCE_PREFETCH)) + if (upper_32_bits(resource_size(res))) + dev_warn(dev, "Memory resource size exceeds max for 32 bits\n"); + break; } } |