From ae8c2a7501395b9b4df96e2dfecddfa6b7501f80 Mon Sep 17 00:00:00 2001 From: Abhijeet Dharmapurikar Date: Wed, 5 May 2021 10:58:55 -0700 Subject: [PATCH] ANDROID: topology: Add flag to indicate topology has been updated Commit f7128c75332b ("ANDROID: sched: Add vendor hooks for update_topology") was intended for the modules to get informed when topology initialization had completed. However that is not sufficient, the module could be insmoded after the hook was invoked. For such situations create a flag for modules to detect that topology initialization is completed. Bug: 187234873 Change-Id: I2ed4dff9c921e3de67dd11049c80f38e3c1a64fd Signed-off-by: Abhijeet Dharmapurikar --- drivers/base/arch_topology.c | 3 +++ include/linux/arch_topology.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 5342845743f2..f87f3b2ebd86 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -115,6 +115,8 @@ static int register_cpu_capacity_sysctl(void) subsys_initcall(register_cpu_capacity_sysctl); static int update_topology; +bool topology_update_done; +EXPORT_SYMBOL_GPL(topology_update_done); int topology_update_cpu_topology(void) { @@ -129,6 +131,7 @@ static void update_topology_flags_workfn(struct work_struct *work) { update_topology = 1; rebuild_sched_domains(); + topology_update_done = true; trace_android_vh_update_topology_flags_workfn(NULL); pr_debug("sched_domain hierarchy rebuilt, flags updated\n"); update_topology = 0; diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h index 3f33dfe7f808..d76d95310c4b 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -75,5 +75,6 @@ void remove_cpu_topology(unsigned int cpuid); void reset_cpu_topology(void); int parse_acpi_topology(void); #endif +extern bool topology_update_done; #endif /* _LINUX_ARCH_TOPOLOGY_H_ */