cold: add multiple __cold annotations#10866
Open
lyakh wants to merge 2 commits into
Open
Conversation
Make idc_init_thread() and idc_init() cold, they are only invoked during initialisation. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR annotates multiple initialization-time functions as __cold and adds assert_can_be_cold() guards to help ensure they’re only executed from appropriate (non-LL-thread) contexts, supporting the project’s cold-store/execute strategy and debug validation.
Changes:
- Mark a set of init/bring-up functions across DMA, schedulers, platform init, watchdog, notifier, agent, IDC, telemetry, AMS, and mic privacy as
__cold. - Add
assert_can_be_cold()at the top of these functions to validate “cold-path only” usage (especially underCONFIG_COLD_STORE_EXECUTE_DEBUG). - Add
<sof/lib/memory.h>includes where needed for__cold/assert_can_be_cold().
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| zephyr/lib/dma.c | Marks dmac_init() as cold and asserts cold-path entry. |
| zephyr/edf_schedule.c | Marks scheduler_init_edf() as cold, adds cold-path assertion, includes memory helpers. |
| src/schedule/zephyr_twb_schedule.c | Marks scheduler_twb_init() as cold, adds cold-path assertion, includes memory helpers. |
| src/schedule/zephyr_ll.c | Marks zephyr_ll_scheduler_init() as cold, adds cold-path assertion, includes memory helpers. |
| src/schedule/zephyr_dp_schedule.c | Marks scheduler_dp_init() as cold, adds cold-path assertion, includes memory helpers. |
| src/platform/intel/ace/platform.c | Adds cold-path assertions to already-cold platform_boot_complete() and platform_init(). |
| src/platform/intel/ace/lib/watchdog.c | Marks watchdog_init() as cold, adds cold-path assertion, includes memory helpers. |
| src/lib/notifier.c | Marks init_system_notify() as cold and adds cold-path assertion. |
| src/lib/ams.c | Marks ams_init() as cold and adds cold-path assertion. |
| src/lib/agent.c | Marks sa_init() as cold and adds cold-path assertion. |
| src/init/init.c | Adds cold-path assertions to cold init helpers (secondary_core_init(), banner printing, primary init). |
| src/idc/zephyr_idc.c | Marks idc_init_thread() as cold and adds cold-path assertion. |
| src/idc/idc.c | Marks idc_init() as cold and adds cold-path assertion, includes memory helpers. |
| src/debug/telemetry/performance_monitor.c | Marks io_perf_monitor_init() as cold, adds cold-path assertion, includes memory helpers. |
| src/audio/mic_privacy_manager/mic_privacy_manager_intel.c | Marks mic_privacy_manager_init() as cold, adds cold-path assertion, includes memory helpers. |
kv2019i
requested changes
Jun 10, 2026
kv2019i
left a comment
Collaborator
There was a problem hiding this comment.
The treewide commit seems a bit wildly scoped, please check inline comment.
Mark more functions, called only from platform_init(), primary_core_init() and secondary_core_init(), as "cold." Those functions themselves are "cold," so this change is safe. Add memory.h and the cold-safety assertion where missing. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
kv2019i
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make multiple initialisation functions, called from
platform_init(),primary_core_init()andsecondary_core_init()"cold"