Re: [PATCH] ALSA: pcm: use snd_pcm_get_state() in remaining ioctl checks

From: Takashi Iwai

Date: Thu May 07 2026 - 07:00:25 EST


On Thu, 07 May 2026 03:19:44 +0200,
Cen Zhang wrote:
>
> The recent OSS runtime->state locking cleanup converted the OSS I/O
> paths to use snd_pcm_get_state(), but a few ioctl-side checks in
> pcm_native.c still sample runtime->state directly: the prepare
> pre-checks, the early drain open-state check, and the common
> snd_pcm_kernel_ioctl() disconnected check.
>
> Use snd_pcm_get_state() for those remaining samples. In
> snd_pcm_pre_prepare(), keep a single state snapshot and reuse it for
> both the OPEN/DISCONNECTED check and the running-state test.
>
> Signed-off-by: Cen Zhang <zzzccc427@xxxxxxxxx>

Applied to for-next branch. Thanks.


Takashi