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

CFSPDK-1274: Added a wrapper to individually disable devices, then enter system suspend #158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

YHusain1
Copy link
Contributor

@YHusain1 YHusain1 commented May 5, 2023

Before this commit,
When issuing the tmo sys_pm suspend or the tmo 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_pm pm_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.

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))};

Copy link
Contributor

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);
Copy link
Contributor

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.

Comment on lines +35 to +38
led_off(dev, 0);
led_off(dev, 1);
led_off(dev, 2);
led_off(dev, 3);
Copy link
Contributor

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.

@YHusain1 YHusain1 changed the title Added a wrapper to individually disable devices, then enter system suspend CFSPDK-1274: Added a wrapper to individually disable devices, then enter system suspend May 18, 2023
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.

2 participants