Skip to content

Commit 629da7b

Browse files
marcanjannau
authored andcommitted
alsa: pcm: Remove the qos request only if active
Fixes warning: [ 8.502802] ------------[ cut here ]------------ [ 8.503445] cpu_latency_qos_remove_request called for unknown object [ 8.504269] WARNING: CPU: 5 PID: 2790 at kernel/power/qos.c:322 cpu_latency_qos_remove_request+0x48/0x98 [ 8.505499] CPU: 5 PID: 2790 Comm: wireplumber Tainted: G W 6.5.0-asahi-00708-gb9b88240f7ae #2291 [ 8.506777] Hardware name: Apple MacBook Air (13-inch, M2, 2022) (DT) <snip regs> [ 8.519099] Call trace: [ 8.519402] cpu_latency_qos_remove_request+0x48/0x98 [ 8.520027] snd_pcm_ioctl+0x86c/0x182c [ 8.520519] __arm64_sys_ioctl+0xf8/0xbd0 [ 8.521020] invoke_syscall.constprop.0+0x78/0xc8 [ 8.521604] do_el0_svc+0x58/0x154 [ 8.522026] el0_svc+0x34/0xe4 [ 8.522409] el0t_64_sync_handler+0x120/0x12c [ 8.522951] el0t_64_sync+0x190/0x194 [ 8.523408] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent 96f9f02 commit 629da7b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

sound/core/pcm_native.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,8 +939,9 @@ static int snd_pcm_hw_free(struct snd_pcm_substream *substream)
939939
goto unlock;
940940
result = do_hw_free(substream);
941941
snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN);
942-
cpu_latency_qos_remove_request(&substream->latency_pm_qos_req);
943-
unlock:
942+
if (cpu_latency_qos_request_active(&substream->latency_pm_qos_req))
943+
cpu_latency_qos_remove_request(&substream->latency_pm_qos_req);
944+
unlock:
944945
snd_pcm_buffer_access_unlock(runtime);
945946
return result;
946947
}

0 commit comments

Comments
 (0)