Skip to contentSkip to conversation

drivers/fsl_pci_init: Fix inbound window mapping bug

PATCH New beckyb at kernel.crashing.org 2 participants 2 messages Nov 22, 2008 – Dec 4, 2008 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/fsl_pci_init: Fix inbound window mapping bug

From: Becky Bruce <[email protected]>

The current code will cause the creation of a 4GB window starting at 0 if we have more than 4GB of RAM installed, which overlaps with PCI_MEM space and causes pci_bus_to_phys() to return erroneous information. Limit the size to 4GB - 1; which causes the code to create one 2GB and one 1GB window instead.

---
 drivers/pci/fsl_pci_init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/pci/fsl_pci_init.c +1 -1
index 7625ccc..e57acba 100644
@@ -58,7 +58,7 @@ void pciauto_config_init(struct pci_controller *hose);
 int fsl_pci_setup_inbound_windows(struct pci_region *r)
 {
 	struct pci_region *rgn_base = r;
-	u64 sz = min((u64)gd->ram_size, 1ull << 32);
+	u64 sz = min((u64)gd->ram_size, (1ull << 32) - 1);
 
 	phys_addr_t phys_start = CONFIG_SYS_PCI_MEMORY_PHYS;
 	pci_addr_t bus_start = CONFIG_SYS_PCI_MEMORY_BUS;
Signature · 1 line
1.5.6.5
Applied
#1 lore raw

PATCH 1/1 drivers/fsl_pci_init: Fix inbound window mapping bug

Quoted 11 lines · On Fri, Nov 21, 2008 at 7:24 PM, <[email protected]> wrote:

From: Becky Bruce <[email protected]>

The current code will cause the creation of a 4GB window starting at 0 if we have more than 4GB of RAM installed, which overlaps with PCI_MEM space and causes pci_bus_to_phys() to return erroneous information. Limit the size to 4GB - 1; which causes the code to create one 2GB and one 1GB window instead.

Applied, thanks