powerpc/pseries: Correct cpu affinity for dlpar added cpus
authorNathan Fontenot <nfont@linux.vnet.ibm.com>
Thu, 30 Apr 2015 01:42:06 +0000 (20:42 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Aug 2015 23:32:09 +0000 (00:32 +0100)
commit7807354f17297234692897fd5a0700e79b7949a9
tree70fb6f231b37e26742a18a6eee406d863d86146e
parent5e3a0d7c5c5f3bac1c35595d6b16f2f638e42b53
powerpc/pseries: Correct cpu affinity for dlpar added cpus

commit f32393c943e297b8ae180c8f83d81a156c7d0412 upstream.

The incorrect ordering of operations during cpu dlpar add results in invalid
affinity for the cpu being added. The ibm,associativity property in the
device tree is populated with all zeroes for the added cpu which results in
invalid affinity mappings and all cpus appear to belong to node 0.

This occurs because rtas configure-connector is called prior to making the
rtas set-indicator calls. Phyp does not assign affinity information
for a cpu until the rtas set-indicator calls are made to set the isolation
and allocation state.

Correct the order of operations to make the rtas set-indicator
calls (done in dlpar_acquire_drc) before calling rtas configure-connector.

Fixes: 1a8061c46c46 ("powerpc/pseries: Add kernel based CPU DLPAR handling")

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
[bwh: Backported to 3.2:
 - Adjust context
 - Keep using goto instead of directly returning]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/powerpc/platforms/pseries/dlpar.c