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=1796382854; b=l3sJdUE/rICC6zetnRBRgiMQDYqU5kE83T17FqxtRvmqw3dMqoNZ/Rsscbqpb1bsmVaQ wK1vWRE1g7iEM4ifn+Dcr/oSr/3uKlqvk0W/ItbC+srXWR6jhb59CYmN7C6jeSczNoW7N LTd2UFSZV8snfbiGixX4VsrIKEnmJb2d1GHkdeZF+pFXaemCNmDxRiwuytycizOZGgBiu kWQmpN/ZfweZBQmVlRByqpf0aOUecfS8TxryKV+oaW16ck9ShkO4Neqkuv0epVD6JWYU1 P3UsnZ5mh3JgGuAkjbSjR5RFeW4e+9sGI2OZ3KnafgN9/zFfTRM7CIjRhNgAry+hY6Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382854; 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=gxwWpfK3jk/QRfCtun5+0daY42uLnYi3M7PZo2IwbEM=; b=DaSZYGDoGkEgW+E4hlFJP7mmAkJlhvPQfsAfAoL9uj1Nlz7j9vShhTxCD7VrpoCYkdQH f4Hm3WPZ8x0h+CTwekHQhmSCbaWOuUFM9mAkyHmvAK/cxa8G6AI8/IDexrreIdvBb/tDF SbT8Km+UF5PZNiLK9rxVMaSwgmbyMB01TYhz5BtTxvef421bMWVBZrD2LmoOYcSJCDyiX CWp9APzvUDtvENIGXHe7TGXfaFs7oNcguJTAS6aw5xhkJPdIJ6qxOaJFv9x1+EkIoJo4V vkOhHiOwH4tIT95H0XhtqOnskxu6VUybVVV8iIUAvu2miC2Szo2Ll6a31OygBM2G2bA== 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=b7xH42c6; 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 C1196606A334; Fri, 4 Dec 2026 11:14:14 +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=b7xH42c6 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2D0E1F000CE; Fri, 4 Dec 2026 11:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382854; bh=gxwWpfK3jk/QRfCtun5+0daY42uLnYi3M7PZo2IwbEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=b7xH42c6LTOvvQjV1l40B4IvkhyjPi4LpIFmuuesVQHOxVL+EKwFjuizhM7fYbp+L nSDTJkEizsbUc9ZakDxiZg8f8d8dHQBwxWWmw9lNFCuHJW8CD0eCGT6/IMutZYWxKa Iip3WVVEpIrCEgarAGzxlkKjAz3w1BHUJ7gVE4HQ= 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 6.18 622/703] ALSA: firewire-lib: Abort the FCP transaction on a bus reset Date: Fri, 4 Dec 2026 19:08:41 +0900 Message-ID: <20261204100644.332662135@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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 6.18-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;