[FIX PATCH v1] powerpc/pseries: Release DRC when configure_connector fails

Bharata B Rao bharata.rao at gmail.com
Mon Sep 7 20:22:40 AEST 2015

From: Bharata B Rao <bharata at linux.vnet.ibm.com>

Commit f32393c943e2 ("powerpc/pseries: Correct cpu affinity for
dlpar added cpus") moved dlpar_acquire_drc() call to before
dlpar_configure_connector() call in dlpar_cpu_probe(), but missed
to release the DRC if dlpar_configure_connector() failed.
During CPU hotplug, if configure-connector fails for any reason,
then this will result in subsequent CPU hotplug attempts to fail.

Release the acquired DRC if dlpar_configure_connector() call fails
so that the DRC is left in right isolation and allocation state
for the subsequent hotplug operation to succeed.

Signed-off-by: Bharata B Rao <bharata at linux.vnet.ibm.com>
Reviewed-by: Nathan Fontenot <nfont at linux.vnet.ibm.com>
Changes in v1: Improved patch description.
v0: https://patchwork.ozlabs.org/patch/514370/

This fix should probably go to stable too.

 arch/powerpc/platforms/pseries/dlpar.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 47d9cebe..db17827 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -422,8 +422,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
 	dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent);
-	if (!dn)
+	if (!dn) {
+		dlpar_release_drc(drc_index);
 		return -EINVAL;
+	}
 	rc = dlpar_attach_node(dn);
 	if (rc) {

More information about the Linuxppc-dev mailing list