Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932914AbcCCQy7 (ORCPT ); Thu, 3 Mar 2016 11:54:59 -0500 Received: from mail.kernel.org ([198.145.29.136]:48579 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932876AbcCCQyy (ORCPT ); Thu, 3 Mar 2016 11:54:54 -0500 Subject: [PATCH v1 07/12] ia64/PCI: Use ioremap() instead of open-coded equivalent To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Matthew Garrett , Tony Luck , DRI , Fenghua Yu , Intel Graphics Development , linux-kernel@vger.kernel.org, Ralf Baechle , Andy Lutomirski , Bruno =?utf-8?q?Pr=C3=A9mont?= , Daniel Stone , Alex Deucher , Linus Torvalds , Ville =?utf-8?b?U3lyasOkbMOk?= Date: Thu, 03 Mar 2016 10:54:45 -0600 Message-ID: <20160303165445.3025.12861.stgit@bhelgaas-glaptop2.roam.corp.google.com> In-Reply-To: <20160303164533.3025.82439.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20160303164533.3025.82439.stgit@bhelgaas-glaptop2.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1207 Lines: 33 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 --- 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; /*