You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[TGL]: S0i3 is blocked by AUDIO PLL being ON #2936
Describe the bug
On TGL DUT: DSP IP shows, it is in D3, but AUDIO PLL is ON. This is preventing DUT to enter S0i3.
To Reproduce
Flash S0ix enabled coreboot and EC on the Tiger Lake board with default DB (Max98357a + ALC5682I) -> Boot DUT -> run 'suspend_stress_test -c 1' which puts system to S0ix and wakes it
Check AUDIO PLL status when system is in suspend state
[Note: During this test, not running any audio tests]
Reproduction Rate
100%
Expected behavior
Audio should not block DUT entering S0i3
Output of LPM registers which shows the audio problem
Pasting only relevant Audio here: cat /sys/kernel/debug/pmc_core/substate_status_registers
a] AudioPLL_OFF_STS 0 <<<< [meaning of this bit: "1 means clock source is off"]
so this AUDIO PLL is ON
b] IP status
ADSP_D3_STS 1 [1 meaning ---> IP is in D3]
@sathya-nujella so do you mean that s0ix residencies don't get increased even no any audio is run?
I checked with my S0ix enabling team. Here are the details.
TGL supports different S0ix states: S0i2, S0i3 and other sub states like S0i2.1/S0i2.2/S0i3.1 etc.
If system is able to successfully enter S0i2, then Low Power Mode 0 Residency counter (LPM_0_RES = S0i2 residency counter) will be incremented.
Like wise, if system enters successfully S0i3 ==> LPM_3_RES/S0i3.0 residency counter will be increased.
Current status:
with no audio activity (no pb/cap streams.. just DUT is in idle and putting system to suspend state).
a. System is able to go to S0i2 ==> S0i2 Counters increased (i.e. LPM_0_RES counter increased).
b. System not able to enter S0i3. One of the blockers is Audio. Hence S0i3 counter not increased.
BTW, we do need the Chrome environment to duplicate and debug the issue.
We are checking on Chrome DUT as we are able to put it in to S0ix. Not sure on other OS's. On your system, can you please put DUT to run time D3.
Check if audio pll shows up as in step-3 of bug description. But, I don't know if that is right method for this problem to debug. Please check.
There is no code responsible in FW for powering PLL, we just select source for mclks/bclks (it's xtal by default), but maybe we should switch back to XTAL when PLL is no longer used, however I need to know if issue is still here if you use only XTAL.
There is no code responsible in FW for powering PLL, we just select source for mclks/bclks (it's xtal by default), but maybe we should switch back to XTAL when PLL is no longer used, however I need to know if issue is still here if you use only XTAL.
@jajanusz just to confirm, there is no active audio here. The DSP is in D3 but the audio PLL is still on.
There is no code responsible in FW for powering PLL, we just select source for mclks/bclks (it's xtal by default), but maybe we should switch back to XTAL when PLL is no longer used, however I need to know if issue is still here if you use only XTAL.
@jajanusz just to confirm, there is no active audio here. The DSP is in D3 but the audio PLL is still on.
I know, but if the last used topology (before puasing/stopping audio) used PLL it's still selected as mclk/bclk source (instead of xtal), I was trying to figure out if it can impact if it's powered on even if it's not actively used.
Tried this experiment, still audio PLL is ON:
"Built SOF fw with below two changes:
a) LPS - sof/pull/2951
b) LPRO :
Not sure if this is the right method to completly enable LPRO -- but sharing the result"
./src/arch/xtensa/configs/override/tigerlake_chrome.config
+CONFIG_CAVS_LPRO=y
./src/arch/xtensa/configs/tigerlake_defconfig
+CONFIG_CAVS_LPRO=y
"
Used this built SOF fw during the test..
It resets MN registers (that control MCLK/BCLK) when you free all SSPs.
Edit: changed commit to b8ea60dab0b6a331171cf20619ed862b2f894968
on 0_6 release, we can not apply this patch because in 0_6 release we don't have this new ssp driver changes.
So, I directly checked out to janusz branch: jajanusz/mn-free-mclk and built firmware.
I don't see this function mn_release_mclk() getting called in sof logs.
Not sure if I miss some thing?
@keyonjie@sathya-nujella
Can you try to cherry-pick this patch: jajanusz@b8ea60d
It resets MN registers (that control MCLK/BCLK) when you free all SSPs. Edit: changed commit to b8ea60dab0b6a331171cf20619ed862b2f894968
on 0_6 release, we can not apply this patch because in 0_6 release we don't have this new ssp driver changes.
So, I directly checked out to janusz branch: jajanusz/mn-free-mclk and built firmware.
I don't see this function mn_release_mclk() getting called in sof logs.
Not sure if I miss some thing?
cross checked again,
Audio PLL is ON
cat /sys/kernel/debug/pmc_core/substate_status_registers | grep LPM
LPM_STATUS_0: 0xf57c00f4
23rd bit: AUDIO_PLL off status: 0 <<indicating audio PLL is ON
cross checked again,
Audio PLL is ON
cat /sys/kernel/debug/pmc_core/substate_status_registers | grep LPM
LPM_STATUS_0: 0xf57c00f4
23rd bit: AUDIO_PLL off status: 0 <<indicating audio PLL is ON
@keyonjie@sathya-nujella
Do you know at which point PLL gets turned on in your case (by checking that bit)?
Is it already on after FW is loaded or after first SSP is configured/startedplaying/etc?
cross checked again,
Audio PLL is ON
cat /sys/kernel/debug/pmc_core/substate_status_registers | grep LPM
LPM_STATUS_0: 0xf57c00f4
23rd bit: AUDIO_PLL off status: 0 <<indicating audio PLL is ON
@keyonjie@sathya-nujella
Do you know at which point PLL gets turned on in your case (by checking that bit)?
Is it already on after FW is loaded or after first SSP is configured/startedplaying/etc?
It looks it is always on, even before the audio driver is loaded.
@sathya-nujella, we know that already. Some time ago I disabled our audio driver in the kernel and the audio PLL was still ON. That's why on the email thread I wrote we need to verify:
a. PMC testing screepts (are they properly aligned for TGL)? What they show is suspicious and contradicts our settings.
b. Coreboot - they may initialize something that is using this PLL
c. As for now we can enter s0i2.0 Only (with my kernel patch thesofproject/linux#2184). Now the blocker for the next level is not Audio PLL but Vnn voltage rail. And this again seems to be used by sth outside the Audio domain. Therefore I feel like we first should fix that issue. I feel like this audio PLL is not a blocker.
Hi @sathya-nujella so looks we are good for this issue since we can already enter to s0i3.0, so let's wait for merge of thesofproject/linux#2184 and then close it?
Hi @sathya-nujella so looks we are good for this issue since we can already enter to s0i3.0, so let's wait for merge of thesofproject/linux#2184 and then close it?
Yes @keyonjie , I double confirmed with team. They have some internal WIP solution with which DUT can go to S0i3.
Audio PLL is not blocker to go to S0i3.
Also I submitted a patch to pmc driver: https://patchwork.kernel.org/patch/11624647/ fixing the bit-mapping naming. It is reviewed and accepted by PMC driver team.. waiting for it to merge in upstream. After that, will post to Google tree. Thanks!
Yes @keyonjie , I double confirmed with team. They have some internal WIP solution with which DUT can go to S0i3.
Audio PLL is not blocker to go to S0i3.
Also I submitted a patch to pmc driver: https://patchwork.kernel.org/patch/11624647/ fixing the bit-mapping naming. It is reviewed and accepted by PMC driver team.. waiting for it to merge in upstream. After that, will post to Google tree. Thanks!
It's very good to change the confusion naming in the PMC driver team, thanks a lot for doing that!
Activity
keyonjie commentedon May 18, 2020
@sathya-nujella so do you mean that s0ix residencies don't get increased even no any audio is run?
sathya-nujella commentedon May 18, 2020
I checked with my S0ix enabling team. Here are the details.
TGL supports different S0ix states: S0i2, S0i3 and other sub states like S0i2.1/S0i2.2/S0i3.1 etc.
If system is able to successfully enter S0i2, then Low Power Mode 0 Residency counter (LPM_0_RES = S0i2 residency counter) will be incremented.
Like wise, if system enters successfully S0i3 ==> LPM_3_RES/S0i3.0 residency counter will be increased.
Current status:
with no audio activity (no pb/cap streams.. just DUT is in idle and putting system to suspend state).
a. System is able to go to S0i2 ==> S0i2 Counters increased (i.e. LPM_0_RES counter increased).
b. System not able to enter S0i3. One of the blockers is Audio. Hence S0i3 counter not increased.
keyonjie commentedon May 19, 2020
OK, Thanks for the details @sathya-nujella
BTW, we do need the Chrome environment to duplicate and debug the issue.
sathya-nujella commentedon May 20, 2020
We are checking on Chrome DUT as we are able to put it in to S0ix. Not sure on other OS's. On your system, can you please put DUT to run time D3.
Check if audio pll shows up as in step-3 of bug description. But, I don't know if that is right method for this problem to debug. Please check.
jajanusz commentedon May 21, 2020
Which MCLK/BCLK do you use? Does issue happen when you use only XTAL for these clocks (NO PLL at all) ?
jajanusz commentedon May 21, 2020
There is no code responsible in FW for powering PLL, we just select source for mclks/bclks (it's xtal by default), but maybe we should switch back to XTAL when PLL is no longer used, however I need to know if issue is still here if you use only XTAL.
ranj063 commentedon May 21, 2020
@jajanusz just to confirm, there is no active audio here. The DSP is in D3 but the audio PLL is still on.
jajanusz commentedon May 21, 2020
I know, but if the last used topology (before puasing/stopping audio) used PLL it's still selected as mclk/bclk source (instead of xtal), I was trying to figure out if it can impact if it's powered on even if it's not actively used.
sathya-nujella commentedon May 22, 2020
@jajanusz
we are testing on a DUT which uses this tplg:
https://github.com/thesofproject/sof/blob/master/tools/topology/sof-tgl-max98357a-rt5682.m4
sathya-nujella commentedon May 25, 2020
Tried this experiment, still audio PLL is ON:
"Built SOF fw with below two changes:
a) LPS - sof/pull/2951
b) LPRO :
Not sure if this is the right method to completly enable LPRO -- but sharing the result"
./src/arch/xtensa/configs/override/tigerlake_chrome.config
+CONFIG_CAVS_LPRO=y
./src/arch/xtensa/configs/tigerlake_defconfig
+CONFIG_CAVS_LPRO=y
"
Used this built SOF fw during the test..
11 remaining items
sathya-nujella commentedon Jun 11, 2020
on 0_6 release, we can not apply this patch because in 0_6 release we don't have this new ssp driver changes.
So, I directly checked out to janusz branch: jajanusz/mn-free-mclk and built firmware.
I don't see this function mn_release_mclk() getting called in sof logs.
Not sure if I miss some thing?
sathya-nujella commentedon Jun 11, 2020
cross checked again,
Audio PLL is ON
cat /sys/kernel/debug/pmc_core/substate_status_registers | grep LPM
LPM_STATUS_0: 0xf57c00f4
23rd bit: AUDIO_PLL off status: 0 <<indicating audio PLL is ON
keyonjie commentedon Jun 12, 2020
Hi @jajanusz could you help to add a regular FW trace log to print out the clock power status, e.g. including CLKCTL, CLKSTS, PWRCTL and PWR_STS ?
jajanusz commentedon Jun 15, 2020
@keyonjie I can, but IMO it's wrong place to look, cos CLK* functions are for oscillators for CPU not for SSPs.
@sathya-nujella This function has no logs, but if you free'd all SSPs it should be called.
jajanusz commentedon Jun 15, 2020
@keyonjie @sathya-nujella
Do you know at which point PLL gets turned on in your case (by checking that bit)?
Is it already on after FW is loaded or after first SSP is configured/startedplaying/etc?
keyonjie commentedon Jun 15, 2020
It looks it is always on, even before the audio driver is loaded.
sathya-nujella commentedon Jun 15, 2020
Also one more experiment I did, FYI:
I removed all end like speaker/headphone/hdmi from tplg and kept only DMIC. I still see Audio PLL ON.
==
localhost ~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
localhost ~ # arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: sofrt5682 [sof-rt5682], device 99: DMIC (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
mrajwa commentedon Jun 16, 2020
@sathya-nujella, we know that already. Some time ago I disabled our audio driver in the kernel and the audio PLL was still ON. That's why on the email thread I wrote we need to verify:
a. PMC testing screepts (are they properly aligned for TGL)? What they show is suspicious and contradicts our settings.
b. Coreboot - they may initialize something that is using this PLL
c. As for now we can enter s0i2.0 Only (with my kernel patch thesofproject/linux#2184). Now the blocker for the next level is not Audio PLL but Vnn voltage rail. And this again seems to be used by sth outside the Audio domain. Therefore I feel like we first should fix that issue. I feel like this audio PLL is not a blocker.
keyonjie commentedon Jun 24, 2020
Hi @sathya-nujella so looks we are good for this issue since we can already enter to s0i3.0, so let's wait for merge of thesofproject/linux#2184 and then close it?
sathya-nujella commentedon Jun 24, 2020
sure, thanks!
keyonjie commentedon Jul 20, 2020
Hi @sathya-nujella since thesofproject/linux#2276 is merged, can you please check and close this issue here?
sathya-nujella commentedon Jul 20, 2020
Yes @keyonjie , I double confirmed with team. They have some internal WIP solution with which DUT can go to S0i3.
Audio PLL is not blocker to go to S0i3.
Also I submitted a patch to pmc driver: https://patchwork.kernel.org/patch/11624647/ fixing the bit-mapping naming. It is reviewed and accepted by PMC driver team.. waiting for it to merge in upstream. After that, will post to Google tree. Thanks!
keyonjie commentedon Jul 21, 2020
It's very good to change the confusion naming in the PMC driver team, thanks a lot for doing that!