Re: [PATCH 2/2] ALSA: compress: Propagate real pointer errors in avail paths

From: Mark Brown

Date: Tue Apr 14 2026 - 12:53:59 EST


On Tue, Apr 14, 2026 at 01:47:54PM -0300, Cássio Gabriel wrote:

> Commit 61327f3d817c ("ALSA: compress: Pay attention if drivers
> error out retrieving pointers") made snd_compr_update_tstamp()
> return driver pointer() failures, but snd_compr_calc_avail()
> still ignores that status and continues with stale runtime
> counters.

> The fallback for an unsupported pointer callback remains
> intentional, so keep ignoring -EOPNOTSUPP there. Propagate
> real pointer-refresh failures instead.

> -static size_t snd_compr_calc_avail(struct snd_compr_stream *stream,
> - struct snd_compr_avail64 *avail)
> +static int snd_compr_calc_avail(struct snd_compr_stream *stream,
> + struct snd_compr_avail64 *avail)
> {
> + int ret;
> +
> memset(avail, 0, sizeof(*avail));
> - snd_compr_update_tstamp(stream, &avail->tstamp);
> - /* Still need to return avail even if tstamp can't be filled in */
> + ret = snd_compr_update_tstamp(stream, &avail->tstamp);
> + if (ret < 0 && ret != -EOPNOTSUPP)
> + return ret;
> + /* Still need to return avail when no timestamp is available */

It's not clear to me that the intent there is to only ignore in the case
where we fail to update due to the operation not being supported rather
than to also ignore any other runtime errors we might encounter (eg, due
to the stream configuration).

Attachment: signature.asc
Description: PGP signature