Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-10-03 20:00:39 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-10-03 20:00:56 +0200
commit7143fa6f38a72f28a0c2d19dec685ca8c01ceedb (patch)
tree0fb9c78da765cca7bf4c453f9cf936b46a13701a
parentfea548086858334e2acfeaf13f66bea1c475c0d0 (diff)
powerpc/mm: Simplify page_is_ram by using memblock_is_memory
(bsc#1065729).
-rw-r--r--patches.suse/powerpc-mm-Simplify-page_is_ram-by-using-memblock_is.patch43
-rw-r--r--series.conf1
2 files changed, 44 insertions, 0 deletions
diff --git a/patches.suse/powerpc-mm-Simplify-page_is_ram-by-using-memblock_is.patch b/patches.suse/powerpc-mm-Simplify-page_is_ram-by-using-memblock_is.patch
new file mode 100644
index 0000000000..ed98ea264a
--- /dev/null
+++ b/patches.suse/powerpc-mm-Simplify-page_is_ram-by-using-memblock_is.patch
@@ -0,0 +1,43 @@
+From 2615c93e5f52db62586112793d889face99eb905 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= <j.neuschaefer@gmx.net>
+Date: Wed, 28 Mar 2018 02:25:40 +0200
+Subject: [PATCH] powerpc/mm: Simplify page_is_ram by using memblock_is_memory
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+References: bsc#1065729
+Patch-mainline: v4.17-rc1
+Git-commit: 2615c93e5f52db62586112793d889face99eb905
+
+Instead of open-coding the search in page_is_ram, call memblock_is_memory.
+
+Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/mm/mem.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
+index e2f5025b03b0..8f335cf052f8 100644
+--- a/arch/powerpc/mm/mem.c
++++ b/arch/powerpc/mm/mem.c
+@@ -85,13 +85,7 @@ int page_is_ram(unsigned long pfn)
+ #ifndef CONFIG_PPC64 /* XXX for now */
+ return pfn < max_pfn;
+ #else
+- unsigned long paddr = (pfn << PAGE_SHIFT);
+- struct memblock_region *reg;
+-
+- for_each_memblock(memory, reg)
+- if (paddr >= reg->base && paddr < (reg->base + reg->size))
+- return 1;
+- return 0;
++ return memblock_is_memory(__pfn_to_phys(pfn));
+ #endif
+ }
+
+--
+2.23.0
+
diff --git a/series.conf b/series.conf
index 7e938b5066..9ab81eed59 100644
--- a/series.conf
+++ b/series.conf
@@ -15630,6 +15630,7 @@
patches.suse/4.4.134-183-powerpc-mpic-Check-if-cpu_possible-in-mpic_ph.patch
patches.suse/powerpc-setup-Add-cpu_to_phys_id-array.patch
patches.suse/powerpc-kvm-Fix-guest-boot-failure-on-Power9-since-D.patch
+ patches.suse/powerpc-mm-Simplify-page_is_ram-by-using-memblock_is.patch
patches.suse/powerpc-kexec_file-Fix-error-code-when-trying-to-loa.patch
patches.suse/powerpc-eeh-Fix-race-with-driver-un-bind.patch
patches.suse/powerpc-64s-idle-avoid-sync-for-KVM-state-when-wakin.patch