3838#include <sof/lock.h>
3939#include <sof/notifier.h>
4040#include <sof/debug.h>
41+ #include <sof/cpu.h>
4142#include <platform/clk.h>
4243#include <platform/platform.h>
4344#include <limits.h>
@@ -463,11 +464,13 @@ struct work_queue *work_new_queue(struct work_queue_timesource *ts)
463464 queue -> ticks_per_msec = clock_ms_to_ticks (queue -> ts -> clk , 1 );
464465 queue -> window_size = queue -> ticks_per_usec * PLATFORM_WORKQ_WINDOW ;
465466
466- /* notification of clk changes */
467- queue -> notifier .cb = work_notify ;
468- queue -> notifier .cb_data = queue ;
469- queue -> notifier .id = ts -> notifier ;
470- notifier_register (& queue -> notifier );
467+ if (cpu_get_id () == PLATFORM_MASTER_CORE_ID ) {
468+ /* notification of clk changes */
469+ queue -> notifier .cb = work_notify ;
470+ queue -> notifier .cb_data = queue ;
471+ queue -> notifier .id = ts -> notifier ;
472+ notifier_register (& queue -> notifier );
473+ }
471474
472475 /* register system timer */
473476 timer_register (& queue -> ts -> timer , queue_run , queue );
@@ -489,7 +492,10 @@ void free_system_workq(void)
489492 spin_lock_irq (& (* queue )-> lock , flags );
490493
491494 timer_unregister (& (* queue )-> ts -> timer );
492- notifier_unregister (& (* queue )-> notifier );
495+
496+ if (cpu_get_id () == PLATFORM_MASTER_CORE_ID )
497+ notifier_unregister (& (* queue )-> notifier );
498+
493499 list_item_del (& (* queue )-> work );
494500
495501 spin_unlock_irq (& (* queue )-> lock , flags );
0 commit comments