[PATCH v2 0/2] ALSA: firewire: Abort transactions on a bus reset

Suyuan Wang via B4 Relay posted 2 patches 1 day, 21 hours ago
sound/firewire/fcp.c                             | 5 ++---
sound/firewire/fireworks/fireworks_transaction.c | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
[PATCH v2 0/2] ALSA: firewire: Abort transactions on a bus reset
Posted by Suyuan Wang via B4 Relay 1 day, 21 hours ago
fcp_avc_transaction() and snd_efw_transaction_run() resend their
command after a bus reset but never move the transaction back to
STATE_PENDING, so both loops keep resending without a retry limit
until sending fails.

As Takashi suggested, v2 no longer resends: on a bus reset the
transaction is ended and -EAGAIN is returned, following the AV/C
general specification, which says that a target discards any
transaction in progress on a bus reset.

Found with a static analysis tool and checked by hand. Compile tested
only (x86_64, W=1); I don't have FireWire audio hardware.

Changes in v2:
- Abort the transaction and return -EAGAIN on a bus reset instead of
  rearming it and resending (Takashi).
- Drop ERROR_DELAY_MS (and <linux/delay.h> in fcp.c), now unused.

v1: https://lore.kernel.org/all/20261120-firewire-busreset-v1-0-8bb9079a2984@gmail.com/
---
Suyuan Wang (2):
      ALSA: firewire-lib: Abort the FCP transaction on a bus reset
      ALSA: fireworks: Abort the transaction on a bus reset

 sound/firewire/fcp.c                             | 5 ++---
 sound/firewire/fireworks/fireworks_transaction.c | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)
Re: [PATCH v2 0/2] ALSA: firewire: Abort transactions on a bus reset
Posted by Takashi Iwai 1 day, 2 hours ago
On Sun, 22 Nov 2026 14:46:28 +0100,
Suyuan Wang via B4 Relay wrote:
> 
> fcp_avc_transaction() and snd_efw_transaction_run() resend their
> command after a bus reset but never move the transaction back to
> STATE_PENDING, so both loops keep resending without a retry limit
> until sending fails.
> 
> As Takashi suggested, v2 no longer resends: on a bus reset the
> transaction is ended and -EAGAIN is returned, following the AV/C
> general specification, which says that a target discards any
> transaction in progress on a bus reset.
> 
> Found with a static analysis tool and checked by hand. Compile tested
> only (x86_64, W=1); I don't have FireWire audio hardware.
> 
> Changes in v2:
> - Abort the transaction and return -EAGAIN on a bus reset instead of
>   rearming it and resending (Takashi).
> - Drop ERROR_DELAY_MS (and <linux/delay.h> in fcp.c), now unused.
> 
> v1: https://lore.kernel.org/all/20261120-firewire-busreset-v1-0-8bb9079a2984@gmail.com/
> ---
> Suyuan Wang (2):
>       ALSA: firewire-lib: Abort the FCP transaction on a bus reset
>       ALSA: fireworks: Abort the transaction on a bus reset

Applied both patches now.  Thanks.


Takashi
Re: [PATCH v2 0/2] ALSA: firewire: Abort transactions on a bus reset
Posted by Takashi Sakamoto 1 day, 2 hours ago
Hi,

On Sun, Nov 22, 2026 at 01:46:28PM +0000, Suyuan Wang via B4 Relay wrote:
> fcp_avc_transaction() and snd_efw_transaction_run() resend their
> command after a bus reset but never move the transaction back to
> STATE_PENDING, so both loops keep resending without a retry limit
> until sending fails.
> 
> As Takashi suggested, v2 no longer resends: on a bus reset the
> transaction is ended and -EAGAIN is returned, following the AV/C
> general specification, which says that a target discards any
> transaction in progress on a bus reset.
> 
> Found with a static analysis tool and checked by hand. Compile tested
> only (x86_64, W=1); I don't have FireWire audio hardware.
> 
> Changes in v2:
> - Abort the transaction and return -EAGAIN on a bus reset instead of
>   rearming it and resending (Takashi).
> - Drop ERROR_DELAY_MS (and <linux/delay.h> in fcp.c), now unused.
> 
> v1: https://lore.kernel.org/all/20261120-firewire-busreset-v1-0-8bb9079a2984@gmail.com/
> ---
> Suyuan Wang (2):
>       ALSA: firewire-lib: Abort the FCP transaction on a bus reset
>       ALSA: fireworks: Abort the transaction on a bus reset
> 
>  sound/firewire/fcp.c                             | 5 ++---
>  sound/firewire/fireworks/fireworks_transaction.c | 4 ++--
>  2 files changed, 4 insertions(+), 5 deletions(-)

Looks good to me.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>


Thanks

Takashi Sakamoto