From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEE7FC433DB for ; Wed, 23 Dec 2020 07:10:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C06020809 for ; Wed, 23 Dec 2020 07:10:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727591AbgLWHKY (ORCPT ); Wed, 23 Dec 2020 02:10:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:41480 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727046AbgLWHKX (ORCPT ); Wed, 23 Dec 2020 02:10:23 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E04D8ACC4; Wed, 23 Dec 2020 07:09:41 +0000 (UTC) Date: Wed, 23 Dec 2020 08:09:41 +0100 Message-ID: From: Takashi Iwai To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Dylan Robinson , Keith Milner , alsa-devel@alsa-project.org Subject: Re: [PATCH AUTOSEL 5.4 057/130] ALSA: usb-audio: Check valid altsetting at parsing rates for UAC2/3 In-Reply-To: <20201223021813.2791612-57-sashal@kernel.org> References: <20201223021813.2791612-1-sashal@kernel.org> <20201223021813.2791612-57-sashal@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Dec 2020 03:17:00 +0100, Sasha Levin wrote: > > From: Takashi Iwai > > [ Upstream commit 93db51d06b32227319dae2ac289029ccf1b33181 ] > > The current driver code assumes blindly that all found sample rates for > the same endpoint from the UAC2 and UAC3 descriptors can be used no > matter which altsetting, but actually this was wrong: some devices > accept only limited sample rates in each altsetting. For determining > which altsetting supports which rate, we need to verify each sample rate > and check the validity via UAC2_AS_VAL_ALT_SETTINGS. This control > reports back the available altsettings as a bitmap. > > This patch implements the missing piece above, the verification and > reconstructs the sample rate tables based on the result. > > An open question is how to deal with the altsettings that ended up > with no valid sample rates after verification. At least, there is a > device that showed this problem although the sample rates did work in > the later usage (see bug link). For now, we accept such an altset as > is, assuming that it's a firmware bug. > > Reported-by: Dylan Robinson > Tested-by: Keith Milner > Tested-by: Dylan Robinson > BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1178203 > Link: https://lore.kernel.org/r/20201123085347.19667-4-tiwai@suse.de > Signed-off-by: Takashi Iwai > Signed-off-by: Sasha Levin Please drop this for 5.4 or older. At least this caused some problem on 5.3 kernel that confused USB core by some reason while it works fine with the recent upstream. thanks, Takashi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38D83C433E0 for ; Wed, 23 Dec 2020 07:10:52 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B4BA207F7 for ; Wed, 23 Dec 2020 07:10:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B4BA207F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AB37A17A6; Wed, 23 Dec 2020 08:09:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AB37A17A6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1608707446; bh=ywS6HU/dnR9J1/64F4I4HsaBVVwPmKsdzUePafOl4Zk=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=HspyksE8hyYWNc6fc1XqZiP0MqUKA0ywDxuwpvDWmf1L5DnGj30X0TQogerIHQpXr /tDzFT6FfsQLS+hISDl1VyQIVIkVdtsu0Kv6T0jFACYwp0gtvc5BhWUI1fSv7DPSX3 2D4QXIUBGVa+wt+K2QeS4cXh6isjRkUghDhB9DK4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3146FF80168; Wed, 23 Dec 2020 08:09:56 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1F0C6F801D5; Wed, 23 Dec 2020 08:09:54 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2C5EFF80116 for ; Wed, 23 Dec 2020 08:09:47 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2C5EFF80116 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E04D8ACC4; Wed, 23 Dec 2020 07:09:41 +0000 (UTC) Date: Wed, 23 Dec 2020 08:09:41 +0100 Message-ID: From: Takashi Iwai To: Sasha Levin Subject: Re: [PATCH AUTOSEL 5.4 057/130] ALSA: usb-audio: Check valid altsetting at parsing rates for UAC2/3 In-Reply-To: <20201223021813.2791612-57-sashal@kernel.org> References: <20201223021813.2791612-1-sashal@kernel.org> <20201223021813.2791612-57-sashal@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, Dylan Robinson , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Keith Milner X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Wed, 23 Dec 2020 03:17:00 +0100, Sasha Levin wrote: > > From: Takashi Iwai > > [ Upstream commit 93db51d06b32227319dae2ac289029ccf1b33181 ] > > The current driver code assumes blindly that all found sample rates for > the same endpoint from the UAC2 and UAC3 descriptors can be used no > matter which altsetting, but actually this was wrong: some devices > accept only limited sample rates in each altsetting. For determining > which altsetting supports which rate, we need to verify each sample rate > and check the validity via UAC2_AS_VAL_ALT_SETTINGS. This control > reports back the available altsettings as a bitmap. > > This patch implements the missing piece above, the verification and > reconstructs the sample rate tables based on the result. > > An open question is how to deal with the altsettings that ended up > with no valid sample rates after verification. At least, there is a > device that showed this problem although the sample rates did work in > the later usage (see bug link). For now, we accept such an altset as > is, assuming that it's a firmware bug. > > Reported-by: Dylan Robinson > Tested-by: Keith Milner > Tested-by: Dylan Robinson > BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1178203 > Link: https://lore.kernel.org/r/20201123085347.19667-4-tiwai@suse.de > Signed-off-by: Takashi Iwai > Signed-off-by: Sasha Levin Please drop this for 5.4 or older. At least this caused some problem on 5.3 kernel that confused USB core by some reason while it works fine with the recent upstream. thanks, Takashi