@@ -13,5 +13,6 @@ void on_cpu(int cpu, void (*func)(void *data), void *data);
void on_cpus(void (*func)(void *data), void *data);
void on_cpumask_async(const cpumask_t *mask, void (*func)(void *data), void *data);
void on_cpumask(const cpumask_t *mask, void (*func)(void *data), void *data);
+void on_cpu_clear_func(int cpu);
#endif /* _ON_CPUS_H_ */
@@ -171,3 +171,14 @@ void on_cpus(void (*func)(void *data), void *data)
{
on_cpumask(&cpu_present_mask, func, data);
}
+
+void on_cpu_clear_func(int cpu)
+{
+ for (;;) {
+ if (get_on_cpu_info(cpu))
+ break;
+ }
+
+ on_cpu_info[cpu].func = NULL;
+ put_on_cpu_info(cpu);
+}
When a CPU abruptly stops during some test, the CPU will not have the chance to go back to the do_idle() loop and set the on_cpu_info[cpu].func variable to NULL. Add a helper method for some test manager CPU to clear this function. This would re-enable on_cpu_async and allow future tests to use the on-cpus API again. Signed-off-by: James Raphael Tiovalen <jamestiotio@gmail.com> --- lib/on-cpus.h | 1 + lib/on-cpus.c | 11 +++++++++++ 2 files changed, 12 insertions(+)