[PATCH v2 2/2] ALSA: fireworks: Abort the transaction on a bus reset

From: Suyuan Wang via B4 Relay

Date: Sun Nov 22 2026 - 08:46:45 EST


From: Suyuan Wang <stevewong@xxxxxxxxxxx>

When snd_efw_transaction_bus_reset() marks a transaction as
STATE_BUS_RESET, snd_efw_transaction_run() 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.

Fireworks devices also accept AV/C commands, and the AV/C general
specification says that a bus reset discards any transaction in
progress. Do the same as for FCP: end the transaction on a bus reset and
return -EAGAIN. ERROR_DELAY_MS has no users left, so drop it.

Found with a static analysis tool and checked by hand.

Suggested-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
Fixes: bde8a8f23bbe ("ALSA: fireworks: Add transaction and some commands")
Cc: stable@xxxxxxxxxxxxxxx
Co-developed-by: Kaixuan Li <kaixuan.li@xxxxxxxxxx>
Signed-off-by: Kaixuan Li <kaixuan.li@xxxxxxxxxx>
Signed-off-by: Suyuan Wang <stevewong@xxxxxxxxxxx>
---
sound/firewire/fireworks/fireworks_transaction.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/firewire/fireworks/fireworks_transaction.c b/sound/firewire/fireworks/fireworks_transaction.c
index 5c859773fe06..bb9ab8ed52b5 100644
--- a/sound/firewire/fireworks/fireworks_transaction.c
+++ b/sound/firewire/fireworks/fireworks_transaction.c
@@ -34,7 +34,6 @@
#define MEMORY_SPACE_EFW_RESPONSE 0xecc080000000ULL

#define ERROR_RETRIES 3
-#define ERROR_DELAY_MS 5
#define EFC_TIMEOUT_MS 125

static DEFINE_SPINLOCK(instances_lock);
@@ -99,7 +98,8 @@ int snd_efw_transaction_run(struct fw_unit *unit,
ret = t.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, "EFW transaction timed out\n");
ret = -EIO;

--
2.34.1