-
Notifications
You must be signed in to change notification settings - Fork 349
[DNM]cpu: fix cpu_disable_core for primary core #10036
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -229,12 +229,11 @@ enum task_state ipc_platform_do_cmd(struct ipc *ipc) | |||||||||||||||
| if (ipc->task_mask & IPC_TASK_POWERDOWN || | ||||||||||||||||
| ipc_get()->pm_prepare_D3) { | ||||||||||||||||
| #if defined(CONFIG_PM) | ||||||||||||||||
| /** | ||||||||||||||||
| * @note For primary core this function | ||||||||||||||||
| * will only force set lower power state | ||||||||||||||||
| * in power management settings. | ||||||||||||||||
| * Core will enter D3 state after exit | ||||||||||||||||
| * IPC thread during idle. | ||||||||||||||||
| /* force device suspend */ | ||||||||||||||||
| ipc_device_suspend_handler(NULL, ipc); | ||||||||||||||||
|
||||||||||||||||
| ipc_device_suspend_handler(NULL, ipc); | |
| int ret = ipc_device_suspend_handler(NULL, ipc); | |
| if (ret < 0) { | |
| LOG_ERR("Device suspend failed with error: %d", ret); | |
| /* Handle error appropriately, e.g., abort further operations */ | |
| return SOF_TASK_STATE_ERROR; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ranj063 can we log here ?
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,6 +32,8 @@ static uint32_t mic_disable_status; | |||||||
| #include <zephyr/kernel/smp.h> | ||||||||
| #include <zephyr/device.h> | ||||||||
| #include <zephyr/drivers/mm/mm_drv_intel_adsp_mtl_tlb.h> | ||||||||
| #include <zephyr/sys/poweroff.h> | ||||||||
| #include <zephyr/sys/hibernate.h> | ||||||||
|
|
||||||||
| #if CONFIG_MULTICORE && CONFIG_SMP | ||||||||
|
|
||||||||
|
|
@@ -255,16 +257,29 @@ void cpu_disable_core(int id) | |||||||
| tr_warn(&zephyr_tr, "core %d is already disabled", id); | ||||||||
| return; | ||||||||
| } | ||||||||
|
|
||||||||
| #if defined(CONFIG_PM) | ||||||||
| /* TODO: before requesting core shut down check if it's not actively used */ | ||||||||
| if (!pm_state_force(id, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0})) { | ||||||||
| tr_err(&zephyr_tr, "failed to set PM_STATE_SOFT_OFF on core %d", id); | ||||||||
| return; | ||||||||
| } | ||||||||
|
|
||||||||
| /* Primary core will be turn off by the host after it enter SOFT_OFF state */ | ||||||||
| if (cpu_is_primary(id)) | ||||||||
| if (cpu_is_primary(id)) { | ||||||||
| cpu_notify_state_entry(PM_STATE_SOFT_OFF); | ||||||||
| #if defined(CONFIG_POWEROFF) | ||||||||
| /* Primary core will be turned off by the host. This does not return. */ | ||||||||
| sys_poweroff(); | ||||||||
|
||||||||
| sys_poweroff(); | |
| sys_poweroff(); | |
| __builtin_unreachable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ranj063 another good point.
Uh oh!
There was an error while loading. Please reload this page.