[PATCH] powerpc/pseries: in lmb_is_removable(), advance pfn if section is not present

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE2422d LANDED

Landed in mainline as fbee6ba2dca3 on 2020-01-14.

2 messages, 2 authors, 2020-01-29 · open the first message on its own page

[PATCH] powerpc/pseries: in lmb_is_removable(), advance pfn if section is not present

From: Pingfan Liu <hidden>
Date: 2020-01-10 04:56:26

In lmb_is_removable(), if a section is not present, it should continue to
test the rest sections in the block. But the current code fails to do so.

Signed-off-by: Pingfan Liu <redacted>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <redacted>
Cc: Michael Ellerman <mpe@ellerman.id.au>
To: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/platforms/pseries/hotplug-memory.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index c126b94..a4d40a3 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -360,8 +360,10 @@ static bool lmb_is_removable(struct drmem_lmb *lmb)
 
 	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 = rc && is_mem_section_removable(pfn, PAGES_PER_SECTION);
 		phys_addr += MIN_MEMORY_BLOCK_SIZE;
-- 
2.7.5

Re: [PATCH] powerpc/pseries: in lmb_is_removable(), advance pfn if section is not present

From: Michael Ellerman <hidden>
Date: 2020-01-29 06:05:28

On Fri, 2020-01-10 at 04:54:02 UTC, Pingfan Liu wrote:
In lmb_is_removable(), if a section is not present, it should continue to
test the rest sections in the block. But the current code fails to do so.

Signed-off-by: Pingfan Liu <redacted>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <redacted>
Cc: Michael Ellerman <mpe@ellerman.id.au>
To: linuxppc-dev@lists.ozlabs.org
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/fbee6ba2dca30d302efe6bddb3a886f5e964a257

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help