diff mbox

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

Message ID 1441621360-1536-1-git-send-email-bharata.rao@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Bharata B Rao Sept. 7, 2015, 10:22 a.m. UTC
From: Bharata B Rao <bharata@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@linux.vnet.ibm.com>
Reviewed-by: Nathan Fontenot <nfont@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(-)

Comments

Michael Ellerman Sept. 8, 2015, 12:05 p.m. UTC | #1
On Mon, 2015-07-09 at 10:22:40 UTC, Bharata B Rao wrote:
> From: Bharata B Rao <bharata@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@linux.vnet.ibm.com>
> Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/daebaabb5cfbe4a6f09ca0e0

cheers
diff mbox

Patch

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);
 	of_node_put(parent);
-	if (!dn)
+	if (!dn) {
+		dlpar_release_drc(drc_index);
 		return -EINVAL;
+	}
 
 	rc = dlpar_attach_node(dn);
 	if (rc) {