diff --git a/src/audio/copier/copier.c b/src/audio/copier/copier.c index 2375b540b493..ae7e9852b4d1 100644 --- a/src/audio/copier/copier.c +++ b/src/audio/copier/copier.c @@ -108,7 +108,7 @@ static int mic_privacy_configure(struct processing_module *mod, struct copier_da cd->mic_priv = mic_priv_data; ret = notifier_register(cd->mic_priv, NULL, NOTIFIER_ID_MIC_PRIVACY_STATE_CHANGE, - mic_privacy_event, 0); + mic_privacy_event); if (ret != 0) mod_free(mod, mic_priv_data); diff --git a/src/audio/copier/copier_dai.c b/src/audio/copier/copier_dai.c index 0e54c0c7a9e5..321d22654b40 100644 --- a/src/audio/copier/copier_dai.c +++ b/src/audio/copier/copier_dai.c @@ -415,13 +415,21 @@ __cold void copier_dai_free(struct processing_module *mod) assert_can_be_cold(); for (int i = 0; i < cd->endpoint_num; i++) { - dai_common_free(cd->dd[i]); - mod_free(mod, cd->dd[i]->gain_data); - mod_free(mod, cd->dd[i]); + if (cd->dd[i]) { + if (cd->dd[i]->gain_data) { + mod_free(mod, cd->dd[i]->gain_data); + cd->dd[i]->gain_data = NULL; + } + dai_common_free(cd->dd[i]); + mod_free(mod, cd->dd[i]); + cd->dd[i] = NULL; + } } /* only dai have multi endpoint case */ - if (cd->multi_endpoint_buffer) + if (cd->multi_endpoint_buffer) { buffer_free(cd->multi_endpoint_buffer); + cd->multi_endpoint_buffer = NULL; + } } int copier_dai_prepare(struct comp_dev *dev, struct copier_data *cd) diff --git a/src/audio/dai-legacy.c b/src/audio/dai-legacy.c index 49fb8e011ffd..73f8704de36c 100644 --- a/src/audio/dai-legacy.c +++ b/src/audio/dai-legacy.c @@ -79,8 +79,7 @@ int dai_assign_group(struct dai_data *dd, struct comp_dev *dev, uint32_t group_i group_id, dd->group->num_dais); /* Register for the atomic trigger event */ - notifier_register(dev, dd->group, NOTIFIER_ID_DAI_TRIGGER, - dai_atomic_trigger, 0); + notifier_register(dev, dd->group, NOTIFIER_ID_DAI_TRIGGER, dai_atomic_trigger); return 0; } @@ -635,8 +634,7 @@ int dai_common_config_prepare(struct dai_data *dd, struct comp_dev *dev) dd->chan->index); /* setup callback */ - notifier_register(dev, dd->chan, NOTIFIER_ID_DMA_COPY, - dai_dma_cb, 0); + notifier_register(dev, dd->chan, NOTIFIER_ID_DMA_COPY, dai_dma_cb); return 0; } diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index 9f4e5dc57295..c86d57cdb77f 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -103,8 +103,7 @@ __cold int dai_assign_group(struct dai_data *dd, struct comp_dev *dev, uint32_t group_id, dd->group->num_dais); /* Register for the atomic trigger event */ - notifier_register(dev, dd->group, NOTIFIER_ID_DAI_TRIGGER, - dai_atomic_trigger, 0); + notifier_register(dev, dd->group, NOTIFIER_ID_DAI_TRIGGER, dai_atomic_trigger); return 0; } @@ -682,25 +681,40 @@ __cold void dai_common_free(struct dai_data *dd) { assert_can_be_cold(); + if (!dd) + return; + #ifdef CONFIG_SOF_TELEMETRY_IO_PERFORMANCE_MEASUREMENTS io_perf_monitor_release_slot(dd->io_perf_dai_byte_count); #endif - if (dd->group) + if (dd->group) { dai_group_put(dd->group); + dd->group = NULL; + } if (dd->chan_index >= 0) { - sof_dma_release_channel(dd->dma, dd->chan_index); + if (dd->dma) + sof_dma_release_channel(dd->dma, dd->chan_index); dd->chan_index = -EINVAL; } - sof_dma_put(dd->dma); + if (dd->dma) { + sof_dma_put(dd->dma); + dd->dma = NULL; + } dai_release_llp_slot(dd); - dai_put(dd->dai); + if (dd->dai) { + dai_put(dd->dai); + dd->dai = NULL; + } - sof_heap_free(dd->alloc_ctx.heap, dd->dai_spec_config); + if (dd->dai_spec_config) { + sof_heap_free(dd->alloc_ctx.heap, dd->dai_spec_config); + dd->dai_spec_config = NULL; + } } __cold static void dai_free(struct comp_dev *dev) @@ -709,6 +723,11 @@ __cold static void dai_free(struct comp_dev *dev) assert_can_be_cold(); + if (!dd) { + comp_free_device(dev); + return; + } + if (dd->group) notifier_unregister(dev, dd->group, NOTIFIER_ID_DAI_TRIGGER); diff --git a/src/audio/host-legacy.c b/src/audio/host-legacy.c index 591b5438f256..d3882931780c 100644 --- a/src/audio/host-legacy.c +++ b/src/audio/host-legacy.c @@ -876,8 +876,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, if (err >= 0) /* set up callback */ - notifier_register(dev, hd->chan, NOTIFIER_ID_DMA_COPY, - cb ? : host_dma_cb, 0); + notifier_register(dev, hd->chan, NOTIFIER_ID_DMA_COPY, cb ? : host_dma_cb); return err; } diff --git a/src/audio/host-zephyr.c b/src/audio/host-zephyr.c index 5038bcc78320..a46ee5e44485 100644 --- a/src/audio/host-zephyr.c +++ b/src/audio/host-zephyr.c @@ -388,7 +388,7 @@ static int host_get_status(struct comp_dev *dev, struct host_data *hd, struct dm } /* Minimum time between 2 consecutive "no bytes to copy" messages in milliseconds */ -#define SOF_MIN_NO_BYTES_INTERVAL_MS 20 +#define SOF_MIN_NO_BYTES_INTERVAL_MS 1000 static inline bool host_handle_eos(struct host_data *hd, struct comp_dev *dev, uint32_t avail_samples) diff --git a/src/audio/kpb.c b/src/audio/kpb.c index 4e5049919baf..47a390780e71 100644 --- a/src/audio/kpb.c +++ b/src/audio/kpb.c @@ -877,7 +877,7 @@ static int kpb_prepare(struct comp_dev *dev) #else /* Register KPB for notification */ ret = notifier_register(dev, NULL, NOTIFIER_ID_KPB_CLIENT_EVT, - kpb_event_handler, 0); + kpb_event_handler); #endif /* CONFIG_AMS */ if (ret < 0) { diff --git a/src/audio/pipeline/pipeline-params.c b/src/audio/pipeline/pipeline-params.c index ed32fc9e3b02..9c276d26fa65 100644 --- a/src/audio/pipeline/pipeline-params.c +++ b/src/audio/pipeline/pipeline-params.c @@ -283,8 +283,13 @@ static int pipeline_comp_prepare(struct comp_dev *current, } err = comp_prepare(current); - if (err < 0 || err == PPL_STATUS_PATH_STOP) + if (err < 0 || err == PPL_STATUS_PATH_STOP) { + if (err < 0) { + pipe_err(current->pipeline, "comp_prepare for comp 0x%x failed %d", + dev_comp_id(current), err); + } return err; + } return pipeline_for_each_comp(current, ctx, dir); } diff --git a/src/debug/debug_stream/debug_stream_text_msg.c b/src/debug/debug_stream/debug_stream_text_msg.c index f4b67d4d307a..17d3b82d2d37 100644 --- a/src/debug/debug_stream/debug_stream_text_msg.c +++ b/src/debug/debug_stream/debug_stream_text_msg.c @@ -10,6 +10,7 @@ #include #include #include +#include #include diff --git a/src/drivers/dw/dma.c b/src/drivers/dw/dma.c index 005980454798..ce90963ac714 100644 --- a/src/drivers/dw/dma.c +++ b/src/drivers/dw/dma.c @@ -205,7 +205,7 @@ static struct dma_chan_data *dw_dma_channel_get(struct dma *dma, atomic_add(&dma->num_channels_busy, 1); #if !CONFIG_DMA_HW_LLI notifier_register(&dma->chan[i], &dma->chan[i], - NOTIFIER_ID_DMA_IRQ, dw_dma_chan_reload_lli_cb, 0); + NOTIFIER_ID_DMA_IRQ, dw_dma_chan_reload_lli_cb); #endif /* return channel */ diff --git a/src/include/sof/lib/agent.h b/src/include/sof/lib/agent.h index 6e70a4ce997d..dcd007d6f841 100644 --- a/src/include/sof/lib/agent.h +++ b/src/include/sof/lib/agent.h @@ -42,6 +42,9 @@ static inline void sa_set_panic_on_delay(bool enabled) { struct sa *sa = sof_get()->sa; + if (!sa) + return; + if (enabled) atomic_add(&sa->panic_cnt, 1); else diff --git a/src/include/sof/lib/notifier.h b/src/include/sof/lib/notifier.h index f022b805144c..c6b33ae46a97 100644 --- a/src/include/sof/lib/notifier.h +++ b/src/include/sof/lib/notifier.h @@ -19,9 +19,6 @@ #define NOTIFIER_TARGET_CORE_LOCAL NOTIFIER_TARGET_CORE_MASK(cpu_get_id()) #define NOTIFIER_TARGET_CORE_ALL_MASK 0xFFFFFFFF -/** \brief Notifier flags. */ -#define NOTIFIER_FLAG_AGGREGATE BIT(0) - enum notify_id { NOTIFIER_ID_CPU_FREQ = 0, /* struct clock_notify_data * */ NOTIFIER_ID_SSP_FREQ, /* struct clock_notify_data * */ @@ -71,10 +68,9 @@ typedef void (*notifier_callback_t)(void *receiver_data, enum notify_id event_ty * some specific notifier_event() calls when not NULL. * @param event_type list of callbacks to be added to * @param callback callback function - * @param flags see NOTIFIER_FLAG_* above */ int notifier_register(void *receiver_data, void *caller_id_filter, enum notify_id event_type, - notifier_callback_t callback, uint32_t flags); + notifier_callback_t callback); /** Unregister all callbacks matching that arguments tuple. NULL acts * as a wildcard. diff --git a/src/lib/dai.c b/src/lib/dai.c index 68163282adc1..0185bc6d435e 100644 --- a/src/lib/dai.c +++ b/src/lib/dai.c @@ -375,6 +375,9 @@ void dai_put(struct dai *dai) int ret; struct k_heap *heap = NULL; + if (!dai) + return; + #ifdef CONFIG_SOF_USERSPACE_LL heap = zephyr_ll_user_heap(); #endif @@ -443,6 +446,9 @@ void dai_put(struct dai *dai) int ret; k_spinlock_key_t key; + if (!dai) + return; + key = k_spin_lock(&dai->lock); if (--dai->sref == 0) { ret = dai_remove(dai); diff --git a/src/lib/dma.c b/src/lib/dma.c index 6500e7557483..78a9a6d327b8 100644 --- a/src/lib/dma.c +++ b/src/lib/dma.c @@ -133,6 +133,9 @@ void z_impl_sof_dma_put(struct sof_dma *dma) { k_spinlock_key_t key; + if (!dma) + return; + key = k_spin_lock(&dma->lock); if (--dma->sref == 0) { sof_heap_free(dma->heap, dma->chan); diff --git a/src/lib/notifier.c b/src/lib/notifier.c index 20770bd828a2..cd18a84c482f 100644 --- a/src/lib/notifier.c +++ b/src/lib/notifier.c @@ -37,8 +37,7 @@ struct callback_handle { }; int notifier_register(void *receiver, void *caller, enum notify_id type, - void (*cb)(void *arg, enum notify_id type, void *data), - uint32_t flags) + void (*cb)(void *arg, enum notify_id type, void *data)) { struct notify *notify = *arch_notify_get(); struct callback_handle *handle; @@ -49,18 +48,7 @@ int notifier_register(void *receiver, void *caller, enum notify_id type, key = k_spin_lock(¬ify->lock); - /* Find already registered event of this type */ - if (flags & NOTIFIER_FLAG_AGGREGATE && - !list_is_empty(¬ify->list[type])) { - handle = container_of((¬ify->list[type])->next, - struct callback_handle, list); - handle->num_registrations++; - - goto out; - } - - handle = rzalloc(SOF_MEM_FLAG_USER, - sizeof(*handle)); + handle = rzalloc(SOF_MEM_FLAG_USER, sizeof(*handle)); if (!handle) { tr_err(&nt_tr, "callback handle allocation failed."); diff --git a/src/platform/intel/cavs/platform.c b/src/platform/intel/cavs/platform.c index 8a1a7c59c3b5..4c386ac7a55c 100644 --- a/src/platform/intel/cavs/platform.c +++ b/src/platform/intel/cavs/platform.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -122,6 +123,12 @@ int platform_init(struct sof *sof) sof->platform_timer_domain = timer_domain_init(sof->platform_timer, 0); scheduler_init_ll(sof->platform_timer_domain); +#if CONFIG_ZEPHYR_DP_SCHEDULER + ret = scheduler_dp_init(); + if (ret < 0) + return ret; +#endif + /* init the system agent */ trace_point(TRACE_BOOT_PLATFORM_AGENT); sa_init(sof, CONFIG_SYSTICK_PERIOD); diff --git a/src/schedule/dma_single_chan_domain.c b/src/schedule/dma_single_chan_domain.c index d234c473586a..a2a5d5bdb059 100644 --- a/src/schedule/dma_single_chan_domain.c +++ b/src/schedule/dma_single_chan_domain.c @@ -246,8 +246,7 @@ static int dma_single_chan_domain_register(struct ll_schedule_domain *domain, /* register for source change notifications */ if (register_needed) - notifier_register(domain, NULL, NOTIFIER_ID_DMA_DOMAIN_CHANGE, - dma_domain_changed, 0); + notifier_register(domain, NULL, NOTIFIER_ID_DMA_DOMAIN_CHANGE, dma_domain_changed); dma_domain->owner = channel->core; diff --git a/src/schedule/ll_schedule_xtos.c b/src/schedule/ll_schedule_xtos.c index 704a680e144d..cf16c87e14e5 100644 --- a/src/schedule/ll_schedule_xtos.c +++ b/src/schedule/ll_schedule_xtos.c @@ -795,8 +795,7 @@ int scheduler_init_ll(struct ll_schedule_domain *domain) sch->domain = domain; /* notification of clock changes */ - notifier_register(sch, NULL, NOTIFIER_CLK_CHANGE_ID(domain->clk), - ll_scheduler_notify, 0); + notifier_register(sch, NULL, NOTIFIER_CLK_CHANGE_ID(domain->clk), ll_scheduler_notify); scheduler_init(domain->type, &schedule_ll_ops, sch); diff --git a/src/schedule/zephyr_dp_schedule.c b/src/schedule/zephyr_dp_schedule.c index faa9d603c153..0bcc8e45fed2 100644 --- a/src/schedule/zephyr_dp_schedule.c +++ b/src/schedule/zephyr_dp_schedule.c @@ -35,7 +35,8 @@ SOF_DEFINE_REG_UUID(dp_sched); DECLARE_TR_CTX(dp_tr, SOF_UUID(dp_sched_uuid), LOG_LEVEL_INFO); -#define DP_LOCK_INIT(i, _) Z_SEM_INITIALIZER(dp_lock[i], 1, 1) +/* k_mutex, not k_sem: priority inheritance keeps a preempted DP holder from stalling LL */ +#define DP_LOCK_INIT(i, _) Z_MUTEX_INITIALIZER(dp_lock[i]) #define DP_LOCK_INIT_LIST LISTIFY(CONFIG_MP_MAX_NUM_CPUS, DP_LOCK_INIT, (,)) /* User threads don't need access to this array. Access is performed from @@ -43,7 +44,7 @@ DECLARE_TR_CTX(dp_tr, SOF_UUID(dp_sched_uuid), LOG_LEVEL_INFO); * to be qualified as initialized by the gen_kobject_list.py script. */ static -STRUCT_SECTION_ITERABLE_ARRAY(k_sem, dp_lock, CONFIG_MP_MAX_NUM_CPUS) = { DP_LOCK_INIT_LIST }; +STRUCT_SECTION_ITERABLE_ARRAY(k_mutex, dp_lock, CONFIG_MP_MAX_NUM_CPUS) = { DP_LOCK_INIT_LIST }; /* Each per-core instance of DP scheduler has separate structures; hence, locks are per-core. * @@ -51,13 +52,13 @@ STRUCT_SECTION_ITERABLE_ARRAY(k_sem, dp_lock, CONFIG_MP_MAX_NUM_CPUS) = { DP_LOC */ unsigned int scheduler_dp_lock(uint16_t core) { - k_sem_take(&dp_lock[core], K_FOREVER); + k_mutex_lock(&dp_lock[core], K_FOREVER); return core; } void scheduler_dp_unlock(unsigned int key) { - k_sem_give(&dp_lock[key]); + k_mutex_unlock(&dp_lock[key]); } void scheduler_dp_grant(k_tid_t thread_id, uint16_t core) diff --git a/test/cmocka/src/notifier_mocks.c b/test/cmocka/src/notifier_mocks.c index bfdb0d488ffe..b5a000fb2e40 100644 --- a/test/cmocka/src/notifier_mocks.c +++ b/test/cmocka/src/notifier_mocks.c @@ -50,7 +50,7 @@ void notifier_event(const void *caller, enum notify_id type, uint32_t core_mask, } int notifier_register(void *receiver, void *caller, enum notify_id type, - void (*cb)(void *arg, enum notify_id type, void *data), uint32_t flags) + void (*cb)(void *arg, enum notify_id type, void *data)) { struct notify *notify = *arch_notify_get(); struct callback_handle *handle; diff --git a/tools/sof_ri_info/sof_ri_info.py b/tools/sof_ri_info/sof_ri_info.py index 5fca3a42a3be..7999de11c177 100755 --- a/tools/sof_ri_info/sof_ri_info.py +++ b/tools/sof_ri_info/sof_ri_info.py @@ -639,6 +639,56 @@ 0x63, 0x04, 0xaf, 0x24, 0x45, 0x87, 0xf4, 0x96, 0x55, 0xd1, 0x7d, 0xc6, 0x0d, 0x79, 0x12, 0xa9]) +PTL_INTEL_DEBUG_KEY = bytes([ + 0x65, 0x24, 0xe8, 0x0a, 0x41, 0xc8, 0xed, 0xa2, + 0x92, 0x59, 0x20, 0x13, 0x3f, 0xcd, 0x11, 0x8b, + 0x7e, 0xdb, 0x8d, 0xf5, 0x69, 0xd9, 0x36, 0x2c, + 0x6c, 0x34, 0xba, 0xec, 0xce, 0x3e, 0xcb, 0xaa, + 0x52, 0x58, 0xef, 0x6b, 0x92, 0xe7, 0x8f, 0x8b, + 0x36, 0x8b, 0xa0, 0xc4, 0x61, 0x62, 0x13, 0x8c, + 0xcc, 0x2a, 0x75, 0xab, 0x59, 0xab, 0xf0, 0xf1, + 0x28, 0xd7, 0xdc, 0x42, 0xa8, 0xb1, 0xa0, 0x1f, + 0x95, 0x02, 0xaa, 0x30, 0x41, 0xe3, 0x9d, 0xf5, + 0x0c, 0x74, 0x3b, 0x72, 0x22, 0x98, 0x45, 0x50, + 0xec, 0x09, 0x04, 0x45, 0x22, 0x62, 0xc1, 0xce, + 0xb6, 0x4d, 0x1b, 0xac, 0xe2, 0xa2, 0xf1, 0x62, + 0x25, 0x60, 0xc0, 0x12, 0x08, 0x7a, 0x4e, 0x11, + 0x18, 0x81, 0xc8, 0xf6, 0xfa, 0xb0, 0x76, 0x7e, + 0xeb, 0x1c, 0xc3, 0x00, 0xf3, 0x1d, 0x5e, 0xc3, + 0x9c, 0x89, 0x74, 0xad, 0x17, 0xa8, 0x0a, 0x7e, + 0x33, 0xa4, 0x46, 0x1d, 0xcd, 0xac, 0xe2, 0xb2, + 0x34, 0xc2, 0x53, 0x03, 0x72, 0x18, 0x49, 0x22, + 0x9f, 0x51, 0xac, 0x65, 0x79, 0xf7, 0x02, 0x0f, + 0xea, 0xfd, 0x33, 0x5f, 0x3c, 0x7a, 0x0e, 0xd0, + 0x71, 0x85, 0x76, 0xcd, 0x7e, 0x3e, 0x85, 0xa4, + 0xc9, 0x88, 0x7d, 0xb8, 0x68, 0x00, 0xe1, 0x49, + 0xc4, 0x4f, 0xe7, 0xf4, 0x19, 0x1a, 0x88, 0xa2, + 0x89, 0xaa, 0xcc, 0xd6, 0xdd, 0x99, 0xfb, 0x54, + 0x89, 0x14, 0xe7, 0xc5, 0x4b, 0x43, 0x35, 0x50, + 0x77, 0xc8, 0xd6, 0x45, 0xd6, 0x09, 0xae, 0x31, + 0xa7, 0x30, 0x0b, 0xfa, 0xa5, 0x5d, 0xc0, 0x88, + 0x80, 0x50, 0xa5, 0x7f, 0x7c, 0xd7, 0xf6, 0x19, + 0x11, 0x49, 0xb1, 0x31, 0x6b, 0x23, 0x03, 0x82, + 0x6b, 0x42, 0x3a, 0x91, 0xd7, 0x86, 0x13, 0xa1, + 0xf0, 0x09, 0x95, 0xa4, 0xd1, 0xac, 0xd6, 0x3e, + 0xb3, 0x48, 0xe0, 0xc8, 0xdb, 0x4e, 0x91, 0xcb, + 0x1f, 0xd0, 0x5d, 0xec, 0x09, 0xb8, 0x5e, 0x8b, + 0xeb, 0x74, 0xf0, 0x2e, 0xa0, 0x98, 0x2c, 0x06, + 0x35, 0x85, 0xec, 0x6f, 0x8f, 0xfa, 0xb8, 0x0c, + 0x2a, 0x47, 0xc5, 0x4d, 0x15, 0xea, 0x7c, 0x04, + 0x96, 0x21, 0x41, 0x38, 0x1e, 0x3f, 0x7c, 0x96, + 0x61, 0x12, 0x5d, 0x50, 0x90, 0x18, 0x5e, 0xe6, + 0xd2, 0x30, 0x53, 0xdb, 0xc3, 0x0f, 0xef, 0x28, + 0xf6, 0x6f, 0xaf, 0x03, 0xc0, 0xca, 0x6b, 0x3b, + 0x4f, 0xa8, 0x82, 0xae, 0x4e, 0x0f, 0x9b, 0x08, + 0x8d, 0x8f, 0x43, 0xed, 0x48, 0x8e, 0xe6, 0xa1, + 0x7e, 0xb3, 0x2e, 0x37, 0x2e, 0x48, 0x95, 0xd4, + 0x1d, 0xa6, 0xfe, 0x22, 0x9f, 0x9a, 0x02, 0xa9, + 0xd9, 0xfc, 0x23, 0x71, 0x02, 0x48, 0x24, 0x6b, + 0xe7, 0xc1, 0x6c, 0x20, 0x9f, 0xdf, 0x8d, 0xc1, + 0x65, 0xe4, 0x34, 0xc3, 0x02, 0x33, 0x29, 0xe9, + 0x30, 0x32, 0xd1, 0x2f, 0xc4, 0xfd, 0x61, 0xca]) + KNOWN_KEYS = {APL_INTEL_PROD_KEY : 'APL Intel prod key', CNL_INTEL_PROD_KEY : 'CNL Intel prod key', ICL_INTEL_PROD_KEY : 'ICL Intel prod key', @@ -651,6 +701,7 @@ LNL_INTEL_PROD_KEY : 'LNL Intel prod key', ARL_S_INTEL_PROD_KEY : 'ARL-S Intel prod key', PTL_INTEL_PROD_KEY : 'PTL Intel prod key', + PTL_INTEL_DEBUG_KEY : 'PTL Intel debug key', COMMUNITY_KEY : 'Community key', COMMUNITY_KEY2 : 'Community 3k key'} diff --git a/zephyr/edf_schedule.c b/zephyr/edf_schedule.c index f00ad28b217a..c418b73e92e1 100644 --- a/zephyr/edf_schedule.c +++ b/zephyr/edf_schedule.c @@ -86,6 +86,7 @@ static int schedule_edf_task_running(void *data, struct task *task) static int schedule_edf_task_free(void *data, struct task *task) { + k_work_cancel_delayable(&task->z_delayed_work); task->state = SOF_TASK_STATE_FREE; task->ops.run = NULL; task->data = NULL;