Skip to contentSkip to conversation

remap_page_range an caching

DISCUSSION thomas joseph 1 participant 1 message Mar 20, 2003

lore
Share & tools
lore
#0 lore raw

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.