Message ID | 20100114.024315.175527306.davem@davemloft.net |
---|---|
State | RFC |
Delegated to: | David Miller |
Headers | show |
David Miller wrote: > So I did research and this code is the way it is because > of LEON (this commit is from "linux-2.6-history.git") :-) Back then I was attending grad school and was blissfully unaware. :-) > > So let's take baby steps, please confirm that you agree with me that > the following patch is correct and that it works on your machine. It works fine for me! > If it works I want to reinstate the virt_to_page() change I posted > the other day as well, simply so that we consistently use the > asm-generic/memory-model.h interfaces instead of assuming FLATMEM > memory model all over our headers. Yes this change works as well. > > But I am truly mystified how anything works with non-zero phys_base > with this being wrong. Fundamental operations like > {srmmu,sun4c}_mk_pte() use this. > > LEON uses this via SRMMU, so how does it work properly? :-) Hmm, srmmu_mk_pte() uses page_to_pfn() which accounts for pfn_base? The only use of page_to_phys below arch/sparc that I find is in pci32_map_page which is where I got into trouble. :-) Thanks for looking into this! Best regards, Kristoffer -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Kristoffer Glembo <kristoffer@gaisler.com> Date: Thu, 14 Jan 2010 12:05:34 +0100 > It works fine for me! ... > Yes this change works as well. Thanks for testing. > Hmm, srmmu_mk_pte() uses page_to_pfn() which accounts for pfn_base? My eyes aren't working, I confused page_to_pfn() with page_to_phys(). Great, now it is all clear. I'll add the fix to sparc-2.6, thanks again. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h index 93fe21e..679c750 100644 --- a/arch/sparc/include/asm/io_32.h +++ b/arch/sparc/include/asm/io_32.h @@ -8,7 +8,7 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> -#define page_to_phys(page) (((page) - mem_map) << PAGE_SHIFT) +#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) static inline u32 flip_dword (u32 l) {