Re: [PATCH] fix ppc ioremap prototype

Linus Torvalds
2003-09-04T16:41:56Z

On Thu, 4 Sep 2003, Geert Uytterhoeven wrote:
>
> `ioremap is meant for PCI memory space only'

No, I don't agree. The "iomem_resource" is there for all IO-mapped ranges,
and it could easily be a mixture of PCI and other buses. In fact, it
already is on bog-standard hardware: it contains the AGP windows etc.

Whatever is visible in the physical memory window (by _some_ definition of
"physical memory window", and that definition clearly has to be the
biggest possible as seen by software, so it's usually a CPU-centric view
of "any bus that is outside the CPU") should be mappable into the
_virtual_ memory window as seen by the CPU.

So clearly ioremap() has to work for other buses too.

I think that in the 2.7.x timeframe, the right thing to do is definitely:
- move towards using "struct resource" and "ioremap_resource()"
- make resource sizes potentially be larger (ie use "u64" instead of
"unsigned long")

This is actually a potential issue already, with 64-bit PCI on regular
PC's. We don't handle it at all right now (the PCI probing will just not
create the resources), and nobody has complained, but clearly the
RightThing(tm) to do eventually is to make sure this all works cleanly.

I just don't think it's worth worrying about in 2.6.x right now, since it
doesn't matter for anybody.

Linus