summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2019-06-05 07:26:44 -0700
committerTom Rini <trini@konsulko.com>2019-06-21 10:07:11 -0400
commit5fafd7e35f03a28748456fe2277f073846946b2f (patch)
tree03d3b9aabe6b60a7337a4270d9c450b004232614 /drivers
parentd5e994fc55eeac0938c5a0204d64e0b97397567e (diff)
pci: Avoid assigning PCI resources that are below 0x1000
commit b7598a43f2b4 ("[PATCH] Avoid assigning PCI resources from zero address") only moved the bus lower address to 0x1000 if the given bus start address is zero. The comment said 0x1000 is a reasonable starting value, hence we'd better apply the same adjustment when the given bus start address is below 0x1000. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/pci_auto_common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pci/pci_auto_common.c b/drivers/pci/pci_auto_common.c
index 183787333e..84908e6154 100644
--- a/drivers/pci/pci_auto_common.c
+++ b/drivers/pci/pci_auto_common.c
@@ -21,9 +21,10 @@ void pciauto_region_init(struct pci_region *res)
/*
* Avoid allocating PCI resources from address 0 -- this is illegal
* according to PCI 2.1 and moreover, this is known to cause Linux IDE
- * drivers to fail. Use a reasonable starting value of 0x1000 instead.
+ * drivers to fail. Use a reasonable starting value of 0x1000 instead
+ * if the bus start address is below 0x1000.
*/
- res->bus_lower = res->bus_start ? res->bus_start : 0x1000;
+ res->bus_lower = res->bus_start < 0x1000 ? 0x1000 : res->bus_start;
}
void pciauto_region_align(struct pci_region *res, pci_size_t size)