Why do we map PCI IO space so late ?

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Sep 30 18:22:53 EST 2004


Hi John !

I was going through some of the PCI setup code while working on
some bringup stuff, and had an issue which was related to the way
we do the ioremap'ing of the PCI IO space.

So the current scenario is:

 - early (setup_arch() time basically), we ioremap_explicit the ISA
space and that only

 - later (pcibios_fixup time), we scan all busses and ioremap_explicit
their various IO spaces.

I have two problems with that at the moment.

First is, I'm annoyed that during the actual PCI probing, the IO space
is not mapped. That means that any quirk that needs IO accesses to the
device will not work. I wonder also in which conditions we might end up
instanciating a PCI driver as early as the PCI probing and thus crash.
Also, this is all after console_initcalls(), so that leaves a gap of
code that runs with PCI IO space not mapped. So far, it ended up beeing
mostly ok because our console uses legacy serial drivers that use the
ISA space which happen to be mapped early, but that sounds fragile &
bogus to me. (For the short story, I found that while working on a board
for which the "isa" node didn't have a "ranges" property, so we failed
to early map it, thus the serial driver would crash doing IO cycles).
Why can't we do the ioremap_explicit right after setting up the PHBs ?

The second thing that annoys me is that it seems we are also doing an
ioremap_explicit for each p2p bridge IO space, aren't we ? I don't fully
understand the logic here. Aren't those supposed to be fully enclosed by
their parent PHB IO space, and thus mapped by those ?

Thanks for enlightening me,
Ben.






More information about the Linuxppc64-dev mailing list