Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp891146rwi; Wed, 19 Oct 2022 04:23:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7bYM1Pk7ejc7CgAbGW74Zlyd6XfekWQX//lHtEkZ0UIe3CV2MWktHE9eqd28mj4aPvawuT X-Received: by 2002:a17:907:75d5:b0:78d:ef76:da7d with SMTP id jl21-20020a17090775d500b0078def76da7dmr6312961ejc.476.1666178598658; Wed, 19 Oct 2022 04:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666178598; cv=none; d=google.com; s=arc-20160816; b=Djf1lQjv17W1xOFtdYzrAM6tgOx8EvuCWT2hf02TF22as7GN3ErztQYvHYHU23BwXh 05rNorQrur4/jFYxLjbc5cVIeIF0GjhN2Lic0QmHu0PRvhjhy5bMHftYWJcm/+6vQhxB WAJ+7f6n0QH9OApfinN0lguKd3L+ssyCKUruKaEmPr2YqKrOQ98Q94N8ygZbe5HJ6uLz InZ57jnt3RxOkR2Nn2hicqbR7D8dKv0tydKOrRimy7WPl9iN3i1xu7tGstwpDddBjQvY /g/p/SVePzLcxgfm5DvccaaZdUwhfjJE0wVq1ksEr1Z5PiM4cTbhB+CcrFivXH1TlqzJ +BMQ== 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=JcoMUVm3SZEhJV5lff5WtQaTE86lkbIGS0HJxEJ+PdA9+D6F7psDHvy2QoI7Zk1YBf srwlD1iOxuetTzB1ibjPi3SA4ue0HjiGxwKnNRxeLv8jMABGUxyoZ+CF7S5nWR3m/i2d mrzzVaM8iuPKc490Ei4Qxh4vKvhQy1xIbwiTs5A3CVr0yqjuQVO1b3rI4ospoj+svrDB I4ZP41b/yVyrkpl4Y+qDAWO+VzYEzKI4E76y7gUMQMd2NZfpkkDgkQS163bVxHPbvBtM qRchcJer+ON/7VmDJCYJaBdL20Mmn5rsM1EF6xXjs5IGVASD7hOx4z4+qYvVagGNWCtD Rmhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aVHHN6V7; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020a170906971000b0078307781936si12176493ejx.359.2022.10.19.04.22.51; Wed, 19 Oct 2022 04:23:18 -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=aVHHN6V7; 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 S231872AbiJSLMD (ORCPT + 99 others); Wed, 19 Oct 2022 07:12:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231976AbiJSLK6 (ORCPT ); Wed, 19 Oct 2022 07:10:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AC01152C62; Wed, 19 Oct 2022 03:38:43 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 688B9617F1; Wed, 19 Oct 2022 09:16:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F373C433C1; Wed, 19 Oct 2022 09:16:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170974; bh=HqzInSWqetlXOUQs1l/ij7Z47hWlE+PPV581CXDV+lw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aVHHN6V7wZLEKnWFQfIU2iqN42SqlcZNpNedQss6IGOK0oydAC1Rycndf8uHJ/Kwk uGaMuZY7ogtmrKpK6Pexo+EMldqGsDZoED8klwGc4/TaDq0bftO8uLcG3v3hGmZp4q SByE/ct21GEKNI3VUoWo+hkwMnRXuAG+xdKSz/bc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 6.0 850/862] ALSA: usb-audio: Fix last interface check for registration Date: Wed, 19 Oct 2022 10:35:37 +0200 Message-Id: <20221019083327.413061636@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 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 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;