Ivan Passos wrote:
>
> On Fri, 28 Jul 2000, Alan Cox wrote:
> >
> > Everyone now has to use request_region and check the return since we no longer
> > single thread driver inits in all module cases. Also memory regions are now
> > requestable and a lot of old drivers dont know this yet.
>
> Alan, "memory regions" includes PCI MMIO regions??
>
> If positive, could you please give me an example of a driver that requests
> (not just ioremap) memory regions?? I wanna make sure that my drivers are
> compliant with the new scheme.
There's no specification for this scheme and driver examples are
sometimes convoluted.
for each PCI MMIO region you use, here is a quick summary of the
"rules", vaguely in order of usage:
* obtain PCI region info using back-and-forward-portable macros
pci_resource_{start,end,len,flags}
* reserve using request_mem_region, check for NULL return
* cookie = ioremap(), check for NULL return
* communicate with MMIO region using {read,write}[bwl], memcpy*io,
memset_io, and io_remap_page_range. addressing is accomplished via
offsets from the value in 'cookie'.
* never directly de-reference an ioremap'd area
* free region when done, with iounmap()
* release acquired resource region with release_mem_region
* On SMP, if to values are written on different CPUs to PCI MMIO region
at the "same time", the writes occur in CPU order
* MMIO Writes may be combined, but are not re-ordered, and MMIO writes
never pass MMIO reads. (so, an MMIO read is one way to flush any
pending writes)
-- Jeff Garzik | Building 1024 | Yossarian lives. MandrakeSoft, Inc. |- 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/
This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:28 EST