powerpc/pseries: Release DRC when configure_connector fails
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
@@ -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
Quoted 9 lines · Bharata B Rao
From: Bharata B Rao <[email protected]>
Commit
f32393c943e2("powerpc/pseries: Correct cpu affinity for dlpar added cpus") moveddlpar_acquire_drc()call to beforedlpar_configure_connector()call indlpar_cpu_probe(), but missed to release the DRC ifdlpar_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.Signed-off-by Bharata B Rao <[email protected]>Reviewed-by Nathan Fontenot <[email protected]>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/daebaabb5cfbe4a6f09ca0e0
cheers