Skip to content

[CML] rtcwake: aplay task refusing to freeze #3370

Closed

Description

@marc-hb

Observed twice in a row: first on jf-cml-hel-rt5682-01 then on jf-cml-hel-rt5682-02

https://sof-ci.01.org/sofpr/PR5207/build11616/devicetest/?model=CML_HEL_RT5682&testcase=check-suspend-resume-with-playback-5
https://sof-ci.01.org/sofpr/PR5207/build11618/devicetest/?model=CML_HEL_RT5682&testcase=check-suspend-resume-with-playback-5
https://sof-ci.01.org/sofpr/PR5227/build11700/devicetest/?model=CML_HEL_RT5682&testcase=check-suspend-resume-with-playback-5
https://sof-ci.01.org/sofpr/PR5202/build11725/devicetest/?model=CML_HEL_RT5682&testcase=check-suspend-resume-with-playback-5

check-suspend-resume-with-capture-5.sh passed both times.

Similar issues: #2433 #2561

Start Time: 2022-01-14 02:20:28 UTC
End Time: 2022-01-14 02:56:57 UTC
Kernel Commit: ba28f9b
SOF Commit: 6b8b1ce

[ 1319.485729] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
[ 1319.485779] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
[ 1321.647110] kernel: ax88179_178a 2-2.3:1.0 enx000ec66a7f60: ax88179 - Link status is: 1
[ 1323.971977] kernel: PM: suspend entry (s2idle)
[ 1323.972443] kernel: Filesystems sync: 0.000 seconds
[ 1323.976168] kernel: Freezing user space processes ... 
[ 1343.985707] kernel: Freezing of tasks failed after 20.009 seconds (1 tasks refusing to freeze, wq_busy=0):
[ 1343.986049] kernel: task:aplay           state:D stack:12928 pid:23088 ppid: 23012 flags:0x00000004
[ 1343.986069] kernel: Call Trace:
[ 1343.986074] kernel:  
[ 1343.986084] kernel:  __schedule+0x2ac/0x850
[ 1343.986109] kernel:  schedule+0x49/0xc0
[ 1343.986120] kernel:  schedule_timeout+0x1d5/0x340
[ 1343.986130] kernel:  ? del_timer_sync+0x80/0x80
[ 1343.986155] kernel:  snd_power_ref_and_wait+0xba/0x110 [snd]
[ 1343.986182] kernel:  ? wake_up_q+0x80/0x80
[ 1343.986199] kernel:  snd_power_wait+0xd/0x50 [snd]
[ 1343.986222] kernel:  snd_pcm_common_ioctl+0x71/0x11c0 [snd_pcm]
[ 1343.986254] kernel:  ? selinux_file_ioctl+0x16f/0x210
[ 1343.986269] kernel:  ? lock_release+0x14b/0x3f0
[ 1343.986287] kernel:  snd_pcm_ioctl+0x1e/0x30 [snd_pcm]
[ 1343.986310] kernel:  __x64_sys_ioctl+0x7b/0xb0
[ 1343.986326] kernel:  do_syscall_64+0x38/0x90
[ 1343.986335] kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1343.986345] kernel: RIP: 0033:0x7fb3b1f1350b
[ 1343.986352] kernel: RSP: 002b:00007ffcd8781b38 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 1343.986362] kernel: RAX: ffffffffffffffda RBX: 000055aa695caef0 RCX: 00007fb3b1f1350b
[ 1343.986367] kernel: RDX: 00007ffcd8781b40 RSI: 0000000040184150 RDI: 0000000000000004
[ 1343.986372] kernel: RBP: 000055aa695cae70 R08: 0000000000000000 R09: 000055aa695cc120
[ 1343.986378] kernel: R10: 000055aa695b2010 R11: 0000000000000246 R12: 000055aa695cc100
[ 1343.986382] kernel: R13: 0000000000000010 R14: 0000000000000000 R15: 0000000000001000
[ 1343.986402] kernel:  
[ 1343.986411] kernel: 
[ 1343.986414] kernel: OOM killer enabled.
[ 1343.986417] kernel: Restarting tasks ... done.
[ 1343.994689] kernel: PM: suspend exit
[ 1343.999179] kernel: rfkill: input handler enabled
[ 1344.053935] kernel: rfkill: input handler disabled
[ 1345.375290] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc tx: 0x90040000: GLB_TRACE_MSG: FILTER_UPDATE
[ 1345.375536] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc tx succeeded: 0x90040000: GLB_TRACE_MSG: FILTER_UPDATE

Activity

  1. plbossart commented on Jan 14, 2022

    @plbossart
    Member

    also seen in https://sof-ci.01.org/linuxpr/PR3338/build6982/devicetest/?model=CML_HEL_RT5682&testcase=check-suspend-resume-with-playback-5

    this could be the result of an upstream merge. The call trace is new but in the past when we had rtcwake errors they seemed to be 100% correlated with this 'task refusing to freeze' issue.

  2. plbossart commented on Jan 14, 2022

    @plbossart
    Member

    yeah, this is not a new error, it's just that we can see it
    Commit 8412dbd ('PM / sleep: Show freezing tasks that caused a suspend abort') added more information.

    from the commit message it seems we have a task that is still freezing while we get a wake-up, a possible indication of a race condition.

    This is excellent that we can trap this instead of seeing rtcwake fail miserably.

  3. plbossart commented on Jan 17, 2022

    @plbossart
    Member

    If I look at the call trace above, it seems the 'aplay' userspace task
    initiates an ioctl while we are trying to freeze all tasks and suspend, and that ioctl will
    try to bring the card back in D0 state.

    that looks like a race condition to me, and I am not sure why a
    userspace task is permitted to do this.

    if I look at snd_power_ref_and_wait() it seems there's a possibility of
    an infinite loop where we never return anything. Going back to D0 state
    could take some time, typically hundreds of ms, so maybe this happens
    because we report an error freezing a task because a power-related task
    is in progress.

    @tiwai @perexg I could use your guidance on this. Not sure what is happening here.

  4. tiwai commented on Jan 18, 2022

    @tiwai

    Hrm, weird. It's the place where suspend_prepare() calling the freezer, right? If so, the card power state must not be other than D0 at that point, as it's before the actual device suspend procedure takes place. (For ASoC, soc_suspend() calls snd_power_change_state() with D3hot, and this should be called after the freezer.)

    The task flags (0x04) shows PF_EXITING, so this is a process being shut down, as it seems. But it still doesn't clarify why the loop for power D0 matters... We need to check whether it's really in that loop waiting for the power state D0 or not.

  5. tiwai commented on Jan 18, 2022

    @tiwai

    Does it have any influence if we replace wake_up(&card->power_sleep) with wake_up_all(&card->power_sleep) in snd_power_change_state() defined in include/sound/core.h?

  6. tiwai commented on Jan 18, 2022

    @tiwai
  7. plbossart commented on Jan 18, 2022

    @plbossart
    Member

    @tiwai I don't fully follow your explanations - suspend_prepare doesn't seem to be part of sound/ and not clear either on what ASoC does with D3hot. I clearly don't have any understanding of the freeze part.

    I added a simple check to trace when we start the loop to go back to D0, we'll see if this confirms the analysis. #3374

  8. tiwai commented on Jan 18, 2022

    @tiwai

    Yes, that'll be helpful for understanding the situation. Also, it'd be good to have debug prints at snd_power_change_state(), too.

  9. plbossart commented on Jan 18, 2022

    @plbossart
    Member

    it seems we have a 100% reproducible case on a Chromebook, see https://sof-ci.01.org/linuxpr/PR3374/build6987/devicetest/?model=CML_HEL_RT5682&testcase=check-suspend-resume-with-playback-5

    dmesg.log

    [ 1080.546679] kernel: Restarting tasks ... 
    [ 1080.549004] kernel: cml_rt1011_rt5682 cml_rt1011_rt5682: plb: snd_power_ref_and_wait: starting loop, power state 512
    [ 1080.555947] kernel: done.
    [ 1080.558166] kernel: PM: suspend exit
    [ 1080.560144] kernel: rfkill: input handler enabled
    [ 1080.576412] kernel: rfkill: input handler disabled
    [ 1080.593997] kernel: rt5682 i2c-10EC5682:00: div[0]=1
    [ 1080.594003] kernel: rt5682 i2c-10EC5682:00: div[1]=2
    [ 1081.040086] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1081.040123] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1081.540251] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1081.540293] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1085.770336] kernel: PM: suspend entry (s2idle)
    [ 1085.771523] kernel: Filesystems sync: 0.001 seconds
    [ 1085.773382] kernel: Freezing user space processes ... 
    [ 1105.774200] kernel: Freezing of tasks failed after 20.005 seconds (1 tasks refusing to freeze, wq_busy=0):
    [ 1105.774508] kernel: task:aplay           state:D stack:12928 pid:22896 ppid: 22820 flags:0x00000004
    [ 1105.774526] kernel: Call Trace:
    [ 1105.774530] kernel:  
    [ 1105.774540] kernel:  __schedule+0x2ac/0x850
    [ 1105.774562] kernel:  schedule+0x49/0xc0
    [ 1105.774572] kernel:  schedule_timeout+0x1d5/0x340
    [ 1105.774581] kernel:  ? del_timer_sync+0x80/0x80
    [ 1105.774604] kernel:  snd_power_ref_and_wait+0xdd/0x130 [snd]
    [ 1105.774626] kernel:  ? wake_up_q+0x80/0x80
    [ 1105.774641] kernel:  snd_power_wait+0xd/0x50 [snd]
    [ 1105.774663] kernel:  snd_pcm_common_ioctl+0x71/0x11c0 [snd_pcm]
    [ 1105.774691] kernel:  ? selinux_file_ioctl+0x16f/0x210
    [ 1105.774704] kernel:  ? lock_release+0x14b/0x3f0
    [ 1105.774721] kernel:  snd_pcm_ioctl+0x1e/0x30 [snd_pcm]
    [ 1105.774742] kernel:  __x64_sys_ioctl+0x7b/0xb0
    [ 1105.774756] kernel:  do_syscall_64+0x38/0x90
    [ 1105.774764] kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xae
    [ 1105.774773] kernel: RIP: 0033:0x7f873608b50b
    [ 1105.774780] kernel: RSP: 002b:00007fff07897bb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
    [ 1105.774788] kernel: RAX: ffffffffffffffda RBX: 0000559a3302bef0 RCX: 00007f873608b50b
    [ 1105.774793] kernel: RDX: 00007fff07897bc0 RSI: 0000000040184150 RDI: 0000000000000004
    [ 1105.774797] kernel: RBP: 0000559a3302be70 R08: 0000000000000000 R09: 0000559a3302d120
    [ 1105.774802] kernel: R10: 0000559a33013010 R11: 0000000000000246 R12: 0000559a3302d100
    [ 1105.774806] kernel: R13: 0000000000000010 R14: 0000000000000000 R15: 0000000000001000
    

    This looks like a sequence of suspend-resumes where we try to restore the D0 state when resuming but somehow never reach that state, and we suspend with an active thread?

  10. tiwai commented on Jan 18, 2022

    @tiwai

    ASoC does the resume in a deferred work, and that might be the reason?
    The work is synced at snd_soc_suspend(), but it's called after user process freezing, hence it's too late.

  11. plbossart commented on Jan 18, 2022

    @plbossart
    Member

    Thanks @tiwai. Would it change anything if we did the workqueue sync in a .prepare callback?

  12. tiwai commented on Jan 18, 2022

    @tiwai

    I guess this won't fit,the PM prepare callback is handled at a later stage, IIRC. But I might be wrong, better to test actually, of course.

    BTW, could you check whether the patch I attached in the above makes any difference?

  13. plbossart commented on Jan 18, 2022

    @plbossart
    Member

    I added the traces in snd_power_change_state, I don't really understand the results though

    https://sof-ci.01.org/linuxpr/PR3374/build6988/devicetest/?model=CML_HEL_RT5682&testcase=check-suspend-resume-with-playback-5

    [ 1076.188123] kernel: cml_rt1011_rt5682 cml_rt1011_rt5682: plb: snd_power_change_state: requesting state 512 in snd_power_change_state
    [ 1076.188130] kernel: cml_rt1011_rt5682 cml_rt1011_rt5682: plb: snd_power_change_state: waking up power_sleep in snd_power_change_state
    [ 1076.188133] kernel: cml_rt1011_rt5682 cml_rt1011_rt5682: plb: snd_power_change_state: done in snd_power_change_state
    [ 1076.189413] kernel: OOM killer enabled.
    [ 1076.189416] kernel: Restarting tasks ... 
    [ 1076.191592] kernel: cml_rt1011_rt5682 cml_rt1011_rt5682: plb: snd_power_ref_and_wait: starting loop, power state 512
    [ 1076.196926] kernel: done.
    [ 1076.207334] kernel: PM: suspend exit
    [ 1076.211122] kernel: rfkill: input handler enabled
    [ 1076.224852] kernel: rt5682 i2c-10EC5682:00: div[0]=1
    [ 1076.224859] kernel: rt5682 i2c-10EC5682:00: div[1]=2
    [ 1076.231123] kernel: rfkill: input handler disabled
    [ 1076.681421] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1076.681462] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1077.181638] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1077.181680] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1081.422331] kernel: PM: suspend entry (s2idle)
    [ 1081.422860] kernel: Filesystems sync: 0.000 seconds
    [ 1081.423863] kernel: Freezing user space processes ... 
    [ 1101.437333] kernel: Freezing of tasks failed after 20.007 seconds (1 tasks refusing to freeze, wq_busy=0):
    [ 1101.437674] kernel: task:aplay           state:D stack:12968 pid:22894 ppid: 22818 flags:0x00000004
    

    I will give it a try with the .prepare step. prepare is supposed to be before any suspend/freeze. I will test your patch later today.

  14. plbossart commented on Jan 19, 2022

    @plbossart
    Member

    @tiwai I added a .prepare and that's not helping.
    https://sof-ci.01.org/linuxpr/PR3374/build6991/devicetest/?model=CML_HEL_RT5682&testcase=check-suspend-resume-with-playback-5 shows we have exactly the same error before the .prepare is invoked.

    I'll try your patch now.

  15. plbossart commented on Jan 19, 2022

    @plbossart
    Member

    @tiwai unfortunately your patch doesn't seem to improve the results. It's the same issue that we wait for the device to go back to D0 and start a suspend before the resume is complete. You can see in 5001794 that there are two traces, and only the first is found below. the log to indicate the end of the wait is not coming out.

    [ 1083.637373] kernel: cml_rt1011_rt5682 cml_rt1011_rt5682: plb: snd_power_change_state: requesting state 512 in snd_power_change_state
    [ 1083.637380] kernel: cml_rt1011_rt5682 cml_rt1011_rt5682: plb: snd_power_change_state: waking up power_sleep in snd_power_change_state
    [ 1083.637384] kernel: cml_rt1011_rt5682 cml_rt1011_rt5682: plb: snd_power_change_state: done in snd_power_change_state
    [ 1083.638706] kernel: OOM killer enabled.
    [ 1083.638709] kernel: Restarting tasks ... 
    [ 1083.645772] kernel: cml_rt1011_rt5682 cml_rt1011_rt5682: plb: snd_power_ref_and_wait: starting wait, power state 512
    [ 1083.649936] kernel: done.
    [ 1083.657878] kernel: rfkill: input handler enabled
    [ 1083.662982] kernel: PM: suspend exit
    [ 1083.677169] kernel: rfkill: input handler disabled
    [ 1083.685855] kernel: rt5682 i2c-10EC5682:00: div[0]=1
    [ 1083.685860] kernel: rt5682 i2c-10EC5682:00: div[1]=2
    [ 1084.129376] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1084.129428] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1084.629345] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1084.629396] kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION
    [ 1088.871217] kernel: PM: suspend entry (s2idle)
    [ 1088.873518] kernel: Filesystems sync: 0.002 seconds
    [ 1088.875950] kernel: Freezing user space processes ... 
    [ 1108.879902] kernel: Freezing of tasks failed after 20.008 seconds (1 tasks refusing to freeze, wq_busy=0):
    [ 1108.880179] kernel: task:aplay           state:D stack:12968 pid:22895 ppid: 22819 flags:0x00000004
    [ 1108.880195] kernel: Call Trace:
    [ 1108.880199] kernel:  
    [ 1108.880208] kernel:  __schedule+0x2ac/0x850
    [ 1108.880229] kernel:  schedule+0x49/0xc0
    [ 1108.880242] kernel:  snd_power_ref_and_wait.cold+0xdb/0xe1 [snd]
    [ 1108.880266] kernel:  ? wait_woken+0x70/0x70
    [ 1108.880277] kernel:  snd_power_wait+0xd/0x50 [snd]
    [ 1108.880298] kernel:  snd_pcm_common_ioctl+0x71/0x11c0 [snd_pcm]
    [ 1108.880325] kernel:  ? selinux_file_ioctl+0x16f/0x210
    [ 1108.880338] kernel:  ? xfd_validate_state+0x18/0x70
    [ 1108.880354] kernel:  snd_pcm_ioctl+0x1e/0x30 [snd_pcm]
    
  16. 38 remaining items

  17. marc-hb commented on Feb 3, 2022

    @marc-hb
    CollaboratorAuthor

    I see that #3392 was merged on Jan 28 but with kernel 5.17.0-rc1-daily-default-20220202-0-13669-gbb45f689fa62 I found this DEBUG_LOCKS_WARN_ON(lock->magic != lock) by chance in the logs while looking for something else:

    Feb 03 05:37:33 jf-tglu-volt-sdw-01 /usr/lib/gdm3/gdm-x-session[624]: (II) xfree86: Adding drm device (/dev/dri/card0)
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 /usr/lib/gdm3/gdm-x-session[624]: (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 12 paused 0
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: warn: topology ABI is more recent than kernel
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: sof_sdw sof_sdw: ASoC: Parent card not yet available, widget card binding deferred
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 4
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 5
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 6
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 7
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 8
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: ------------[ cut here ]------------
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: DEBUG_LOCKS_WARN_ON(lock->magic != lock)
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: WARNING: CPU: 3 PID: 186 at kernel/locking/mutex.c:579 __mutex_lock+0x8ee/0x910
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: Modules linked in: fuse snd_soc_sof_sdw snd_soc_intel_hda_dsp_common snd_soc_intel_sof_maxim_common snd_usb_audio snd_usbmidi_lib snd_h>
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  int340x_thermal_zone int3400_thermal acpi_thermal_rel intel_pmc_core squashfs drm drm_panel_orientation_quirks efivarfs spi_pxa2xx_pla>
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: CPU: 3 PID: 186 Comm: kworker/3:2 Not tainted 5.17.0-rc1-daily-default-20220202-0-13669-gbb45f689fa62 #2
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: Hardware name: Google Volteer/Volteer, BIOS  06/30/2020
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: Workqueue: events_power_efficient rt5682_jack_detect_handler [snd_soc_rt5682]
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: RIP: 0010:__mutex_lock+0x8ee/0x910
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: Code: c0 0f 84 a0 f7 ff ff 44 8b 1d d6 fe e4 00 45 85 db 0f 85 90 f7 ff ff 48 c7 c6 77 ee fa a4 48 c7 c7 d2 b4 f9 a4 e8 d5 71 f9 ff <0f>
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: RSP: 0018:ffffa0db80cffd70 EFLAGS: 00010282
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: RDX: 0000000000000001 RSI: ffffffffa4fbb461 RDI: 00000000ffffffff
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: RBP: ffffa0db80cffe10 R08: 0000000000000000 R09: ffffa0db80cffb98
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000000
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: R13: ffff953f51f61c40 R14: 0000000000000000 R15: ffff9542af9efd05
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: FS:  0000000000000000(0000) GS:ffff9542af800000(0000) knlGS:0000000000000000
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: CR2: 00007fd326f2a220 CR3: 0000000105162005 CR4: 0000000000770ee0
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: PKRU: 55555554
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: Call Trace:
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  <TASK>
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  ? sched_clock_cpu+0xd/0xd0
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  ? rt5682_jack_detect_handler+0x84/0x2e0 [snd_soc_rt5682]
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  ? rt5682_jack_detect_handler+0x84/0x2e0 [snd_soc_rt5682]
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  rt5682_jack_detect_handler+0x84/0x2e0 [snd_soc_rt5682]
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  process_one_work+0x297/0x530
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  worker_thread+0x48/0x3c0
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  ? process_one_work+0x530/0x530
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  kthread+0xeb/0x120
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  ? kthread_complete_and_exit+0x20/0x20
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  ret_from_fork+0x1f/0x30
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel:  </TASK>
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 kernel: ---[ end trace 0000000000000000 ]---
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 /usr/lib/gdm3/gdm-x-session[624]: (--) PCI:*(0@0:2:0) 8086:9a49:8086:9a49 rev 0, Mem @ 0x90000000/16777216, 0x80000000/268435456, I/O @ 0x00001>
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 /usr/lib/gdm3/gdm-x-session[624]: (II) LoadModule: "glx"
    Feb 03 05:37:33 jf-tglu-volt-sdw-01 /usr/lib/gdm3/gdm-x-session[624]: (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    
  18. marc-hb commented on Feb 3, 2022

    @marc-hb
    CollaboratorAuthor

    journalctl -g 'kernel/locking/mutex|Linux version|rt5682_jack_detect_handler' shows this WARNING has been printed on not all but almost all boots since Jan 21.

    #3392 merged on Jan 28 made no difference.

    Same on both jf-tglu-volt-sdw-01 and jf-tglu-volt-sdw-03

  19. plbossart commented on Feb 3, 2022

    @plbossart
    Member

    Humm, are we talking about a different platform @marc-hb ? Volteer is SoundWire based, so not sure if PR #3392 fixes any problems.

  20. marc-hb commented on Feb 3, 2022

    @marc-hb
    CollaboratorAuthor

    Sorry if it's unrelated, #3392 did not seem platform specific to me but I'm very codec-ignorant.

    Either way I thought people who just worked on an rt5682_jack_detect_handler deadlock would be interested by another (and unrelated?) rt5682_jack_detect_handler DEBUG_LOCKS_WARN_ON but sorry if I connected the wrong dots; nevermind :-)

  21. ujfalusi commented on Feb 3, 2022

    @ujfalusi
    Collaborator

    @marc-hb, I will take a look, it is rare (but not impossible) that the lock debug produces false positive.

  22. ujfalusi commented on Feb 3, 2022

    @ujfalusi
    Collaborator

    This print happens right during boot (@marc-hb can you point me to a log?), the sdw boot differs a bit from the i2c, it is going to schedule the jack_detect work in the sdw_slave .update_status callback. The mutex and work got initialized in the sdw probe, I assume this should be fine.

    I don't have any device with this codec (neither i2c or sdw), so it is going to be again fun to figure this out.

  23. ujfalusi commented on Feb 3, 2022

    @ujfalusi
    Collaborator

    What happened on Jan 21 or before it? Upstream merge, I assume, I'll take a look at those locking patches which took down the i2c path, they might had other issues as well.

  24. marc-hb commented on Feb 3, 2022

    @marc-hb
    CollaboratorAuthor

    What happened on Jan 21 or before it? Upstream merge, I assume

    No, Jan 21 is just hitting the ~4G default maximum in journalctl, so that's as far as the log gets. For some unknown reason logging on these devices seems to be more verbose than usual... Because of SoundWire? Pure speculation.

  25. plbossart commented on Feb 3, 2022

    @plbossart
    Member

    Good point @marc-hb we seem to log all the SoundWire codec stuff. we don't do this for other types of HDaudio or I2C/I2S codecs. I can't recall why, maybe it was because SoundWire was still new and we needed always get more info.

    SoundWire codecs

    options snd_soc_rt700 dyndbg=+p
    options snd_soc_rt5682_sdw dyndbg=+p
    options snd_soc_rt5682 dyndbg=+p
    options snd_soc_rt711 dyndbg=+p
    options snd_soc_rt1308_sdw dyndbg=+p
    options snd_soc_rt1308 dyndbg=+p
    options snd_soc_rt715 dyndbg=+p
    options snd_soc_max98373_sdw dyndbg=+p
    options snd_soc_max98373 dyndbg=+p
    options snd-soc-rt711-sdca dyndbg=+p
    options snd-soc-rt1316-sdw dyndbg=+p
    options snd-soc-rt715-sdca dyndbg=+p

    that may not be stricly required any longer. I took a quick look at the TGL_VOLTEER device, most of the logs still seem to come from the IPC, not from the codec.

  26. ujfalusi commented on Feb 4, 2022

    @ujfalusi
    Collaborator

    I think this issue is fixed now, can we close it?

    @marc-hb, can you create a new issue for the DEBUG_LOCKS_WARN_ON(lock->magic != lock) seen on Volteer?

    Nothing stands out in the code, I need access to a machine where I can debug it.

  27. marc-hb commented on Feb 4, 2022

    @marc-hb
    CollaboratorAuthor

    @marc-hb, can you create a new issue for the DEBUG_LOCKS_WARN_ON(lock->magic != lock) seen on Volteer?

    #3416

  28. marc-hb commented on Feb 18, 2022

    @marc-hb
    CollaboratorAuthor

    I'm seeing a lot of timeout these days but they don't seem as specific as this one so let's close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CMLApplies to Comet Lake platformI2SbugSomething isn't workingsuspend resumeIssues related to suspend resume (e.g. rtcwake)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions