From nobody Mon Apr 6 00:08:14 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01D07C54EE9 for ; Tue, 13 Sep 2022 14:51:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231642AbiIMOvK (ORCPT ); Tue, 13 Sep 2022 10:51:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234444AbiIMOsl (ORCPT ); Tue, 13 Sep 2022 10:48:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FA76165A3; Tue, 13 Sep 2022 07:25:10 -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 02C3BB80F1A; Tue, 13 Sep 2022 14:23:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E46DC433C1; Tue, 13 Sep 2022 14:23:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663079022; bh=LME2R6+LL8pgq5QfrvjxXGwzpNd8Zg0JxYGJD2SCv/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E7AkJezsSCRCzmu9WiIsCKpc4eoms67sGBm3N4PsGx1zLqEC119zX2R1y4oz3pycE 8+gtDkwNqqmJ30wLl+1lct+2Wvo3ZSX7LyXzdqZottH19oh3PRzLm3EAHHH6aen0r0 Q+aLEu44OgGgz5KjoLE32A5gqIdqusV0NhnoHrIc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Sasha Levin Subject: [PATCH 5.10 52/79] ALSA: usb-audio: Register card again for iface over delayed_register option Date: Tue, 13 Sep 2022 16:04:57 +0200 Message-Id: <20220913140352.753179190@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140350.291927556@linuxfoundation.org> References: <20220913140350.291927556@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Takashi Iwai [ Upstream commit 2027f114686e0f3f1f39971964dfc618637c88c2 ] When the delayed registration is specified via either delayed_register option or the quirk, we delay the invocation of snd_card_register() until the given interface. But if a wrong value has been set there and there are more interfaces over the given interface number, snd_card_register() call would be missing for those interfaces. This patch catches up those missing calls by fixing the comparison of the interface number. Now the call is skipped only if the processed interface is less than the given interface, instead of the exact match. Fixes: b70038ef4fea ("ALSA: usb-audio: Add delayed_register option") Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D216082 Link: https://lore.kernel.org/r/20220831125901.4660-2-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/usb/card.c | 2 +- sound/usb/quirks.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/usb/card.c b/sound/usb/card.c index a3e06a71cf356..6b172db58a310 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -667,7 +667,7 @@ static bool check_delayed_register_option(struct snd_us= b_audio *chip, int iface) if (delayed_register[i] && sscanf(delayed_register[i], "%x:%x", &id, &inum) =3D=3D 2 && id =3D=3D chip->usb_id) - return inum !=3D iface; + return iface < inum; } =20 return false; diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 6333a2ecb848a..41f5d8242478f 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1911,7 +1911,7 @@ bool snd_usb_registration_quirk(struct snd_usb_audio = *chip, int iface) =20 for (q =3D registration_quirks; q->usb_id; q++) if (chip->usb_id =3D=3D q->usb_id) - return iface !=3D q->interface; + return iface < q->interface; =20 /* Register as normal */ return false; --=20 2.35.1