Re: The IO problem on multiple PCI busses

Benjamin Herrenschmidt
2001-03-03T10:36:17Z

>No, don't do this, it is evil. Use mappings, specify the device
>related info somehow when creating the mapping (in the userspace
>variant you do this by openning a specific device to mmap, in the
>kernel variant you can encode the bus/dev/etc. info in the device's
>resource and decode this at ioremap() time, see?).

Well, except that drivers doing IOs don't ioremap...

Maybe we could define an ioremap-like function for IOs, but the more
we discuss this, the more I feel that for in-kernel, a simple function
that returns a per-bus io base (and another one for ISA mem) is plenty
enough for the few legacy things we have to deal with (mostly VGA).

For PCI drivers doing IOs, we just need to have the IO resource
structures to be properly fixed up (include the correct iobase already).

That iobase can either be a mix of a real io address and a "cooking" in
the high bits like parisc, or it can be an address ioremap'd in the
correct bus mapping when it's possible, or whatever...

Ben.