u-boot/drivers/pci
Marcel Ziswiler b4bd655493 pci: fix address range check in __pci_hose_phys_to_bus()
The address range check may overflow if the memory region is located at
the top of the 32-bit address space. This can e.g. be seen on TK1 if
using the E1000 gigabit Ethernet driver where start and size are both
0x80000000 leading to the following messages:

Apalis TK1 # tftpboot $loadaddr test_file
Using e1000#0 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename 'test_file'.
Load address: 0x80408000
Loading: pci_hose_phys_to_bus: invalid physical address

This patch fixes this by changing the order of the addition vs.
subtraction in the range check just like already done in
__pci_hose_bus_to_phys().

Reported-by: Ivan Mercier <ivan.mercier@nexvision.fr>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-11-23 11:01:52 -05:00
..
fsl_pci_init.c fsl/pci: Set CFG_READY for PCIe v3.0 and later 2015-05-04 09:24:23 -07:00
Kconfig dm: sandbox: Add a simple PCI driver 2015-04-16 19:27:43 -06:00
Makefile pci: mvebu: Add PCIe driver 2015-08-17 18:49:43 +02:00
pci-emul-uclass.c dm: sandbox: pci: Add a PCI emulation uclass 2015-04-16 19:27:43 -06:00
pci-uclass.c dm: pci: Enable VGA address forwarding on bridges 2015-10-21 07:46:25 -06:00
pci.c pci: Add a constant for an invalid interrupt 2015-08-05 08:42:41 -06:00
pci_auto.c pci: Set PCI_COMMAND_IO bit for VGA device 2015-10-21 07:46:25 -06:00
pci_common.c pci: fix address range check in __pci_hose_phys_to_bus() 2015-11-23 11:01:52 -05:00
pci_compat.c pci: Remove DEBUG from pci_compat.c 2015-08-05 10:49:32 -06:00
pci_ftpci100.c Merge branch 'master' of git://git.denx.de/u-boot-nds32 2013-07-25 08:51:51 -04:00
pci_gt64120.c qemu-malta: Update for SPDX license identifiers 2013-07-25 08:51:48 -04:00
pci_indirect.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pci_msc01.c malta: support for coreFPGA6 boards 2013-11-09 17:21:01 +01:00
pci_mvebu.c pci: mvebu: Add PCIe driver 2015-08-17 18:49:43 +02:00
pci_rom.c x86: Set up video framebuffer for coreboot before loading kernel 2015-08-26 07:54:09 -07:00
pci_sandbox.c dm: sandbox: Add a simple PCI driver 2015-04-16 19:27:43 -06:00
pci_sh4.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pci_sh7751.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pci_sh7780.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
pci_tegra.c pci: tegra: add/enable support for Tegra210 2015-11-12 09:21:05 -07:00
pci_x86.c x86: pci: Tidy up the generic x86 PCI driver 2015-07-14 18:03:19 -06:00
pcie_imx.c pci: pcie_imx: Fix hang on mx6qp 2015-10-15 09:05:13 -04:00
pcie_layerscape.c armv8/fsl_lsch3: Change arch to fsl-layerscape 2015-10-29 10:34:00 -07:00
tsi108_pci.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
w83c553f.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00