summaryrefslogtreecommitdiff
path: root/arch/arm/mm/mmu.c
diff options
context:
space:
mode:
authorKrishna Reddy <vdumpa@nvidia.com>2011-11-30 17:37:52 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 01:32:25 -0700
commitad12237729fcfba773247b1338efe1c176bd21ff (patch)
treeb22002b18b9a3128b26c09efaa84de56337d962f /arch/arm/mm/mmu.c
parent9402656e30f63dcabb3d1a7ea1219e50019f2305 (diff)
arm: mm: Fix CPA page count stats issue.
Bug 865816 Change-Id: Iebdfdbd650cb82f25487ebee1c2b3839ed1fcf94 Signed-off-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-on: http://git-master/r/71729 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Rebase-Id: R080ec0114d713e1fc266009a3cae7c6f7b45bcc0
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r--arch/arm/mm/mmu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index adbdf0fa5543..c68646dfe70e 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -649,6 +649,7 @@ static void __init alloc_init_pmd(pud_t *pud, unsigned long addr,
{
pmd_t *pmd = pmd_offset(pud, addr);
unsigned long pages_2m = 0, pages_4k = 0;
+ unsigned long stash_phys = phys;
unsigned long next;
do {
@@ -664,19 +665,19 @@ static void __init alloc_init_pmd(pud_t *pud, unsigned long addr,
*/
if (type->prot_sect &&
((addr | next | phys) & ~SECTION_MASK) == 0) {
+ pages_2m += (end-addr) >> (PGDIR_SHIFT);
__map_init_section(pmd, addr, next, phys, type);
- pages_2m += (end-addr) >> SECTION_SHIFT;
} else {
+ pages_4k += (end-addr) >> PAGE_SHIFT;
alloc_init_pte(pmd, addr, next,
__phys_to_pfn(phys), type);
- pages_4k += (end-addr) >> PAGE_SHIFT;
}
phys += next - addr;
} while (pmd++, addr = next, addr != end);
- if ((addr < lowmem_limit) && (end < lowmem_limit)) {
+ if ((stash_phys >= PHYS_OFFSET) && (stash_phys < lowmem_limit)) {
update_page_count(PG_LEVEL_2M, pages_2m);
update_page_count(PG_LEVEL_4K, pages_4k);
}