Thread (52 messages) flat view 52 messages, 6 authors, 2011-05-27

[PATCH v5 00/19] ARM: Add support for the Large Physical Address Extensions

From: catalin.marinas@arm.com (Catalin Marinas)
Date: 2011-05-27 09:10:04
Also in: lkml
Subsystem: arm port, the rest · Maintainers: Russell King, Linus Torvalds

On Thu, May 26, 2011 at 10:44:49PM +0100, Russell King - ARM Linux wrote:
On Thu, May 26, 2011 at 10:15:49PM +0100, Catalin Marinas wrote:
quoted
On 24 May 2011 11:04, Catalin Marinas [off-list ref] wrote:
quoted
On Mon, 2011-05-23 at 17:54 +0100, Russell King - ARM Linux wrote:
quoted
FYI, I'm going to drop the pgt patch because the warnings are still there
I'd like to fix those warning but I can't reproduce them (maybe
different compiler versions?).
They're certainly not compiler version dependent (or if they are, your
compiler is broken).  It'll probably be because you're building for
SMP, in which case the affected code is not built:
OK. Since the smp-on-up feature I don't check UP builds regularly.
arch/arm/mm/ioremap.c: In function unmap_area_sections:
arch/arm/mm/ioremap.c:86: warning: passing argument 1 of pmd_offset from
incompatible pointer type
arch/arm/mm/ioremap.c: In function remap_area_sections:
arch/arm/mm/ioremap.c:136: warning: passing argument 1 of pmd_offset from
incompatible pointer type
arch/arm/mm/ioremap.c: In function remap_area_supersections:
arch/arm/mm/ioremap.c:173: warning: passing argument 1 of pmd_offset from
incompatible pointer type
The patch below fixes the warnings. Tested on VE in UP configuration.

Later we can change the loops to walking the pmd using PMD_SIZE for
consistency with the LPAE patches where we consider PMD to be the
section in both cases. There is no functional change since the pmd is
folded into pud which is folded into the pgd and PMD_SIZE == PGDIR_SIZE
with the classic page tables.

diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index ab50627..0da0091 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -83,7 +83,8 @@ static void unmap_area_sections(unsigned long virt, unsigned long size)
 	flush_cache_vunmap(addr, end);
 	pgd = pgd_offset_k(addr);
 	do {
-		pmd_t pmd, *pmdp = pmd_offset(pgd, addr);
+		pud_t *pud = pud_offset(pgd, addr);
+		pmd_t pmd, *pmdp = pmd_offset(pud, addr);
 
 		pmd = *pmdp;
 		if (!pmd_none(pmd)) {
@@ -133,7 +134,8 @@ remap_area_sections(unsigned long virt, unsigned long pfn,
 
 	pgd = pgd_offset_k(addr);
 	do {
-		pmd_t *pmd = pmd_offset(pgd, addr);
+		pud_t *pud = pud_offset(pgd, addr);
+		pmd_t *pmd = pmd_offset(pud, addr);
 
 		pmd[0] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);
 		pfn += SZ_1M >> PAGE_SHIFT;
@@ -170,7 +172,8 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
 		super_pmd_val |= ((pfn >> (32 - PAGE_SHIFT)) & 0xf) << 20;
 
 		for (i = 0; i < 8; i++) {
-			pmd_t *pmd = pmd_offset(pgd, addr);
+			pud_t *pud = pud_offset(pgd, addr);
+			pmd_t *pmd = pmd_offset(pud, addr);
 
 			pmd[0] = __pmd(super_pmd_val);
 			pmd[1] = __pmd(super_pmd_val);

-- 
Catalin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help