mmap and ppc460gt

vb vb at vsbe.com
Thu Aug 28 13:47:24 EST 2008


On Wed, Aug 27, 2008 at 8:12 PM, Roland Dreier <rdreier at cisco.com> wrote:
> OK, please try this and let me know if it helps:
>
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index 1c93c25..98d7bf9 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -75,11 +75,10 @@ static inline pte_t *virt_to_kpte(unsigned long vaddr)
>
>  int page_is_ram(unsigned long pfn)
>  {
> -       unsigned long paddr = (pfn << PAGE_SHIFT);
> -
>  #ifndef CONFIG_PPC64   /* XXX for now */
> -       return paddr < __pa(high_memory);
> +       return pfn < max_pfn;
>  #else
> +       unsigned long paddr = (pfn << PAGE_SHIFT);
>        int i;
>        for (i=0; i < lmb.memory.cnt; i++) {
>                unsigned long base;
>

Ronald, thank you for the hint,  I actually tried something slightly different:

return pfn < (__pa(high_memory) >> PAGE_SHIFT);

and it worked. I guess your fix is faster, I'll try it tomorrow.

I also checked that the problem is there in the top of the tree in
Linus' git - isn't it amazing - I guess very few people use mmap()
nowadays, everybody must be using UIO device :-)

cheers,
vadim


More information about the Linuxppc-embedded mailing list