Skip to content

cold: add multiple __cold annotations#10866

Open
lyakh wants to merge 2 commits into
thesofproject:mainfrom
lyakh:cold
Open

cold: add multiple __cold annotations#10866
lyakh wants to merge 2 commits into
thesofproject:mainfrom
lyakh:cold

Conversation

@lyakh

@lyakh lyakh commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

make multiple initialisation functions, called from platform_init(), primary_core_init() and secondary_core_init() "cold"

Make idc_init_thread() and idc_init() cold, they are only invoked
during initialisation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 under CONFIG_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 kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The treewide commit seems a bit wildly scoped, please check inline comment.

Comment thread src/audio/mic_privacy_manager/mic_privacy_manager_intel.c
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants