Skip to contentSkip to conversation

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

PATCH Applied Pingfan Liu 2 participants 2 messages Jan 10, 2020 – Jan 29, 2020 PowerPC

lore
Share & tools
lore
#0 lore raw

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

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.

Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>

To: [email protected]

---
 arch/powerpc/platforms/pseries/hotplug-memory.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/platforms/pseries/hotplug-memory.c +3 -1
index c126b94..a4d40a3 100644
@@ -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;
Signature · 1 line
2.7.5
#1 lore raw
Quoted 8 lines · Pingfan Liu

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.

Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>

To: [email protected]

Applied to powerpc next, thanks.

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

cheers