Ravi Gupta <dceravigu...@gmail.com> wrote:

> My device gets memory map successfully but when I tried to read from it
> I get garbage value. Is there something that I am missing?

For starters, you really should allocate a page for your buffer rather than
using kernel static data.  mmap() allows access to page-aligned data through
multiple-of-page-sized holes only[*].  Not only that, your kernel static map
buffer may not necessarily have a struct page covering it, in which case
virt_to_page() may not give you anything useful.

Furthermore, I don't think *you* should be calling remap_pfn_range().
I think you should be leaving the mapping to the core VM routines.

David

[*] unless your kernel is CONFIG_MMU=n
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to