Re: [PATCH 0/2] FLATMEM: allow memory to start at pfn != 0 [take #2]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

On 3/7/07, Maxime Bizon <mbizon@xxxxxxxxxx> wrote:
I found the problem, I think these two liners are missing from your

good catch ! I dunno why this is missing from the original patch since
I have this in my own tree.

patch. My board now works correctly, with 2MB more free memory, thanks
for this ! (and for the free tour in mm/ ;)


yeah 2MB is quite a lot for embedded system.




Commit 6f284a2ce7b8bc49cb8455b1763357897a899abb introduced PHYS_OFFSET,
but missed some virtual to physical address conversion. The following
patch fixes it.


Signed-off-by: Maxime Bizon <mbizon@xxxxxxxxxx>

--- linux-2.6.20/include/asm-mips/pgtable.h     2007-02-04 21:22:45.000000000 +0100
+++ linux/include/asm-mips/pgtable.h    2007-03-07 17:28:20.000000000 +0100
@@ -75,7 +75,7 @@
  * Conversion functions: convert a page and protection to a page entry,
  * and a page entry and page directory to the page they refer to.
  */
-#define pmd_phys(pmd)          (pmd_val(pmd) - PAGE_OFFSET)
+#define pmd_phys(pmd)          (pmd_val(pmd) - PAGE_OFFSET + PHYS_OFFSET)

please use virt_to_phys() instead plain translation...

 #define pmd_page(pmd)          (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
 #define pmd_page_vaddr(pmd)    pmd_val(pmd)

--- linux-2.6.20/include/asm-mips/pgtable-64.h  2007-02-04 21:22:45.000000000 +0100
+++ linux/include/asm-mips/pgtable-64.h 2007-03-07 17:28:47.000000000 +0100
@@ -199,7 +199,7 @@
 {
        return pud_val(pud);
 }
-#define pud_phys(pud)          (pud_val(pud) - PAGE_OFFSET)
+#define pud_phys(pud)          (pud_val(pud) - PAGE_OFFSET + PHYS_OFFSET)

ditto

Ralf, could this patch reach ASAP your main tree ?

thanks
--
              Franck


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux