Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1349375
| From | Bjorn Helgaas <bhelgaas@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v1 07/12] ia64/PCI: Use ioremap() instead of open-coded equivalent |
| Date | 2016-03-03 18:00 +0100 |
| Message-ID | <r8ELx-1ze-47@gated-at.bofh.it> (permalink) |
| References | <r8ELv-1ze-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index 40c0263..0227e20 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c @@ -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; /*
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v1 00/12] PCI: Rework shadow ROM handling Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:00 +0100 [PATCH v1 07/12] ia64/PCI: Use ioremap() instead of open-coded equivalent Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:00 +0100 [PATCH v1 08/12] ia64/PCI: Keep CPU physical (not virtual) addresses in shadow ROM resource Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:00 +0100 [PATCH v1 11/12] PCI: Remove unused IORESOURCE_ROM_COPY and IORESOURCE_ROM_BIOS_COPY Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:00 +0100 [PATCH v1 09/12] MIPS: Loongson 3: Use temporary struct resource * to avoid repetition Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:00 +0100 [PATCH v1 02/12] PCI: Don't assign or reassign immutable resources Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:10 +0100 Re: [PATCH v1 00/12] PCI: Rework shadow ROM handling Linus Torvalds <torvalds@linux-foundation.org> - 2016-03-03 19:10 +0100
csiph-web