Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9047349pxu; Mon, 28 Dec 2020 05:21:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3JU76NJSi4uHyq39IdKdwo3b6kJJSOTA9v+AzOIt1NwL3LR4zcWru/UI5avefxju5Ay0l X-Received: by 2002:a17:907:6e9:: with SMTP id yh9mr41369830ejb.131.1609161675353; Mon, 28 Dec 2020 05:21:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161675; cv=none; d=google.com; s=arc-20160816; b=0UjlICWM5KTp4DfH4jU/hJ4kVYzsKtU6OLp53OeyNhKvw+iliCVty7BXqckQZfj78r OjXj6borzc9TbtiVk136pSzRaSnqsJtyGIvDkd3Kqe/Oy0O1LLRKTe87+pSGM0PUaY67 AF1Ky03mfRAsccEZvRq2JHFuqdcubFZplTDDyxMCWG+gCDQ2Mh09uMFMfcco0c/sGkc0 VoFuMDa2ETcT7E5IaGMPyMRprMejl3xBFPOjmctA2FzKOyXQeguNx9yIaQLLtHslo6XA N0RJNmCPC2zcAO8sEUo89A0OJDQ92d36A78L1ZyVXhfYhOBIzYLcWXdDNu3PY0GyYAjW 5BVg== 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=zMrtTWg/Kw8gbobsKL9aTXZSRkF5RMmMFRKfKI9XRFwX04t5Cy6M7Xues3kg3k/4+a aZx+5ekBPdZU+rLFHxFwVLpvYPggmrEyIutdvviP4wIhgpwOFd99OBZIjXCxWDAbTbyR MnrIMUIWot/jdj0RLIZaawSNbaruolNt4eAxCO0AyYeBGHgEju8xeZN1bYZd0YBGRCTR DdBYg98EBVUIAPu1H1FtUZ1q2ws8aBivNuvz+PPitdx531m4zu6R4g5Z4rQ89l34W1Qw 75hWMSywQniDyLnsRmSzq9Sh9YEOsj0uPr9mhmiOVJxvPPcK9h4XwD1exjfUY3n+/zBO R65A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dvtYTSt9; 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 s4si19897050edr.197.2020.12.28.05.20.53; Mon, 28 Dec 2020 05:21:15 -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=dvtYTSt9; 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 S1733298AbgL1NQz (ORCPT + 99 others); Mon, 28 Dec 2020 08:16:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:45108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733304AbgL1NQs (ORCPT ); Mon, 28 Dec 2020 08:16:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 99FE420776; Mon, 28 Dec 2020 13:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161368; bh=cuG2EWNI1cFolkhOiqv8KOvsbGLH9LY64J4Fo3gkaJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dvtYTSt9/fKhqu0HPpHoIFUvegT01Xfi58B/RSr5FbNcGVdEOQ/7zLbLx0ULSfkIW /hQJKg8HxjSp7pT+VxEnzAl1TtjMsvx32vVpIdtX/n6W6GazhlNJDlQvz34yH664Os K34w0mp/9jS7ZJQKK80sAe20BgU0Ws1jvgS9LuUg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 4.14 190/242] ALSA: usb-audio: Disable sample read check if firmware doesnt give back Date: Mon, 28 Dec 2020 13:49:55 +0100 Message-Id: <20201228124914.049127509@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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;