lkml.org 
[lkml]   [1999]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Big Fix for 2.2.1
Leonard N. Zubkoff wrote:
> (1) The identity phys_to_virt(virt_to_phys(x)) == x is violated.

That identity makes no sense anyway. Not every "phys" address has a
corresponding "virt" address. In my opinion, phys_to_virt should be
removed, and the few drivers that use it changed to work properly.

> (2) The readb/writeb/readw/writew/readl/writel macros are completely incorrect
> since they are supposed to be applied to memory mapped I/O regions
> allocated with ioremap, but ioremap returns a kernel virtual address
> and hence no further mapping is appropriate.

No, this is wrong. ioremap() does _not_ return a "virt" address, though
it does return a virtual address. Calling virt_to_phys() on the return
value of ioremap() does _not_ get you the physical address.

Read the examples in `documentation/IO-mapping.txt'. Logically,
ioremap() and "phys" addresses share the same space: the space of
addresses that can be passed to readb/writeb et al.

"virt" addresses refer to virtual addresses in the direct-mapped kernel
image, but not vmalloc() or ioremap() addresses. Beware.

These concepts need some serious cleaning up, and it's a 2.3 thing.

-- Jamie

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

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.066 / U:0.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site