Skip to content

Commit

Permalink
powerpc/pseries: Advance pfn if section is not present in lmb_is_remo…
Browse files Browse the repository at this point in the history
…vable()

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: 51925fb ("powerpc/pseries: Implement memory hotplug remove in the kernel")
Cc: [email protected] # v4.1+
Signed-off-by: Pingfan Liu <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
liupingfan authored and mpe committed Jan 14, 2020
1 parent c2a2071 commit fbee6ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/powerpc/platforms/pseries/hotplug-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fbee6ba

Please sign in to comment.