Re: ioremap() address alignment problem

Linus Torvalds (torvalds@transmeta.com)
18 Dec 1998 16:53:33 GMT


In article <XFMail.981218110342.enout@eurecom.fr>,
Alain ENOUT <enout@eurecom.fr> wrote:
>Hello,
>
>I'm writing a device driver (module) for a device using a PLX 9060.
>I try to ioremap() the address 0 (PCI base address register for memory access
>to runtime registers). On my specific harware configuration, the ethernet
>adapter I/O memory is mapped at 0xf420 1000 and mine at 0xf420 1400.
>
>When I do vremap(0xf420 1400), I get an error. So I try a range of addresses
>around (from 0xf420 1000 to 0xf420 1000 + 5000), and it seems like vremap()
>only works for page aligned addresses. Is it normal ?

It's normal, but it's also a bug.

It should be fixed in the latest 2.1.x kernels - where ioremap() will
still remap page-aligned areas (because with paging you can't do it any
other way), but at least it will silently offset the return address for
you properly and you can use it as if it had a byte granular remapping
engine.

>NB: I use kernel 2.0.34 on a DEll intel PII 450 Mhz machine.

Somebody might want to back-port the 2.1.x ioremap() fixes into 2.0.x.

Linus

-
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/