pci: fix checking PCI_REGION_MEM in pci_hose_phys_to_bus()
authorCheng Gu <chenggu@marvell.com>
Fri, 23 Oct 2015 21:48:01 +0000 (21:48 +0000)
committerTom Rini <trini@konsulko.com>
Thu, 12 Nov 2015 18:19:03 +0000 (13:19 -0500)
commit3526285068598f4e2ddaf19d4bd94f253de06ce9
tree0ac1b193c31e4e3f1475487cc6c8c353b6fd779d
parent78e9e71c83cf75483a6f756488b245df33783c5b
pci: fix checking PCI_REGION_MEM in pci_hose_phys_to_bus()

When converting between PCI bus and phys addresses, a two pass search
was introduced with preference to non-PCI_REGION_SYS_MEMORY regions.
See commit 2d43e873a29ca4959ba6a30fc7fb396d3fd0dccf.

However, since PCI_REGION_MEM is defined as 0, the if statement was
always asserted true: ((flags & PCI_REGION_MEM) == PCI_REGION_MEM)

This patch uses PCI_REGION_TYPE bit to check if the region is
PCI_REGION_MEM: ((flags & PCI_REGION_TYPE) == PCI_REGION_MEM)

Signed-off-by: Cheng Gu <chenggu@marvell.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/pci/pci_common.c