Skip to content

ipc: ipc4: helper: drop redundant locking in ipc4_search_for_drv()#10861

Open
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202606-ipc4-helper-remove-lock
Open

ipc: ipc4: helper: drop redundant locking in ipc4_search_for_drv()#10861
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202606-ipc4-helper-remove-lock

Conversation

@kv2019i

@kv2019i kv2019i commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Drop the IRQ disable/enable in ipc4_search_for_drv(). The driver list is only modified at FW boot and when a new driver is registered at runtime via SOF_IPC4_GLB_LOAD_LIBRARY IPC. ipc4_search_for_drv() is only used when processing IPC messages. As IPC processing is serialized, it is not possible for the driver list to be modified concurrently with a call to ipc4_search_for_drv().

Drop the IRQ disable/enable in ipc4_search_for_drv(). The driver
list is only modified at FW boot and when a new driver is registered
at runtime via SOF_IPC4_GLB_LOAD_LIBRARY IPC. ipc4_search_for_drv()
is only used when processing IPC messages. As IPC processing
is serialized, it is not possible for the driver list to be modified
concurrently with a call to ipc4_search_for_drv().

Signed-off-by: Kai Vehmanen <kai.vehmanen@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 removes the local IRQ disable/enable section from ipc4_search_for_drv() in the IPC4 helper, based on the assumption that IPC handling is serialized and cannot race with driver registration.

Changes:

  • Removed irq_local_disable() / irq_local_enable() and the associated flags variable from ipc4_search_for_drv().
  • Left UUID-based driver lookup otherwise unchanged.

Comment thread src/ipc/ipc4/helper.c
Comment on lines 1130 to 1134
struct comp_driver_list *drivers = comp_drivers_get();
struct list_item *clist;
const struct comp_driver *drv = NULL;
struct comp_driver_info *info;
uint32_t flags;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The old code did not protect against multicore case as it only disabled local interrupts. In any case, IPC processing is seriealized towards the host and even if IPC handling is on another core. So protection is simply not needed here access to drivers list is only triggered via IPC messages and IPC processing is serialized.

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.

4 participants