-
Notifications
You must be signed in to change notification settings - Fork 10
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
CFSPDK-1274: Added a wrapper to individually disable devices, then enter system suspend #158
base: main
Are you sure you want to change the base?
Conversation
…spend Signed-off-by: YHusain1 <[email protected]>
const struct device *tmo_dev_list[] = {DEVICE_DT_GET(DT_NODELABEL(rs9116w)), | ||
DEVICE_DT_GET(DT_NODELABEL(sonycxd5605)), | ||
DEVICE_DT_GET(DT_NODELABEL(murata_1sc))}; | ||
|
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.
Consider moving the device list within the two_pm_sys_lp_wrapper() scope.
const struct device *dev = NULL; | ||
for (int i = 0; i < sizeof(tmo_dev_list) / sizeof(tmo_dev_list[0]); i++) { | ||
dev = tmo_dev_list[i]; | ||
pm_device_action_run(dev, PM_DEVICE_ACTION_SUSPEND); |
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.
We should check the exit status of calls to the power management functions--and respond accordingly.
led_off(dev, 0); | ||
led_off(dev, 1); | ||
led_off(dev, 2); | ||
led_off(dev, 3); |
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.
Rather than the hard-coded values, let's include the board.h file and use the macros defined therein.
Before this commit,
When issuing the
tmo sys_pm suspend
or thetmo sys_pm standby
, the system becomes completely unresponsive due to the murata and wifi driver's expecting an interruptible context during issuing their corresponding device specific low power commands to the chip, however the system is in an non-blockable state before entering the Zephyr's sys_pmpm_system_suspend
function.After this commit,
We implement a workaround that is a wrapper function which individually suspends the wifi, modem, gnss, gnss_pwr, LEDs devices and then make the rest of the system and remaining devices go to sleep.