From: Takashi Iwai Date: Fri, 18 Dec 2020 14:58:58 +0000 (+0100) Subject: ALSA: usb-audio: Disable sample read check if firmware doesn't give back X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~491^2~172 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=de8f8a38f2227e17e0aa2e6af43d044de23284d3;p=linux.git ALSA: usb-audio: Disable sample read check if firmware doesn't give back commit 9df28edce7c6ab38050235f6f8b43dd7ccd01b6d upstream. Some buggy firmware don't give the current sample rate but leaves zero. Handle this case more gracefully without warning but just skip the current rate verification from the next time. Cc: Link: https://lore.kernel.org/r/20201218145858.2357-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/usb/clock.c b/sound/usb/clock.c index f3ca59005d91..674e15bf98ed 100644 --- a/sound/usb/clock.c +++ b/sound/usb/clock.c @@ -531,6 +531,12 @@ static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface, } crate = data[0] | (data[1] << 8) | (data[2] << 16); + if (!crate) { + dev_info(&dev->dev, "failed to read current rate; disabling the check\n"); + chip->sample_rate_read_error = 3; /* three strikes, see above */ + return 0; + } + if (crate != rate) { dev_warn(&dev->dev, "current rate %d is different from the runtime rate %d\n", crate, rate); // runtime->rate = crate;