Skip to content

[TGL]: S0i3 is blocked by AUDIO PLL being ON #2936

Closed

Description

@sathya-nujella

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

  1. 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
  2. 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

Impact
Power

Environment
TGL with V0.4/V0.5 release.

More debug details:

  1. RTD3 seems good:
    cat /sys/bus/pci/devices/0000:00:1f.3/power/runtime_enabled
    enabled
    cat /sys/bus/pci/devices/0000:00:1f.3/power/runtime_status
    suspended

[ 24.180280] snd_sof_runtime_suspend
[ 24.180299] sof-audio-pci 0000:00:1f.3: ipc tx: 0x40010000
[ 24.180508] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x40010000
[ 24.180626] sof-audio-pci 0000:00:1f.3: FW Poll Status: reg=0x1010f0f successful
[ 24.180641] sof-audio-pci 0000:00:1f.3: FW Poll Status: reg=0x1000f0f successful
[ 24.180647] sof-audio-pci 0000:00:1f.3: DSP core(s) enabled? 0 : core_mask 1
[ 24.180753] sof-audio-pci 0000:00:1f.3: Debug PCIR: 00000000 at 00000044
[ 24.180771] sof-audio-pci 0000:00:1f.3: Debug PCIW: 00000010 at 00000044
[ 24.180787] sof-audio-pci 0000:00:1f.3: Turning i915 HDAC power 0
[ 24.180790] sof-audio-pci 0000:00:1f.3: Current DSP power state: D3

  1. 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]

Activity

  1. added
    bugSomething isn't working as expected
    TGLApplies to Tiger Lake
    on May 14, 2020
  2. added
    P1Blocker bugs or important features
    S0ixIssues related to S0ix
    on May 15, 2020
  3. keyonjie commented on May 18, 2020

    @keyonjie
    Contributor

    @sathya-nujella so do you mean that s0ix residencies don't get increased even no any audio is run?

  4. sathya-nujella commented on May 18, 2020

    @sathya-nujella
    ContributorAuthor

    @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.

  5. keyonjie commented on May 19, 2020

    @keyonjie
    Contributor

    OK, Thanks for the details @sathya-nujella

    BTW, we do need the Chrome environment to duplicate and debug the issue.

  6. sathya-nujella commented on May 20, 2020

    @sathya-nujella
    ContributorAuthor

    OK, Thanks for the details @sathya-nujella

    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.

  7. jajanusz commented on May 21, 2020

    @jajanusz
    Contributor

    Which MCLK/BCLK do you use? Does issue happen when you use only XTAL for these clocks (NO PLL at all) ?

  8. jajanusz commented on May 21, 2020

    @jajanusz
    Contributor

    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.

  9. ranj063 commented on May 21, 2020

    @ranj063
    Collaborator

    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.

  10. jajanusz commented on May 21, 2020

    @jajanusz
    Contributor

    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.

  11. sathya-nujella commented on May 22, 2020

    @sathya-nujella
    ContributorAuthor
  12. sathya-nujella commented on May 25, 2020

    @sathya-nujella
    ContributorAuthor

    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..

  13. 11 remaining items

  14. sathya-nujella commented on Jun 11, 2020

    @sathya-nujella
    ContributorAuthor

    @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?

  15. sathya-nujella commented on Jun 11, 2020

    @sathya-nujella
    ContributorAuthor

    @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

  16. keyonjie commented on Jun 12, 2020

    @keyonjie
    Contributor

    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 ?

  17. jajanusz commented on Jun 15, 2020

    @jajanusz
    Contributor

    @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.

  18. jajanusz commented on Jun 15, 2020

    @jajanusz
    Contributor

    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?

  19. keyonjie commented on Jun 15, 2020

    @keyonjie
    Contributor

    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.

  20. sathya-nujella commented on Jun 15, 2020

    @sathya-nujella
    ContributorAuthor

    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

  21. mrajwa commented on Jun 16, 2020

    @mrajwa
    Contributor

    @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.

  22. keyonjie commented on Jun 24, 2020

    @keyonjie
    Contributor

    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?

  23. sathya-nujella commented on Jun 24, 2020

    @sathya-nujella
    ContributorAuthor

    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?

    sure, thanks!

  24. keyonjie commented on Jul 20, 2020

    @keyonjie
    Contributor

    Hi @sathya-nujella since thesofproject/linux#2276 is merged, can you please check and close this issue here?

  25. sathya-nujella commented on Jul 20, 2020

    @sathya-nujella
    ContributorAuthor

    Hi @sathya-nujella since thesofproject/linux#2276 is merged, can you please check and close this issue here?

    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!

  26. keyonjie commented on Jul 21, 2020

    @keyonjie
    Contributor

    Hi @sathya-nujella since thesofproject/linux#2276 is merged, can you please check and close this issue here?

    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!

  27. added
    PMCIssues related to PMC (Power Management Controller)
    on Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1Blocker bugs or important featuresPMCIssues related to PMC (Power Management Controller)S0ixIssues related to S0ixTGLApplies to Tiger LakebugSomething isn't working as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions