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=1795053586; b=VyOuBQefn2njWCZE7Inb5Woz/NaCpToyr3xnBIoOsQTRx0gNYTPExbDv4TnPAFSDiDYp edJhEOBFGqMHQuRI2MQGy2ZRd4OqIqu58RjLYMSHVbRgiunED+nCFMYE/ONYYZV7A+4kP gKQshyFlPmQaF94WPJnBU/fPAms1ZdzGDGdZonKobKz+tS3j8IG/cx5ioLHB2emQcRcbs BrY+/s8RriKWL2Zwz/ro7BcRY5jnDjCYxPXMSNOL4iVWftbjpbjDp/wzVs7DcZV2zR2om eZCU6tbQ9F23714wQ/4QluMT1YPSnJlHl+tPISDnZLbyn3+QGpVQ/sqqS+h1eUA71gg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795053586; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=t4ax1p/MU0HW3lW5jA5SBgSaDDGGQDKdvHhA7s57Vrs=; b=aXh5tAdUroAbkejOF30vEnWE+uzoaEyBtnyuO97VngyxgvUY+MUm8DGO64z7dbHzBmxi ycR/J8otoHhknU2icruipxc3562NMz4RyxpidUIDm+FoExcdxwA3BScXKXcVnyifK3gs3 S8Tz+JMWFJtPeePa1VWONG+d096vp8UQOUuyM2yFxZOxMzzx/nFsUPv5L1MIjoh3yABPc dFwpyR9N8ibgiujxII7zH05qp39yedlqz1R1yhE5EGKz1GYd8SYZElizS7r7L5GkUIpH2 WScaGgAFDXBQjYnPGyRjUYYHrFVFR9PvtXat+lF/SIM63hO4/HxaEonVKQo4HisihKg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=FgJo4nae; 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 B3A89606A320; Thu, 19 Nov 2026 01:59:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=FgJo4nae Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E52C1F000C5; Thu, 19 Nov 2026 01:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795053586; bh=t4ax1p/MU0HW3lW5jA5SBgSaDDGGQDKdvHhA7s57Vrs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FgJo4naeSKixRPBjb4peIBhVcYfgYduJ+G8z6+AhJlPMlpp2ukUvAIIiIY1jCq77F YGaZbQdp/YEGG2PEkJOizXdXyaFVZjxVjnv615t0nt3MMzxtBhTuFtrd9QkscV81E5 nqQFx8IwrbeHxJpduG/T+d8dlaWJ9yZdGwGO34AA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bin Yu , Cheng Wen , YuanZhe Liu <25031212351@stu.xidian.edu.cn>, Takashi Iwai , Sasha Levin Subject: [PATCH 5.15 0971/2214] ALSA: usx2y: Refuse a retried DSP load after a failure Date: Wed, 18 Nov 2026 15:44:07 +0100 Message-ID: <20261118150051.115607887@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150009.797899913@linuxfoundation.org> References: <20261118150009.797899913@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: YuanZhe Liu <25031212351@stu.xidian.edu.cn> [ Upstream commit 1f8101b6adc87a3ddbd51fcb6609251591758026 ] snd_usx2y_hwdep_dsp_load() sets up the asynchronous sequence URBs and the interrupt URB when the FPGA firmware image with index 1 is loaded, and then creates the ALSA devices. If usx2y_in04_init() or usx2y_create_alsa_devices() fails, the URBs that were already set up are left in place. The core keeps the index unloaded when the callback fails, so user space may issue the same request again. The second attempt then enters usx2y_async_seq04_init() or usx2y_in04_init() with the URBs still allocated and trips WARN_ON(usx2y->as04.buffer) or WARN_ON(usx2y->in04_urb). The URBs cannot be released at this point: the card may already have registered PCM devices that user space can still open, and the disconnect handler accesses the URBs without holding the DSP lock. Mark the chip as hung instead, so that a retried request is refused with -ENODEV and the assertions keep their meaning. The URBs are released by snd_usx2y_card_private_free() when the card is freed. A failing usx2y_async_seq04_init() still releases its own URBs, so that path remains retryable. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Co-developed-by: Bin Yu Signed-off-by: Bin Yu Co-developed-by: Cheng Wen Signed-off-by: Cheng Wen Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Link: https://patch.msgid.link/20261031191557.8460-1-25031212351@stu.xidian.edu.cn Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/usb/usx2y/usX2Yhwdep.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c index c0293af448fe7..89c7ff597a442 100644 --- a/sound/usb/usx2y/usX2Yhwdep.c +++ b/sound/usb/usx2y/usX2Yhwdep.c @@ -185,6 +185,9 @@ static int snd_usx2y_hwdep_dsp_load(struct snd_hwdep *hw, int lret, err; char *buf; + if (priv->chip_status & USX2Y_STAT_CHIP_HUP) + return -ENODEV; + snd_printdd("dsp_load %s\n", dsp->name); buf = memdup_user(dsp->image, dsp->length); @@ -209,11 +212,13 @@ static int snd_usx2y_hwdep_dsp_load(struct snd_hwdep *hw, err = usx2y_in04_init(priv); if (err) { snd_printk(KERN_ERR "usx2y_in04_init error\n"); + priv->chip_status |= USX2Y_STAT_CHIP_HUP; return err; } err = usx2y_create_alsa_devices(hw->card); if (err) { snd_printk(KERN_ERR "usx2y_create_alsa_devices error %i\n", err); + priv->chip_status |= USX2Y_STAT_CHIP_HUP; return err; } priv->chip_status |= USX2Y_STAT_CHIP_INIT; -- 2.53.0