Skip to content

Commit 24915f8

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 8458e57 commit 24915f8

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
@@ -933,8 +933,9 @@ static int snd_pcm_hw_free(struct snd_pcm_substream *substream)
933933
goto unlock;
934934
result = do_hw_free(substream);
935935
snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN);
936-
cpu_latency_qos_remove_request(&substream->latency_pm_qos_req);
937-
unlock:
936+
if (cpu_latency_qos_request_active(&substream->latency_pm_qos_req))
937+
cpu_latency_qos_remove_request(&substream->latency_pm_qos_req);
938+
unlock:
938939
snd_pcm_buffer_access_unlock(runtime);
939940
return result;
940941
}

0 commit comments

Comments
 (0)