-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Remove custom Silicon Labs sleep management #5581
Remove custom Silicon Labs sleep management #5581
Conversation
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.
Looks good, I'm not 100% sure the locking is necessary as we lock the deep sleep in our driver layer. It also seem to conform with our new sleep HAL API https://github.com/ARMmbed/mbed-os/blob/feature-hal-spec-sleep/hal/sleep_api.h
+1 for addressing those issues. In the most cases in this patch, the changes in HAL could be removals. It should be functional either way. Is that correct? For instance i2c hal implementation does not need to touch deepsleep here, as I2C object does. Same could be applied to spi, pwmout, serial. |
@0xc0170 Yes, should be functional either way. I'm not sure what the preferred means is in mbed-OS, actually. Do you just always disable deepsleep when doing 'something', or do you leave it up to the driver to figure out whether the current operation is supported in deepsleep or not? Comes to mind:
Yes, I'm making a case for leaving it up to the driver, since it is the silicon vendor who should know best what is possible during deepsleep and what is not. |
Fair points. Only disabling deepsleep for drivers that require high speed freq clocks (very limited cases where it could potentially run, then question is what speed can be achieved, and other factors). The model was simplified. Therefore drivers like SPI, I2C, Serial lock deep sleep
I haven't seen this in the code, might have overlooked. Ane example, If serial object locks deepsleep while transferring data and waiting for interrupt, and in HAL there is a check if its LPUART, then it would in the idle loop enter deepsleep anyway? |
Here, for example: https://github.com/ARMmbed/mbed-os/pull/5581/files#diff-a61dbd2ee4b7dbd1c40906a404f3629bL2119 If the LEUART is ran off of the LF clock, and its baud rate is supported by the LF clock, then deepsleep is not blocked by the driver. |
/morph build |
Build : SUCCESSBuild number : 626 Triggering tests/morph test |
Test : SUCCESSBuild number : 448 |
Exporter Build : SUCCESSBuild number : 253 |
@0xc0170 do you think it makes sense to push the locking to HAL implementation rather than have it in driver? So we can leverage different HW capabilities? |
@stevew817 Can you please rebase, there is conflict now due to your earlier patches that got in yesterday
As it is , driver provides generic locking, HAL can extend it if it provides more granular selection, as we can see within this patch. |
Standardize on the mbed sleep manager by removing the sleepmodes API, and statically redirecting hal_sleep to EM1 and hal_deepsleep to EM2.
4a0b5b5
to
5dd4613
Compare
@0xc0170 Rebased. |
/morph build |
Build : ABORTEDBuild number : 639 |
@0xc0170 Can you restart CI? |
/morph build |
Build : SUCCESSBuild number : 646 Triggering tests/morph test |
Test : SUCCESSBuild number : 468 |
Exporter Build : SUCCESSBuild number : 285 |
Description
Standardize on the mbed sleep manager by removing the sleepmodes API, and statically redirecting hal_sleep to EM1 and hal_deepsleep to EM2. This should resolve #5423, #5005 and #4082.
@0xc0170 @bulislaw
Status
READY
Migrations
If users were calling blockSleepmode and unblockSleepmode: