Skip to content

Commit 9a5adeb

Browse files
committed
ALSA: usb-audio: Don't abort resume upon errors
The default mixer resume code treats the errors at restoring the modified mixer items as a fatal error, and it returns back to the caller. This ends up in the resume failure, and the device will be come unavailable, although basically those errors are intermittent and can be safely ignored. The problem itself has been present from the beginning, but it didn't hit usually because the code tries to resume only the modified items. But now with the recent commit to forcibly initialize each item at the probe time, the problem surfaced more often, hence it appears as a regression. This patch fixes the regression simply by ignoring the errors at resume. Fixes: b96681b ("ALSA: usb-audio: Initialize every feature unit once at probe time") Cc: <stable@vger.kernel.org> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215561 Link: https://lore.kernel.org/r/20220214125711.20531-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent dd8e5b1 commit 9a5adeb

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

sound/usb/mixer.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3678,17 +3678,14 @@ static int restore_mixer_value(struct usb_mixer_elem_list *list)
36783678
err = snd_usb_set_cur_mix_value(cval, c + 1, idx,
36793679
cval->cache_val[idx]);
36803680
if (err < 0)
3681-
return err;
3681+
break;
36823682
}
36833683
idx++;
36843684
}
36853685
} else {
36863686
/* master */
3687-
if (cval->cached) {
3688-
err = snd_usb_set_cur_mix_value(cval, 0, 0, *cval->cache_val);
3689-
if (err < 0)
3690-
return err;
3691-
}
3687+
if (cval->cached)
3688+
snd_usb_set_cur_mix_value(cval, 0, 0, *cval->cache_val);
36923689
}
36933690

36943691
return 0;

0 commit comments

Comments
 (0)