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=1796384181; b=wkafU7ToCJYQKx8JT7SkXJ5qqBJnedx63euiTFhq/3MESHWBxX6VHA0B7F5bNLjtZd5h wP7YIH2TatGEnFJ9bLVqJm6RDBjBH0/o/+37O/uBcZIMnCTkNECS7sg0SLHUi1TtMrvWO o1BcEF2JbYhz/v2CqxJHBodyP/anKDHXM6rTxVlGTnNKcza2kbLnR7+fHe41gR26nwRdm icG1wtOi6W+eTNiNAY9rOZBaJo41m32qLM0JbEPTpH5V1RGOzttGCKFR2F6RyUboulX5w EoaS6YDQmwpCbUneIQl6JuH7LWHoXBz1aBwq2omj0Bkc2gpBiqGZf4JJ3qeSA/+LQtA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384181; 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=Z+iCl+l/rVc9cCcXfgq/COiSVDKORzsko6QqqYbk6SM=; b=ZkCnEUABK2MzCoAEGNSCPs3q+73skljrCI74fp3UXTVgGU/2glr5lWn3RF3kRv2HcLh8 xEtHc2PNT6EXFnyT46rPp8WWaTXr4y4AZNadSVFTV4gac3zJjMtLMfwtW0D1zX//W1KHw ULoJpUVdCmOH8ng2uKKO6EyTql5Wl6/odkJrH+rboPMr2/WoH9J1Tbm/iZRJLEuoL+6od BAMIjndiO5QCxmn3cvFLJPNugepBF7w2kDdy2aelUkV/ssXyHL0Ll3F6UMoxxBXsUh066 w5V4tvCGk7bCjrJfc2Tl6e0LE4VXwA6Wz6o+Z2TQj07G4XrOZAGPT4jfe7347tEsf3w== 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=sRdT1JAn; 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 BB2BD606A322; Fri, 4 Dec 2026 11:36:21 +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=sRdT1JAn Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30DBF1F000C2; Fri, 4 Dec 2026 11:36:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384181; bh=Z+iCl+l/rVc9cCcXfgq/COiSVDKORzsko6QqqYbk6SM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=sRdT1JAn9mE4Di5s5rAa6hAze0Z749aZyF13eUpr1Q6WrdcVffkDgtA5/4VWnQLs/ Qy6gbck2KB2mg+1endblILUfcLOB/ydsrgPhyinyuFUWo1ZoS2wc5iyqkM1NGLWegt uczFEtNU9SzlbuDykkHQ8RCe4skn3kFER9oCvsBU= 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.12 530/555] ALSA: firewire-lib: Abort the FCP transaction on a bus reset Date: Fri, 4 Dec 2026 19:09:33 +0900 Message-ID: <20261204100628.898859403@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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;