]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/pseries: break early in dlpar_memory_remove_by_count() loops
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 12 May 2021 20:28:08 +0000 (17:28 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 23 May 2021 10:51:34 +0000 (20:51 +1000)
commit11aa29165df986f26ad0e045a8fc74e52ebf59a4
tree382bbba681263ab22d2ff4f48d888e20c173e9de
parent21d4f9ed8ccce446add49fe3e5d3fe1d1a0c4ebe
powerpc/pseries: break early in dlpar_memory_remove_by_count() loops

After marking the LMBs as reserved depending on dlpar_remove_lmb() rc,
we evaluate whether we need to add the LMBs back or if we can release
the LMB DRCs. In both cases, a for_each_drmem_lmb() loop without a break
condition is used. This means that we're going to cycle through all LMBs
of the partition even after we're done with what we were going to do.

This patch adds break conditions in both loops to avoid this. The
'lmbs_removed' variable was renamed to 'lmbs_reserved', and it's now
being decremented each time a lmb reservation is removed, indicating
that the operation we're doing (adding back LMBs or releasing DRCs) is
completed.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210512202809.95363-4-danielhb413@gmail.com
arch/powerpc/platforms/pseries/hotplug-memory.c