Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9216545pxu; Mon, 28 Dec 2020 09:32:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYUmIhrjtt8xzZE/Voj7OPjjAAU+gPk/R++0KCOFO7KSCjt5jE8zKH3ox+wqe5eed4qUzv X-Received: by 2002:a17:906:6d47:: with SMTP id a7mr43337931ejt.340.1609176726753; Mon, 28 Dec 2020 09:32:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609176726; cv=none; d=google.com; s=arc-20160816; b=wUZdHTYxZr4TzVat/dz4vkiec+q8eZ5Tuj/WJhbIsDfpZdTwxDOpLZwLpEdqPMtvu9 4OLyGncI6hk9DXe836WTqvW8ncvSn81oCNalOVVeeccxq9qGIyhYsq7fXjnwxcwWwaHh QwNU5k2X8PYiRSkardEhdPjoX6eMbYFuAG01DCuyyY/RQpGhGh1xadkW8IASv4A5aLm4 oKaYkTZNv8osFwkcMiibuq6/8Y1nn0AKMsBWowoqkzoqddeIZvo6fK36sqa7pX3ykMT9 bbUp2Eqo343Y/QD9F5YsG1Bmc38NnMdyrm+a62Ue87CbePl09dsu7ImcODJ15GaFBYmA 1vUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yJAiCxDTqBy9SRQI26Kh8Y6IxiFedXspWetfHKSoC50=; b=iz0CxOCx8tC2HNu3ro6ZdKoDxf1uFDvmZ60PvSnFNVo9BVq54PvEn2F8ZMKmUgeBi+ JY9mJa4k5yJgmHaOFIIrscqfvJscXMQ0m+cSQtq4JyYk9+JwknVEmYJzWNw5v3pagv3R XLY+nefJvgxfqdTQxYmaZq/R2ylUb4MmIHUGyO4JpXsBOT56IONtaeDSYtaRAWhi3TRW R7YDPEPRtjmYwulR4j0A3IEYlTWdDAK4pXGqDJ8Zl8G4BPw0I/mHG428k5E4pCLpbWz8 SOjkH/zI0frPPivB3FdNvvBPQshwOm3Ky73WCVXAdP4JBNtoBKFbQpotnf7lXbfKpfXV y5AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2f7cqKNj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si18833937ejw.417.2020.12.28.09.31.44; Mon, 28 Dec 2020 09:32:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2f7cqKNj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730658AbgL1NFn (ORCPT + 99 others); Mon, 28 Dec 2020 08:05:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:33364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730639AbgL1NFe (ORCPT ); Mon, 28 Dec 2020 08:05:34 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E0E4A22582; Mon, 28 Dec 2020 13:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160693; bh=cuG2EWNI1cFolkhOiqv8KOvsbGLH9LY64J4Fo3gkaJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2f7cqKNjgzflsxL3huHFxuRDHt0HX5rbqJznZDlZ9lZOLuU6S0Nf3bnxW0fYvjP0L RwuF5gudu7vHuTlDMP0xank96r8M0BvcvU3c7uehjfgWh63MnMZH2GZp7air/0EYTI zrOKo4oo+8nyjAqh5T2m36zmOIYg+DbfW3bNp6GA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 4.9 138/175] ALSA: usb-audio: Disable sample read check if firmware doesnt give back Date: Mon, 28 Dec 2020 13:49:51 +0100 Message-Id: <20201228124859.934142007@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai 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 --- sound/usb/clock.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/sound/usb/clock.c +++ b/sound/usb/clock.c @@ -327,6 +327,12 @@ static int set_sample_rate_v1(struct snd } 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;