Attempt to fix kernel OOPS (#3358)

This commit is contained in:
Igor Pečovnik 2021-12-20 09:42:53 +01:00 committed by GitHub
parent c2ca3e3ebd
commit e1c96e5257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,36 @@
From a5c446a989bbb4d6efd493f11e09ec3a3560887f Mon Sep 17 00:00:00 2001
From: Igor Pecovnik <igor.pecovnik@gmail.com>
Date: Sat, 18 Dec 2021 13:39:36 +0100
Subject: [PATCH] Revert "arm: ioremap: don't abuse pfn_valid() to check if pfn
is in RAM"
This reverts commit 8dd559d53b3b2de960ca1ec1359f5a9b4a12e181.
---
arch/arm/mm/ioremap.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 80fb5a4a5c05..000e8210000b 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -27,7 +27,6 @@
#include <linux/vmalloc.h>
#include <linux/io.h>
#include <linux/sizes.h>
-#include <linux/memblock.h>
#include <asm/cp15.h>
#include <asm/cputype.h>
@@ -285,8 +284,7 @@ static void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
* Don't allow RAM to be mapped with mismatched attributes - this
* causes problems with ARMv6+
*/
- if (WARN_ON(memblock_is_map_memory(PFN_PHYS(pfn)) &&
- mtype != MT_MEMORY_RW))
+ if (WARN_ON(pfn_valid(pfn) && mtype != MT_MEMORY_RW))
return NULL;
area = get_vm_area_caller(size, VM_IOREMAP, caller);
--
2.25.1