diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2024-04-03 10:07:03 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-04-04 13:12:32 +0200 |
commit | 938ae2315a401e49bff348981fabd9231988c421 (patch) | |
tree | c61499303728b3eede75dbf2f5ec187306143cb3 /drivers/pci | |
parent | 6c7338d0df402c2460ee7366c1b8c10862d9d919 (diff) | |
download | barebox-938ae2315a401e49bff348981fabd9231988c421.tar.gz barebox-938ae2315a401e49bff348981fabd9231988c421.tar.xz |
pci: ignore BAR when it doesn't fit into bus resource
It can happen that a BAR doesn't fit into the bus resource. In this case
just ignore the BAR instead of failing the device. This is what Linux
does as well.
This helps me on the Protonic MECSBC where a NVME drive offers a 1GiB
BAR which doesn't seem to be needed to make the driver work.
Link: https://lore.barebox.org/20240403080703.4098404-3-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index bc083270d9..e6370b5c7f 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -406,7 +406,7 @@ static void setup_device(struct pci_dev *dev, int max_bar) if (ALIGN(*last_addr, size) + size > busres->end) { pr_debug("BAR does not fit within bus %s res\n", kind); - return; + continue; } *last_addr = ALIGN(*last_addr, size); |