Commit 7807354f authored by Nathan Fontenot's avatar Nathan Fontenot Committed by Ben Hutchings

powerpc/pseries: Correct cpu affinity for dlpar added cpus

commit f32393c9 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: 1a8061c4 ("powerpc/pseries: Add kernel based CPU DLPAR handling")
Signed-off-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
[bwh: Backported to 3.2:
 - Adjust context
 - Keep using goto instead of directly returning]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 5e3a0d7c
...@@ -416,6 +416,12 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count) ...@@ -416,6 +416,12 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
goto out; goto out;
} }
rc = dlpar_acquire_drc(drc_index);
if (rc) {
rc = -EINVAL;
goto out;
}
dn = dlpar_configure_connector(drc_index); dn = dlpar_configure_connector(drc_index);
if (!dn) { if (!dn) {
rc = -EINVAL; rc = -EINVAL;
...@@ -436,13 +442,6 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count) ...@@ -436,13 +442,6 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
kfree(dn->full_name); kfree(dn->full_name);
dn->full_name = cpu_name; dn->full_name = cpu_name;
rc = dlpar_acquire_drc(drc_index);
if (rc) {
dlpar_free_cc_nodes(dn);
rc = -EINVAL;
goto out;
}
rc = dlpar_attach_node(dn); rc = dlpar_attach_node(dn);
if (rc) { if (rc) {
dlpar_release_drc(drc_index); dlpar_release_drc(drc_index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment