Re: [PATCH] ALSA: pcm: Show closed for DISCONNECTED state
From: Takashi Iwai
Date: Fri Jun 19 2026 - 09:34:32 EST
On Fri, 19 Jun 2026 11:29:36 +0200,
Ai Chao wrote:
>
> Hello Takashi
>
> > Right, I suspect that it might be the case.
> > Does the change like below help (or worsen) anything?
>
> We tested this solution and verified its feasibility.
OK, then I'm going to submit a proper patch later.
As it's a bit drastic change and it's already in a merge window for
7.2, I'd postpone the fix for 7.3.
thanks,
Takashi
>
> Thanks,
> Ai Chao
>
> --- a/sound/core/pcm_native.c
> +++ b/sound/core/pcm_native.c
> @@ -3907,6 +3907,8 @@ static vm_fault_t snd_pcm_mmap_data_fault(struct vm_fault *vmf)
> if (substream == NULL)
> return VM_FAULT_SIGBUS;
> runtime = substream->runtime;
> + if (runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
> + return VM_FAULT_SIGBUS;
> offset = vmf->pgoff << PAGE_SHIFT;
> dma_bytes = PAGE_ALIGN(runtime->dma_bytes);
> if (offset > dma_bytes - PAGE_SIZE)
>