Skip to contentSkip to conversation

powerpc/pseries: Release DRC when configure_connector fails

PATCH Applied Bharata B Rao 2 participants 2 messages Sep 7, 2015 – Sep 8, 2015 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/pseries: Release DRC when configure_connector fails

From: Bharata B Rao <[email protected]>

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.

---
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(-)
arch/powerpc/platforms/pseries/dlpar.c +3 -1
index 47d9cebe..db17827 100644
@@ -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) {
Signature · 1 line
1.8.3.1
reviewer Applied
#1 lore raw
Quoted 9 lines · Bharata B Rao

From: Bharata B Rao <[email protected]>

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.

Quoted 6 lines

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.

Applied to powerpc fixes, thanks.

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

cheers