Re: A simple question about readw, readw and the like

From: Ralf Baechle (ralf@uni-koblenz.de)
Date: Fri Jul 28 2000 - 07:21:51 EST


On Thu, Jul 27, 2000 at 03:12:54PM +0200, Jamie Lokier wrote:

> David S. Miller wrote:
> > Derefencing the return pointer from ioremap() and not using the readw
> > etc. interfaces is almost guarenteed to not work on any platform
> > other than x86. On Sparc64 for example the return from ioremap()
> > happens to be a physical address and will OOPS on you on any direct
> > derefence of that pointer, readw() and friends do the access in the
> > correct manner.
>
> Has anyone considered offsetting the ioremap() return address and
> subtracting that offset in readl() et al., to catch bogus drivers that
> dereference directly?
>
> I'd guess most drivers are tested only on x86 -- this is one way to
> check that they're getting at least one portability issue right.

We do this on MIPS and it caught a significant number of driver bugs.

  Ralf

-
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:32 EST