diff options
author | Takashi Iwai <tiwai@suse.de> | 2020-12-18 17:58:58 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-30 13:26:09 +0300 |
commit | 281d5bea129b2d8e64bca840fd9f9b336f5b6b37 (patch) | |
tree | 3ea98b456b936184061761635af0cfad9e33886b /sound/usb | |
parent | 51f8e5d547bfa19d890e812b478320503f2ff81a (diff) | |
download | linux-281d5bea129b2d8e64bca840fd9f9b336f5b6b37.tar.xz |
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: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201218145858.2357-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/clock.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/usb/clock.c b/sound/usb/clock.c index bfe5540030b8..54818658d021 100644 --- a/sound/usb/clock.c +++ b/sound/usb/clock.c @@ -508,6 +508,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; |