From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796166971; b=D+Lw1gtxr6vWto0wFaKYafdkCwIGCC18h8sUIpzZWwRALjFV9CE8BjFCcuL9XzQMgd68 RcjHLGiC0EeRDH9c9Dy/tIMcx0snARL2nXTcWsnHoDoPfm8/4o40MsfLnNuZ0kla6OAdd PmOxjKvZpRhn8HX3E7ZbWVOL/I2KF4ldYWaVQMzqLterqtmUwpu8EgFbhXmxh8Dud+Eb6 UUG5tlshNqBnQNI+oc6f8ITBlu2Kb3nc2rT1Gy22TNnqz2h22KJKoZHJ19WrLrG2gKGs5 R9h7hojLexC3F2459eWEWs4TJhaCnJB9JwRfc1yhlGjmyeyejHL7X1uokBe2P96qhaQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796166971; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=e5+URidSXuWaWveKlKZA0fptR6deiGlCSIowAAZztxM=; b=g380pUko7wlNh1tujXwGsCMB3jqQ3oWAmEZ09BrqU4gfk1DtNxiUTack2KOmIhmWwKwX D+bzZdBNZPvfL/IVE+MZhLbaMv6O61qAXty7s2LQTYFisTP9PDDnd2FTnxZL5GoQODdje 58kZHuR+6TQdRMbblPX+RPgGPFc7TuLH2M9CS/GnVcQnpZtrDJXmCYqMYaesnx5vw/Q1y RfTxRC/mPyMZMCPhi+z56oTAc2WtnWjdYEgXZWmHtLJyqmB+XeNDBI0FKnkrZurjkFlKl 0DR2m2+Sf4GvcwbLvxvsHzj0SQdNNbKj+AY9nHgQ3SN2VCkzunKwQVYF29kBD0lJNTw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EpOshoJV; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5171606A31A; Tue, 1 Dec 2026 23:16:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EpOshoJV Received: by smtp.kernel.org (Postfix) with ESMTPSA id 234041F000C1; Tue, 1 Dec 2026 23:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796166971; bh=e5+URidSXuWaWveKlKZA0fptR6deiGlCSIowAAZztxM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=EpOshoJVTkEbQwS0S06BTvGyvV6cV95vpG4/AKsC2kRgR/AUOmWa15Ik9hz1JSGSA c3NwFOokYD8RI5d9gpXoVu3rcdtUuIhGDslrCQ4gOtepk/wJGUhtNLLhWk4r9HXEH4 X7hQiTd8A0vlo7TyDngMOGnGAleuc14/C/hXpHRVqu9/vK1OEE7jHsipMPFcLaMkqr QRvubAn/y/VXNTOnfYHmJCzBSL0gLFq/NNpFXh0HSCrKoPvjSl54kdXF1vMO74PquV RV7MJsU5Jam0A5NH0aWKMrZsyVlXwo2ugbZC0hgFZMjvnljGvHlQjViQoTpSgDiZM2 qPp6pu+cGceLw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v8 3/4] ALSA: usb-audio: qcom: tag sideband endpoints before ring allocation Reply-To: sashiko-reviews@lists.linux.dev To: "Wesley Cheng" Cc: linux-usb@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <20261201-16k_offload_v1_b4-v8-3-aad08c457d7e@oss.qualcomm.com> References: <20261201-16k_offload_v1_b4-v8-0-aad08c457d7e@oss.qualcomm.com> <20261201-16k_offload_v1_b4-v8-3-aad08c457d7e@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 23:16:10 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] usb: xhci: xhci_sideband_add_endpoint() rejects existing ep->ring too early -- commit b9ffa7500ce27332d8a4a070f26d4eaeefa92e40 Author: Wesley Cheng ALSA: usb-audio: qcom: tag sideband endpoints before ring allocation This commit moves the xhci_sideband_add_endpoint() calls in enable_audio_stream() ahead of snd_usb_endpoint_prepare() so endpoint transfer rings are allocated with ep->no_pool_alloc set, and rejects adding sideband endpoints that already have a transfer ring allocated. > diff --git a/drivers/usb/host/xhci-sideband.c b/drivers/usb/host/xhci-sid= eband.c > index d28ff17411661..30c058a5988f2 100644 > --- a/drivers/usb/host/xhci-sideband.c > +++ b/drivers/usb/host/xhci-sideband.c > @@ -225,6 +225,8 @@ EXPORT_SYMBOL_GPL(xhci_sideband_notify_ep_ring_free); > * After an endpoint is added the sideband client can get the endpoint t= ransfer > * ring buffer by calling xhci_sideband_endpoint_buffer() > * > + * The endpoint must be added before its transfer ring is allocated. > + * > * Return: 0 on success, negative error otherwise. > */ > int > @@ -255,7 +257,7 @@ xhci_sideband_add_endpoint(struct xhci_sideband *sb, > * and let this function add the endpoint and allocate the ring buffer > * with the smallest common DMA mask > */ > - if (sb->eps[ep_index] || ep->sideband) > + if (sb->eps[ep_index] || ep->sideband || ep->ring || ep->new_ring) > return -EBUSY; [Severity: Medium] Can checking ep->ring here cause enable_audio_stream() to fail with -EBUSY when an old transfer ring is still present before snd_usb_endpoint_prepare() replaces it? For example, when QUIRK_FLAG_IFACE_SKIP_CLOSE is set, closing a stream skips switching back to altsetting 0 and leaves ep->ring allocated until the next snd_usb_endpoint_prepare() deselects and re-enables the altsetting: sound/usb/endpoint.c:snd_usb_endpoint_close() { ... if (!--ep->iface_ref->opened && !(chip->quirk_flags & QUIRK_FLAG_IFACE_SKIP_CLOSE)) endpoint_set_interface(chip, ep, false); ... } Because enable_audio_stream() now calls xhci_sideband_add_endpoint() before snd_usb_endpoint_prepare(), starting a second offloaded stream on such a device (or on a device whose altsetting 0 defines the endpoint) sees the existing ep->ring and fails with -EBUSY, even though snd_usb_endpoint_prepare() is about to free and reallocate that ring. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201-16k_offloa= d_v1_b4-v8-0-aad08c457d7e@oss.qualcomm.com?part=3D3