From: Greg Kroah-Hartman Date: Thu, 6 Feb 2020 16:50:22 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.19.103~124 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67b27388d5fd0569cbb9b26dbf0c3c249ea81477;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: powerpc-pseries-advance-pfn-if-section-is-not-present-in-lmb_is_removable.patch --- diff --git a/queue-4.4/powerpc-pseries-advance-pfn-if-section-is-not-present-in-lmb_is_removable.patch b/queue-4.4/powerpc-pseries-advance-pfn-if-section-is-not-present-in-lmb_is_removable.patch new file mode 100644 index 00000000000..204e2f07d01 --- /dev/null +++ b/queue-4.4/powerpc-pseries-advance-pfn-if-section-is-not-present-in-lmb_is_removable.patch @@ -0,0 +1,38 @@ +From fbee6ba2dca30d302efe6bddb3a886f5e964a257 Mon Sep 17 00:00:00 2001 +From: Pingfan Liu +Date: Fri, 10 Jan 2020 12:54:02 +0800 +Subject: powerpc/pseries: Advance pfn if section is not present in lmb_is_removable() + +From: Pingfan Liu + +commit fbee6ba2dca30d302efe6bddb3a886f5e964a257 upstream. + +In lmb_is_removable(), if a section is not present, it should continue +to test the rest of the sections in the block. But the current code +fails to do so. + +Fixes: 51925fb3c5c9 ("powerpc/pseries: Implement memory hotplug remove in the kernel") +Cc: stable@vger.kernel.org # v4.1+ +Signed-off-by: Pingfan Liu +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/1578632042-12415-1-git-send-email-kernelfans@gmail.com +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/platforms/pseries/hotplug-memory.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/arch/powerpc/platforms/pseries/hotplug-memory.c ++++ b/arch/powerpc/platforms/pseries/hotplug-memory.c +@@ -205,8 +205,10 @@ static bool lmb_is_removable(struct of_d + + for (i = 0; i < scns_per_block; i++) { + pfn = PFN_DOWN(phys_addr); +- if (!pfn_present(pfn)) ++ if (!pfn_present(pfn)) { ++ phys_addr += MIN_MEMORY_BLOCK_SIZE; + continue; ++ } + + rc &= is_mem_section_removable(pfn, PAGES_PER_SECTION); + phys_addr += MIN_MEMORY_BLOCK_SIZE; diff --git a/queue-4.4/series b/queue-4.4/series index f465f949e68..02193d456df 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -15,3 +15,4 @@ usb-gadget-f_ncm-use-atomic_t-to-track-in-flight-request.patch usb-gadget-f_ecm-use-atomic_t-to-track-in-flight-request.patch alsa-dummy-fix-pcm-format-loop-in-proc-output.patch lib-test_kasan.c-fix-memory-leak-in-kmalloc_oob_krealloc_more.patch +powerpc-pseries-advance-pfn-if-section-is-not-present-in-lmb_is_removable.patch