powerpc/pseries: Use lmb_is_removable() to check removability
authorNathan Fontenot <nfont@linux.vnet.ibm.com>
Mon, 28 Nov 2016 16:50:45 +0000 (11:50 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 1 Dec 2016 09:49:42 +0000 (20:49 +1100)
commit2db029ef58ab7c47cecab5fe73fa6e3ae6663ecf
tree7e8b603c82c338072a0aad929465b1b3e8c17826
parentdd5ac03e09554b7504f64990cfbcec884e3ec430
powerpc/pseries: Use lmb_is_removable() to check removability

We should be using lmb_is_removable() to validate that enough LMBs
are available to remove when doing a remove by count. This will check
that the LMB is owned by the system and it is considered removable.
This patch also adds a pr_info() notification to report the LMB count
to remove was not satisfied.

What we do now is just check that there are enough LMBs owned by the
system when validating there are enough LMBs to remove. This can
lead to situations where there are enough LMBs owned by the system
but not enough that are considered removable. This results in having
to bail out of the remove operation instead of just failing the request
that we should have known wouldn't succeed.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/pseries/hotplug-memory.c