staging: ashmem: Fix the build failure when OUTER_CACHE is enabled
ashmem driver is failing to build when OUTER_CACHE is enabled
through the CACHE_L2X0 option. Fix it with appropriate new
offset routines.
Change-Id: I298f9bb32899f20e17407b5210d0859d6308c035
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index 8390f5d..5d79bd2 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -631,24 +631,32 @@
{
unsigned int physaddr = 0;
pgd_t *pgd_ptr = NULL;
+ pud_t *pud_ptr = NULL;
pmd_t *pmd_ptr = NULL;
pte_t *pte_ptr = NULL, pte;
spin_lock(¤t->mm->page_table_lock);
pgd_ptr = pgd_offset(current->mm, virtaddr);
- if (pgd_none(*pgd) || pgd_bad(*pgd)) {
+ if (pgd_none(*pgd_ptr) || pgd_bad(*pgd_ptr)) {
pr_err("Failed to convert virtaddr %x to pgd_ptr\n",
virtaddr);
goto done;
}
- pmd_ptr = pmd_offset(pgd_ptr, virtaddr);
- if (pmd_none(*pmd_ptr) || pmd_bad(*pmd_ptr)) {
- pr_err("Failed to convert pgd_ptr %p to pmd_ptr\n",
+ pud_ptr = pud_offset(pgd_ptr, virtaddr);
+ if (pud_none(*pud_ptr) || pud_bad(*pud_ptr)) {
+ pr_err("Failed to convert pgd_ptr %p to pud_ptr\n",
(void *)pgd_ptr);
goto done;
}
+ pmd_ptr = pmd_offset(pud_ptr, virtaddr);
+ if (pmd_none(*pmd_ptr) || pmd_bad(*pmd_ptr)) {
+ pr_err("Failed to convert pud_ptr %p to pmd_ptr\n",
+ (void *)pud_ptr);
+ goto done;
+ }
+
pte_ptr = pte_offset_map(pmd_ptr, virtaddr);
if (!pte_ptr) {
pr_err("Failed to convert pmd_ptr %p to pte_ptr\n",