Re: request_region for MMIO?

Gabriel Paubert (paubert@iram.es)
Mon, 1 Feb 1999 16:18:53 +0100 (MET)


On 1 Feb 1999, Jes Sorensen wrote:

> >>>>> "Gabriel" == Gabriel Paubert <paubert@iram.es> writes:
>
> Gabriel> On Mon, 1 Feb 1999, Geert Uytterhoeven wrote:
>
> >> Is it OK to use request_region() for claiming memory mapped I/O
> >> registers?
>
> Gabriel> No. MMIO has nothing to see with I/O ports. They are
> Gabriel> different spaces (different encodings of cycle type on the
> Gabriel> PCI bus for example), so they can't even conflict.
>
> Gabriel> Perhaps a /proc/mmioareas (choose the name you want, I can't
> Gabriel> find anything nice right now) should be added. OTOH, PCI
> Gabriel> should guarantee by design that no conflict can occur, if you
> Gabriel> forget the fact most PCI BIOSes are buggy and some device do
> Gabriel> not comply with the PCI spec (some do not even correctly
> Gabriel> implement the first 0x10 bytes of the configuration space
> Gabriel> header).
>
> There is nothing preventing a manufacturer to design a card with IDE,
> serial, SCSI, video and sound on the same card and with all the
> registers within the same mmio region.

Indeed, but they would hopefully not be too intertwined. For example the
Hydra chip from Apple incorpoorates a lot of functions whose location is
defined by a single PCI base register, but each function uses a separate
range of addresses within the area defined by the base register. Now,

IIRC, standard PC HW has very awkwardly intertwined registers in some
areas, like the port at address 61 which is in the midlle of the keyboard
controller but can be used to control the input of the timer, the
loudspeaker and a few things about NMI. Here Linux does not even try to be
100% correct since it would be far too complex.

> Gabriel> At the very least a different list of resources should be
> Gabriel> created for MMIO. Also this type of resource structure might
> Gabriel> perhaps be designed to nicely handle the case where addresses
> Gabriel> are not the same on both sides of the bridges (like PreP MMIO
> Gabriel> and 64 bit machines). In any case, it is very probably 2.3
> Gabriel> stuff...
>
> The one reason why I do not think this is such a good idea is that
> this it will be nasty to put it into the mm layer to deal with cases
> where an X server wants to mmap the same registers as are currently
> being used by a kernel fb driver and similar.

First this would require some interaction between mmap on /dev/mem and
this list, which is unlikely. Second, you could always add a flag telling
that you are willing to share the area.

Gabriel.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/