Thread (41 messages) 41 messages, 5 authors, 2014-09-23

Re: [PATCH v11 10/10] PCI: Introduce pci_remap_iospace() for remapping PCI I/O bus resources into CPU space

From: Arnd Bergmann <arnd@arndb.de>
Date: 2014-09-20 02:21:39
Also in: linux-arch, linux-arm-kernel, linux-pci, lkml

On Friday 19 September 2014, Bjorn Helgaas wrote:
On Thu, Sep 18, 2014 at 02:30:25AM +0100, Liviu Dudau wrote:
PCI_IOBASE is a virtual address.  So PCI_IOBASE + res->start is also a
virtual address (only for IORESOURCE_IO).

Since res->start is normally a *physical* address, I think it would be less
confusing to do something like this:

    vaddr = PCI_IOBASE + res->start;
    ioremap_page_range(vaddr, vaddr + resource_size(res), ...);

so we have a hint that the first two ioremap_page_range() parameters are
virtual addresses.  It's also confusing that it uses "unsigned long" for
the virtual addresses, when we usually use "void *".  But that's out of
scope for this patch.
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.

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help