summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Porter <mrwillporter@gmail.com>2026-08-27 18:21:40 -0500
committerTakashi Iwai <tiwai@suse.de>2026-08-31 09:54:18 +0200
commit103da4a7bca6bc6ae263c5e4e3053fa166691731 (patch)
treec4902ac8328f91e929122189badea902121f83a0
parent9e6c9d7531de7c6da66431a54d3c89f9514da937 (diff)
ALSA: usb-audio: Add PM guard to Scarlett meter reads
The Scarlett Gen 1 meter callback reads the device without preventing runtime suspend or disconnect. The transfer can fail when userspace polls the volatile control after the device suspends. Hold snd_usb_lock across the meter request. This matches the guarded Forte and common mixer control paths in this file. Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Will Porter <mrwillporter@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260827232143.149197-4-mrwillporter@gmail.com
-rw-r--r--sound/usb/mixer_scarlett.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c
index 673eb8d8724d..369968565c19 100644
--- a/sound/usb/mixer_scarlett.c
+++ b/sound/usb/mixer_scarlett.c
@@ -707,6 +707,10 @@ static int scarlett_ctl_meter_get(struct snd_kcontrol *kctl,
int idx = snd_usb_ctrl_intf(elem->head.mixer->hostif) | (elem->head.id << 8);
int err;
+ CLASS(snd_usb_lock, pm)(chip);
+ if (pm.err < 0)
+ return -EIO;
+
err = snd_usb_ctl_msg(chip->dev,
usb_rcvctrlpipe(chip->dev, 0),
UAC2_CS_MEM,