From patchwork Sat Oct 22 07:29:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7730 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1110135wrr; Sat, 22 Oct 2022 01:51:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68RVc7r9drOHk5JPCc9PCOHGceytd/KuQLU1bquc9oN7VgKoRaPJ3+d30SfJ76ojMDvJBQ X-Received: by 2002:a50:baec:0:b0:461:4c59:12bf with SMTP id x99-20020a50baec000000b004614c5912bfmr6689152ede.54.1666428690281; Sat, 22 Oct 2022 01:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666428690; cv=none; d=google.com; s=arc-20160816; b=oeeQ8Amxz7GUYklOanxhATi7RwURl2cTF2pXksORVIzG9bEQdoUGIpxPpgh9lS0+Od eGVODwqVYh4OxXGpV1GUNIe/cuh70TF8R2wpaUqFYk8mANrSZA5iZn73R4o7682aAp+X t/7GFWlHsa+FWq8AhHUjYzvhffoZGeAXjNv386rNiCPXeINWKlwsaEbFR+7cFw5Os4oE Mh59cuSkqdqGBy9e59SAwfMZoIjCmtRmU1MDaSHBWWOlJbBh0GlGQd9gpFBQ1xMZTe9C jBxLcO+neAqLU9dkb4bzCPUaUnYEtq7SgtDvEeu6G6ZEuzR85lcw2Zv6Ge0B5tnqJsaf tUXg== 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=/K/+pAbH0MDotvjlvaXwKwi5KdEBz8R3j8Q+jKXadIQ=; b=BYWkvXNziL797ZB6gEPwn5RVoxTgcYHBMAFwx02f7Ef/XxCdgplchXvgOuzQ6NrVAl Xyp3Go0sqd8MsqjozYQobBlCF2rsEUkgmPz0ZmfXmSPSPwQq1LaZ6UvKaV4KO64U5tko /oQ/aHnq179xyDmkNG+/uwL88wBfy45ToGPykLLNs6nlzrU6mca42h1E4qDDZ4EzEz/4 wpwl12jyZ18zFZymuksuEbUq8MB9sRFRF2/Vqlf2ZqpbO4xcOShQ51I47dS2sUxpXbQF Bme3qUYp8at/QdeoG5McL4iR2irLG/t/EG4Z6eMABq7ok+GBGBRVk3QUBHBG8YHpRmqr kI/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GPQfkp03; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a056402280100b0045cb68ca4ecsi28298638ede.37.2022.10.22.01.51.05; Sat, 22 Oct 2022 01:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GPQfkp03; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234870AbiJVIua (ORCPT + 99 others); Sat, 22 Oct 2022 04:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234926AbiJVItL (ORCPT ); Sat, 22 Oct 2022 04:49:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B5B04E62F; Sat, 22 Oct 2022 01:10:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C734DB82E39; Sat, 22 Oct 2022 08:07:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D8C8C433C1; Sat, 22 Oct 2022 08:07:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666426044; bh=HqzInSWqetlXOUQs1l/ij7Z47hWlE+PPV581CXDV+lw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GPQfkp03Qk1Jci6f6GSC5cIeiaap1Vmhq8dpuOdgmslfO2a9aPafr+rpJ39VsrlHX PZBRdEd0VubvugmIVqd49TWECCeDgzlS2Lnf4Hps9n6jd078VLKKCu67XPiHR4Tj4a O7a3X9nhWKKts2RV1WnOLcr7JIITaf79UBMwoAV0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 5.19 701/717] ALSA: usb-audio: Fix last interface check for registration Date: Sat, 22 Oct 2022 09:29:40 +0200 Message-Id: <20221022072529.462131443@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747377130168102701?= X-GMAIL-MSGID: =?utf-8?q?1747377130168102701?= From: Takashi Iwai commit 39efc9c8a973ddff5918191525d1679d0fb368ea upstream. The recent fix in commit 6392dcd1d0c7 ("ALSA: usb-audio: Register card at the last interface") tried to delay the card registration until the last found interface is probed. It assumed that the probe callback gets called for those later interfaces, but it's not always true; as the driver loops over the descriptor and probes the matching ones, it's not separately called via multiple probe calls. This results in the missing card registration, i.e. no sound device. For addressing this problem, replace the check whether the last interface is processed with usb_interface_claimed() instead of the comparison with the probe interface number. Fixes: 6392dcd1d0c7 ("ALSA: usb-audio: Register card at the last interface") Link: https://lore.kernel.org/r/20220915085947.7922-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/usb/card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -884,7 +884,7 @@ static int usb_audio_probe(struct usb_in * one given via option */ if (check_delayed_register_option(chip) == ifnum || - chip->last_iface == ifnum) { + usb_interface_claimed(usb_ifnum_to_if(dev, chip->last_iface))) { err = snd_card_register(chip->card); if (err < 0) goto __error;