Re: [PATCH v2] ALSA: firewire-tascam: Do not drop unread control events

From: Takashi Iwai

Date: Mon May 04 2026 - 07:30:36 EST


On Mon, 04 May 2026 02:55:52 +0200,
Cássio Gabriel wrote:
>
> tscm_hwdep_read_queue() copies as many queued control events as fit in
> the userspace buffer. When the buffer is smaller than the current
> contiguous queue segment, length is rounded down to the number of bytes
> that can be copied.
>
> However, after copying that shortened length, the code advances pull_pos
> to the original tail_pos, marking the whole contiguous segment as
> consumed. Any events between the copied portion and tail_pos are lost.
>
> Limit tail_pos to the position after the entries actually copied before
> updating pull_pos. When the whole segment fits, this is equivalent to the
> old tail_pos update; when the buffer is smaller, the remaining events
> stay queued for the next read.
>
> Fixes: a8c0d13267a4 ("ALSA: firewire-tascam: notify events of change of state for userspace applications")
> Cc: stable@xxxxxxxxxxxxxxx
> Suggested-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@xxxxxxxxx>

Applied now. Thanks.


Takashi