-
Notifications
You must be signed in to change notification settings - Fork 349
tgl: enable WOVCRO clock #3418
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
tgl: enable WOVCRO clock #3418
Conversation
2ce0ae9 to
f6ffaaf
Compare
|
@abonislawski Thanks for enabling WOVCRO. My concern is that switching to WOVCRO everywhere we intent to switch to LPRO looks too aggressive to me, can we force this for WoV on S0Ix only, and make the WFI context low power clock configurable? e.g. we already have USE_LPRO_IN_WAITI, maybe we can add a new item (e.g. USE_WOVCRO_IN_WAITI) under it and unselect it by default? |
|
SOFCI TEST |
|
@keyonjie its not everywhere, its in WAITI only. but we can limit it to S0ix only if needed, any pros/cons? Anyway WOVCRO needs to be enabled by default for our releases |
Oh, then it's bad, how can we switch to WOVCRO then? The "pm_runtime_put(CORE_HP_CLK, cpu_get_id())" is invoked after the HPRO->WOVCRO switching? won't it switch to LPRO for WoV on S0Ix?
I am suggesting adding config items, to make it configurable. Please be noticed that the CONFIG_CAVS_USE_LPRO_IN_WAITI can be unslected so you might need to change the platform_clock_on_waiti() of the "#else" version also.
|
I need to investigate it because it looks like low_power_mode is a good place for WOVCRO switching. Power measurements gave great results so WOVCRO was working, need to check if this low_power_mode is working correctly then.
The CAVS approach is to use WOVCRO as lowest clock in WAITI stage because of power savings, so I think we should rename CONFIG_CAVS_USE_LPRO_IN_WAITI to something more universal for LPRO/WOVCRO and another layer for LPRO-or-WOVCRO switching is not necessary. |
|
This PR force us to upgrade our CI TGL RVP platforms to B0 stepping. At this point we are using A2 stepping platforms thus TGL smoke tests will FAIL. We plan to finish platform upgrade at the end of WW40. |
f6ffaaf to
de24eca
Compare
|
Updated PR with clock switching moved to "low_power_mode". Also added releasing clock for waiti switches, it will fix #3448 |
de24eca to
168cb74
Compare
|
@keyonjie good news for old steppings, added backward-compatible version (LPRO automatically selected) because it was reported to us that so many boards are still Ax :( |
|
@abonislawski can you check CI could be a server issue ? |
I think CI issue |
|
@abonislawski sorry, with this new WoVCRO clock introduced, the clock switching logic is becoming more complex and error-prone, we should be very careful when implement this, several items are not clear to me:
_waiti(): possible High -> Low switching, scenarios including: _wakeup(): possible Low -> High switching, scenarios including:
So in short let's make this more clear in one shot, to avoid possible mysterious errors happen in the future. |
src/include/sof/lib/clk.h
Outdated
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.
Ok, I'm reading the comments about things becoming more complex so I think we can simplify by adding an inline comment to each "idx" and "notification" member in this struct. This should start to make things simpler for all reviewers to follow.
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.
Should this index be a common parameter? Seems to be specific for cAVS platforms and left uninitialized/unused for others.
src/platform/intel/cavs/lib/clk.c
Outdated
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.
Can we add another comment here explaining the new logic.
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.
ping
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.
This comment was only about delay which isnt important for us, the remaining logic is pretty simple just as 'if' in code, if clock > LPRO then change to LPRO
|
@abonislawski ping for update. |
168cb74 to
7b6fb2b
Compare
|
PR updated and rebased. |
lgirdwood
left a comment
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've lost some context by removing a comment, we should really change the comment to match the new logic.
src/platform/intel/cavs/lib/clk.c
Outdated
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.
ping
|
Travis looks like a CI timeout unrelated to this PR. |
|
@abonislawski we should add a kconfig item to enable using this WOVCRO (e.g. disable it by default), then on most platforms where no WoV feature is needed, we use LPRO. |
|
Marked as WIP, will add and squash changes from tgl011 when done |
|
@abonislawski time to proceed and get this merged to master now, feel free to squash changes I made on the 011 release branch. |
|
@abonislawski ping. |
|
@abonislawski @keyonjie any updates - I assume the CI is OK ? |
|
@lgirdwood I will update this as soon as tgl-011 issues are fixed |
|
@abonislawski thanks - this is v1.7 blocker now. I will rerun CI to make sure everything looks good with recent updates. |
|
SOFCI TEST |
e2752f8 to
e6e13ad
Compare
|
@lgirdwood PR updated |
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.
LGTM, but I'm not an expert on the WOVCRO. @keyonjie @mwasko @mmaka1 any comments ?
@abonislawski I assume this is same version used on production ?
|
@lgirdwood yes, wovcro is already on tgl-010 and 011 releases, in 011 it was limited to s0ix only and this PR is updated with this change |
|
@abonislawski can you help to squash and add my commit dfdfa6b? |
|
@keyonjie it is already done with limiting wovcro to s0ix, this is only a few lines of code so you can easily compare that it will work exactly the same. |
|
@abonislawski @keyonjie let me know when good to merge. |
keyonjie
left a comment
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.
@abonislawski yes, functional exactly same with 011 base, can you change the naming 'waiti_freq_idx' to avoid confusion, others looks good to me.
src/include/sof/lib/clk.h
Outdated
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.
@abonislawski better to change the naming to e.g. lowest_freq_idx to avoid confusion, as we actually use LPRO for the waiti context.
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.
@keyonjie updated with lowest_freq_idx
It will allow to define cpu lowest clock per platform instead of fixed one (LPRO) Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
This patch will release previous clock in low power mode because there are some rare problems with not releasing it Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
This will allow to save significant amount of SOC power in low power S0ix WoV Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
e6e13ad to
56ad96d
Compare
keyonjie
left a comment
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 now, thanks.
First patch will introduce CPU_WAITI_FREQ_IDX so a specific clock for WAITI can be configured per platform.
Second patch added releasing clock for waiti switches, it will fix #3448
Last patch will enable WOVCRO for TGL and allow to save significant amount of SOC power in low power S0ix WoV.
Patch is backward-compatible, if WOVCRO is not available (some old TGL steppings) then LPRO will be used for WAITI