Skip to content

Commit 5dbb4c6

Browse files
Zhichang Yuanbjorn-helgaas
authored andcommitted
of/pci: Fix pci_address_to_pio() conversion of CPU address to I/O port
41f8bba ("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: 41f8bba ("of/pci: Add pci_register_io_range() and pci_pio_to_address()") Signed-off-by: Zhichang Yuan <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Liviu Dudau <[email protected]> CC: [email protected] # v3.18+
1 parent 5ebe6af commit 5dbb4c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/of/address.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ unsigned long __weak pci_address_to_pio(phys_addr_t address)
765765
spin_lock(&io_range_lock);
766766
list_for_each_entry(res, &io_range_list, list) {
767767
if (address >= res->start && address < res->start + res->size) {
768-
addr = res->start - address + offset;
768+
addr = address - res->start + offset;
769769
break;
770770
}
771771
offset += res->size;

0 commit comments

Comments
 (0)