From nobody Fri Dec 19 21:47:00 2025 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 C4069C6FA82 for ; Tue, 13 Sep 2022 14:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234355AbiIMOjv (ORCPT ); Tue, 13 Sep 2022 10:39:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234211AbiIMOhM (ORCPT ); Tue, 13 Sep 2022 10:37:12 -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 A715C6B65D; Tue, 13 Sep 2022 07:20:31 -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 08010B80D87; Tue, 13 Sep 2022 14:20:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 704C2C433C1; Tue, 13 Sep 2022 14:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078829; bh=sJERrPUAwCBI0ASN54+KpYx7+Q3ky4neYCJzCXJ+fOA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u1q6r0pNEyuWWVFay3/TtAsdS7lR/+FpUCPURjltvWYm2jvn7HjuBRKS71xvldu2W ccyMGEtQFonDnczIHzXyLWFINYGF5gC8SC16var7Yv+dEWOV5EOFx0ZHZ7qPU2jvVH FhkTDwtigG3p5ZtvqbyGyKTPuCmVkBDSZNX2CksE= 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.15 072/121] ALSA: usb-audio: Register card again for iface over delayed_register option Date: Tue, 13 Sep 2022 16:04:23 +0200 Message-Id: <20220913140400.465277446@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140357.323297659@linuxfoundation.org> References: <20220913140357.323297659@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 ff5f8de1bc540..713b84d8d42f1 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -698,7 +698,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 9bfead5efc4c1..5b4d8f5eade20 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1764,7 +1764,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