remap_page_range an caching

thomas joseph (thomascanny@yahoo.co.nz)
Fri, 21 Mar 2003 01:08:24 +1200 (NZST)


Hi All,

I am using remap_page_range to map a memory region
to user space. (This is a device memory mapped in
to kernel space by ioremap_nocache.)

I am setting the page protection flags as
_PAGE_PCD | _PAGE_PWT to disable caching as
specified in the documentation.

But when I try to read these device registers in the
user space it shows different values from
those of driver. I declared the necessary
members as volatile. But it still does not help.

When I try to read the register twice I seem to be
getting the correct value.

Like,
/* ulBWStatus is defined as volatile. */
status = pRpRegs->ulBStatus;
status = pRpRegs->ulBStatus;
This gives me the updated values. Could you
just help me if I am missing anything here.

D0 I need to insert a memory barrier in the user
space
before accessing these registers ?
If I do so then it looks like giving correct values
too.

Could somebody help to understand on what is
happening here.

Thanks in advance.

best regards,

--thomas


http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/