Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9093606pxu; Mon, 28 Dec 2020 06:29:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHo+glbrSFK7U2hA6wYz6+o9bwoTwtDaeEcOZZ3E6eybYHdv2AS2jxA/409hS/ltO6+5vO X-Received: by 2002:a17:906:3101:: with SMTP id 1mr29616164ejx.115.1609165760553; Mon, 28 Dec 2020 06:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165760; cv=none; d=google.com; s=arc-20160816; b=Ceplo92BHUaapP57smWQz/cCtwFoJ5b13wa9fAWtNxI81yT58qMu3kjVGRG7thlVSo 3N7jBioe/cBg5GcKAUJ6dkqAWhmvtm0Vn7iiJEiHi/OwSfKJXRiE7dNKgcSB0/pgc397 hnpMTvrjFjPpv4PDqCLCuIP6567ZAdY9kI9pepx8MW+jP3HNdyxeCxPId6TJhqcE+6Kv dGMFdrezCkaErQaJxOzjpN34JJPWIKFrXZZrYW0WQm57U/Qu10P4C3oIVevtQwggHII8 1WL5zpTFjHrBRZz0A5UMrs65Pc8Ne7NEdof/P9r7gt4U9Mn09zZklQo+W0KqWQlWe/a9 RP3Q== 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=ZetZ3EUxenzAO6mFISQOJoHNmsdNChq+dAbd1jWKbHs=; b=nUmhFTaVZosIJUf7KO8QaFp/IcsLx2xdIuRyp4zlEQ98ZxZ8NNcxJdcMerZfsIzhUx zWxfnsqRbeDYH3+B6eI2me8KgpzBXCkTsBkiSVUhw2RRmOaN4ga40ojaj53Ii83Ri3az G9upSan7J3ZYSFSPG8bOED4SieW6cwIJuGZeyN/FBGQcJx7TshKfLpeCiCzG3qrCznCV 253UIn468Cb8soNkUDlMZken/Xwdu8BXfv0Ppr1vgt63QTw2S9LOiBj1xc5FFVbbMMpO gpdsQ6OlaX25fTYAofh+quobgVmtibe07yHDnNnmoHkrTYlI2cpIF2kGbAHnqoBZtiiz +4fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jIFCE8Yn; 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 bs4si20689439edb.555.2020.12.28.06.28.58; Mon, 28 Dec 2020 06:29:20 -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=jIFCE8Yn; 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 S2503921AbgL1O04 (ORCPT + 99 others); Mon, 28 Dec 2020 09:26:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:34774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503869AbgL1O0v (ORCPT ); Mon, 28 Dec 2020 09:26:51 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3A922206D4; Mon, 28 Dec 2020 14:26:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165571; bh=szQs4ZqUCDQKYF2cv1WOcuBpGMFzvkTRpW1YLoJOZkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jIFCE8YnS0pdrzpGC7XwW5UinC1PoPbhRNYhw1MDWv2Os2sxvuB8UkIya2ukZOa8w AADYs0eTwQR8IjQ2klD7CbQsuYV50YmF3PstbtbJSRmNeif0bINrW7LWYIGRHysc9T gVdmEbZwg8AF+Fwf+nF8VEUXwssdvMt4Lx9ep7bQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 5.10 548/717] ALSA: usb-audio: Disable sample read check if firmware doesnt give back Date: Mon, 28 Dec 2020 13:49:06 +0100 Message-Id: <20201228125047.195811381@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 @@ -531,6 +531,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;