From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Richter Subject: Re: [PATCH v11 10/10] PCI: Introduce pci_remap_iospace() for remapping PCI I/O bus resources into CPU space Date: Mon, 22 Sep 2014 17:29:48 +0200 Message-ID: <20140922152948.GB20256@rric.localhost> References: <1411003825-21521-1-git-send-email-Liviu.Dudau@arm.com> <1411003825-21521-11-git-send-email-Liviu.Dudau@arm.com> <20140919215400.GA30239@google.com> <201409200420.31433.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-wi0-f179.google.com ([209.85.212.179]:61865 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753084AbaIVP3x (ORCPT ); Mon, 22 Sep 2014 11:29:53 -0400 Content-Disposition: inline In-Reply-To: <201409200420.31433.arnd@arndb.de> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Arnd Bergmann Cc: Bjorn Helgaas , Liviu Dudau , Rob Herring , Jason Gunthorpe , Benjamin Herrenschmidt , Catalin Marinas , Will Deacon , Russell King , linux-pci , Linus Walleij , Tanmay Inamdar , Grant Likely , Sinan Kaya , Jingoo Han , Kukjin Kim , Suravee Suthikulanit , linux-arch , LKML , Device Tree ML , LAKML On 20.09.14 04:20:31, Arnd Bergmann wrote: > On Friday 19 September 2014, Bjorn Helgaas wrote: > > On Thu, Sep 18, 2014 at 02:30:25AM +0100, Liviu Dudau wrote: >=20 > > PCI_IOBASE is a virtual address. So PCI_IOBASE + res->start is als= o a > > virtual address (only for IORESOURCE_IO). > >=20 > > Since res->start is normally a *physical* address, I think it would= be less > > confusing to do something like this: > >=20 > > vaddr =3D PCI_IOBASE + res->start; > > ioremap_page_range(vaddr, vaddr + resource_size(res), ...); > >=20 > > so we have a hint that the first two ioremap_page_range() parameter= s are > > virtual addresses. It's also confusing that it uses "unsigned long= " for > > the virtual addresses, when we usually use "void *". But that's ou= t of > > scope for this patch. >=20 > Good idea. I think it will have to be (unsigned long)PCI_IOBASE above= then, > since ioremap_page_range takes a 'unsigned long' virtual address and = PCI_IOBASE > should really remain an __iomem pointer. Right, I see this warning here: drivers/pci/pci.c: In function =E2=80=98pci_remap_iospace=E2=80=99: drivers/pci/pci.c:2728:8: warning: assignment makes integer from pointe= r without a cast [enabled by default] -Robert