Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/pseries: Release DRC when configure_connector fails

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.

Fixes: f32393c943e2 ("powerpc/pseries: Correct cpu affinity for dlpar added cpus")
Cc: stable@vger.kernel.org # 4.1+
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Bharata B Rao and committed by
Michael Ellerman
daebaabb 7d1647dc

+3 -1
+3 -1
arch/powerpc/platforms/pseries/dlpar.c
··· 422 422 423 423 dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent); 424 424 of_node_put(parent); 425 - if (!dn) 425 + if (!dn) { 426 + dlpar_release_drc(drc_index); 426 427 return -EINVAL; 428 + } 427 429 428 430 rc = dlpar_attach_node(dn); 429 431 if (rc) {