lkml.org 
[lkml]   [2000]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Updated Linux 2.4 issues page
On Sun, Aug 20, 2000 at 10:07:05PM -0400, Jeff Garzik wrote:
> Russell King wrote:
> > Can the address taken by ioremap() be clarified please? Is it supposed to
> > be a PCI address, or a so-called "physical" address (corresponding to the
> > address on the bus between the CPU and the host bridge, which may have
> > other devices hung on it)?
>
> I've always heard and assumed ioremap takes a bus address...

Yes, but on which bus ? A PCI bus address isn't always sufficient, think about
the following setup:

CPU ----- PCI0
|
--- PCI1

where PCI0 translates accesses to memory bus address 0x2 0000 0000 - 0x2 ffff ffff
to PCI bus addresses 0x0000 0000 - 0xffff ffff, and PCI1 translates accesses to
0x3 0000 0000 - 0x3 ffff ffff to PCI bus addresses 0x0000 0000 - 0xffff ffff.

You can't handle everything with PCI bus addresses. I think you'd agree code like
this (though it is rather common) is buggy:

u32 address;
void *mmio;

pci_read_config_dword(pcidev, PCI_BASE_ADDRESS_0, &address);
mmio = ioremap(address, 0x10000);

and there's no real difference between this code and assuming ioremap takes a
PCI bus address.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:37    [W:0.035 / U:3.636 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site