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=1796381416; b=GyPA1Ze1TqElV7azxoN6qm+RS06CbAkMbq/IMGhnUOoooH9clzg9VkM6EZZWyPniUkCb H3SERplG1MiYUbhnQfQaM/vd27HwGFPl1wokeVXLp+y7UUykPn5wYJnv+r4QlE4VyyhCO P8ruLlNCVr33tG+axT5xOymblARXYWE2HEW9uofZVKv9TjJbmm3L6kveOX2rAzTkyFSbf hBMc9Xmeb6TaEG+XUrke9d5d6K6WHuMdlj3x4N7InK4Ls5z2QtgB9jb0cXDntOLPHPccJ PqAK7nTf/jNgWhJZQzhyG2rWRBLpjNDSQeKE2ZH+8y/SO9GTWKlOw/xx/DxGI51aJGg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381416; 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=C50XyNUzeGqDkgC6FZGheSNdzeDFQROJLOG+gmmIfB0=; b=sO75sUV4+tsx0KkTgr3sdySvs4WoNvtzsVl2efCdxxAzR5kIZJkOgq0fLw8XWZaryNh9 ofvTR3vVDHt8PsZNFiIzT37oe7T/qaJ/K+k+UHsolcnxPbfp+lPXFNBnoA0rEYoKnQpi/ pdGJCgrvD+TO+g3jUVroCvqFOFumCP6Mim7TjcfePRnk5hodDF8iGhVmowIvQYcvuvC4m RtpQXIxlaTfUFM26rcsLskTUHvsxrE7mnTcxUwF/rhh0M4bvJicUsDzQH/1NU7Rzu23Em c3Vo/FYn6s2xDrIgIZWppSpLq26HQxVVzI9VuKLyvS//oiFYoAfOmohviKyCOvIbdQg== 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=gdrA1TVX; 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 11F64606A33B; Fri, 4 Dec 2026 10:50:15 +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=gdrA1TVX Received: by smtp.kernel.org (Postfix) with ESMTPSA id 442B61F00A06; Fri, 4 Dec 2026 10:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381415; bh=C50XyNUzeGqDkgC6FZGheSNdzeDFQROJLOG+gmmIfB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gdrA1TVX/c3utb14OWoFrKFCM6+3RIYNzcNBrdAeda3c/V3VXM1Rm84yqLmNgmg4G qHdIbszFy33Ifeh0w9dGbXec7Ov9g5jP1yV8sC0PjPLiPjC2vUI7IGTUu5U6RpXkKu /NZ+ymsMNnsj1BakFr/ElcOv7LKG632ZdtChVpRQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Takashi Sakamoto , Kaixuan Li , Suyuan Wang , Takashi Iwai Subject: [PATCH 7.3 693/742] ALSA: firewire-lib: Abort the FCP transaction on a bus reset Date: Fri, 4 Dec 2026 19:09:17 +0900 Message-ID: <20261204100653.464419025@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Suyuan Wang commit 5e8802bf480da76634a8ac929c29af7b7acde615 upstream. When fcp_bus_reset() marks a transaction as STATE_BUS_RESET, fcp_avc_transaction() sleeps and resends the command, but leaves the state as it is. The response to the resent command is then ignored, and the next wait returns at once, so the loop keeps resending the command without a retry limit until sending fails. The AV/C Digital Interface Command Set General Specification 4.2 says that a target which detects a bus reset discards any AV/C transaction in progress without returning a response. So instead of resending, end the transaction on a bus reset and return -EAGAIN, so that the caller can start the sequence again. ERROR_DELAY_MS and have no users left after this, so drop them. Found with a static analysis tool and checked by hand. Suggested-by: Takashi Sakamoto Fixes: 31ef9134eb52 ("ALSA: add LaCie FireWire Speakers/Griffin FireWave Surround driver") Cc: stable@vger.kernel.org Co-developed-by: Kaixuan Li Signed-off-by: Kaixuan Li Signed-off-by: Suyuan Wang Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20261122-firewire-busreset-v2-1-e104d785c8a1@gmail.com Signed-off-by: Greg Kroah-Hartman --- sound/firewire/fcp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/sound/firewire/fcp.c +++ b/sound/firewire/fcp.c @@ -14,7 +14,6 @@ #include #include #include -#include #include "fcp.h" #include "lib.h" #include "amdtp-stream.h" @@ -22,7 +21,6 @@ #define CTS_AVC 0x00 #define ERROR_RETRIES 3 -#define ERROR_DELAY_MS 5 #define FCP_TIMEOUT_MS 125 int avc_general_set_sig_fmt(struct fw_unit *unit, unsigned int rate, @@ -272,7 +270,8 @@ deferred: ret = t.response_size; break; } else if (t.state == STATE_BUS_RESET) { - msleep(ERROR_DELAY_MS); + ret = -EAGAIN; + break; } else if (++tries >= ERROR_RETRIES) { dev_err(&t.unit->device, "FCP command timed out\n"); ret = -EIO;