]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ia64/PCI: Use ioremap() instead of open-coded equivalent
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 2 Mar 2016 22:20:18 +0000 (16:20 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Sat, 12 Mar 2016 12:00:29 +0000 (06:00 -0600)
Depositing __IA64_UNCACHED_OFFSET in the upper address bits is essentially
equivalent to ioremap(): it converts a CPU physical address to a virtual
address using the ia64 uncacheable identity map.

Call ioremap() instead of doing the phys-to-virt conversion manually with
__IA64_UNCACHED_OFFSET.

Note that this makes it obvious that (a) we're putting a virtual address in
a struct resource, and (b) we're passing a virtual address to ioremap()
below in the PCI_ROM_RESOURCE case.  These are both pre-existing problems
that I'll resolve next.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/ia64/sn/kernel/io_init.c

index 40c02635f19f1cdcb382154c2a534a95adc384cc..0227e202b6bb136e5cf47241b5d3477f1a34b7fd 100644 (file)
@@ -185,9 +185,8 @@ sn_io_slot_fixup(struct pci_dev *dev)
                if (size == 0)
                        continue;
 
-               addr = pcidev_info->pdi_pio_mapped_addr[idx];
-               addr = ((addr << 4) >> 4) | __IA64_UNCACHED_OFFSET;
-               res->start = addr;
+               res->start = ioremap(pcidev_info->pdi_pio_mapped_addr[idx],
+                                    size + 1);
                res->end = addr + size;
 
                /*