Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions zephyr/lib/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,7 @@ void cpu_disable_core(int id)
}
#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;
}
pm_state_force(id, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});
Copy link
Contributor

Choose a reason for hiding this comment

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

If I remember correctly, at the time it was written, it was possible to receive false. But currently, that possibility no longer exists; the function returns true even if the specified state cannot be set.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, but the function returns a "success status" supposedly. Should we add an assert in case the implementation changes? And in production builds it will be removed anyway

Copy link
Member

Choose a reason for hiding this comment

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

I think its wise keeping the check - its safe for future API changes, and its non time critical code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok ill close this PR. Anyway, I want to remove the call for pm_state_force() during disable and use sys_poweroff() instead.


/* Primary core will be turn off by the host after it enter SOFT_OFF state */
if (cpu_is_primary(id))
Expand Down
Loading