Linux driver-core infrastructure
 help / color / mirror / Atom feed
* [PATCH v2 1/2] arch_topology: Reset SMT state when socket parsing fails
@ 2026-11-06 16:44 Sudeep Holla
  2026-11-06 16:44 ` [PATCH v2 2/2] arch_topology: Free ACPI SMT entries on lookup failure Sudeep Holla
  0 siblings, 1 reply; 2+ messages in thread
From: Sudeep Holla @ 2026-11-06 16:44 UTC (permalink / raw)
  To: driver-core; +Cc: Sudeep Holla, Greg Kroah-Hartman, Sashiko

If a later socket's cluster fails device tree parsing, parse_socket()
returns immediately. Cores parsed earlier can have raised
max_smt_thread_num, but this return skips the reset to 1 and the
cpu_smt_set_num_threads() notification. The framework is left with an
inconsistent SMT state after topology parsing fails.

Break out of the socket loop on parse_cluster() failure so the existing
error handling resets the thread count and notifies the SMT framework
before returning the error.

Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-73adead8-21f3-470d-938c-b1f07a269a72
Fixes: 5deb9c789ae4 ("arch_topology: Support SMT control for OF based system")
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
---
 drivers/base/arch_topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

v1->v2:
 - No change(just posting together with 2/2 which was result of sashiko review)
 - v1: https://lore.kernel.org/all/20261103093421.1283949-1-sudeep.holla@kernel.org

diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 8c5e47c28d9a..1569ab3335f5 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -633,7 +633,7 @@ static int __init parse_socket(struct device_node *socket)
 		has_socket = true;
 		ret = parse_cluster(c, package_id, -1, 0);
 		if (ret != 0)
-			return ret;
+			break;
 
 		package_id++;
 	} while (1);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-06 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 16:44 [PATCH v2 1/2] arch_topology: Reset SMT state when socket parsing fails Sudeep Holla
2026-11-06 16:44 ` [PATCH v2 2/2] arch_topology: Free ACPI SMT entries on lookup failure Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox