Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] intel_adsp: ace: dynamic clock switching #8423

4 changes: 4 additions & 0 deletions src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,16 +536,20 @@ static int ipc_wait_for_compound_msg(void)
{
int try_count = 30;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we generalize this a bit? I guess this could be a Kconfig to "keep core clock high when responding to IPC".
The actual implementation will vary on different platforms, so ideally we'd have a Zephyr interface to communicate this constraints, but for the time being we might need glue code on SOF side (e.g. for Intel this is turned into pm_runtime call on CORE_HP_CLK).

I'm ok to also go with a TODO comment for now if there's no direct Zephyr interface yet.


pm_runtime_disable(CORE_HP_CLK, PLATFORM_PRIMARY_CORE_ID);
Copy link
Member

Choose a reason for hiding this comment

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

Is this still needed? Will this work correctly with KCPS which changes clock during IPC?

while (atomic_read(&msg_data.delayed_reply)) {
/* preventing clock switching in idle */
k_sleep(Z_TIMEOUT_US(250));

if (!try_count--) {
atomic_set(&msg_data.delayed_reply, 0);
ipc_cmd_err(&ipc_tr, "ipc4: failed to wait schedule thread");
pm_runtime_enable(CORE_HP_CLK, PLATFORM_PRIMARY_CORE_ID);
return IPC4_FAILURE;
}
}

pm_runtime_enable(CORE_HP_CLK, PLATFORM_PRIMARY_CORE_ID);
return IPC4_SUCCESS;
}

Expand Down