diff options
author | Zhichang Yuan <yuanzhichang@hisilicon.com> | 2015-04-24 17:05:09 +0800 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-07-03 23:02:17 -0400 |
commit | ec4dc9ec65b03eb561c84ad75125eef4ac25fbeb (patch) | |
tree | 010558169df9a14f5b9f72fdf70f0bc50f5d1122 /drivers/of | |
parent | 217c008c04bd34b2306b7c4fb2f5c0593b50bd71 (diff) | |
download | lwn-ec4dc9ec65b03eb561c84ad75125eef4ac25fbeb.tar.gz lwn-ec4dc9ec65b03eb561c84ad75125eef4ac25fbeb.zip |
of/pci: Fix pci_address_to_pio() conversion of CPU address to I/O port
[ Upstream commit 5dbb4c6167229c8d4f528e8ec26699a7305000a3 ]
41f8bba7f555 ("of/pci: Add pci_register_io_range() and
pci_pio_to_address()") added support for systems with several I/O ranges
described by OF bindings. It modified pci_address_to_pio() look up the
io_range for a given CPU physical address, but the conversion was wrong.
Fix the conversion of address to I/O port.
[bhelgaas: changelog]
Fixes: 41f8bba7f555 ("of/pci: Add pci_register_io_range() and pci_pio_to_address()")
Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Liviu Dudau <Liviu.Dudau@arm.com>
CC: stable@vger.kernel.org # v3.18+
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/address.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c index 216b00d99bd8..d880affa0493 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -765,7 +765,7 @@ unsigned long __weak pci_address_to_pio(phys_addr_t address) spin_lock(&io_range_lock); list_for_each_entry(res, &io_range_list, list) { if (address >= res->start && address < res->start + res->size) { - addr = res->start - address + offset; + addr = address - res->start + offset; break; } offset += res->size; |