* [PATCH] ALSA: intel_hdmi: Fix reference to PCM buffer address
@ 2022-03-02 7:42 Zhen Ni
2022-03-02 8:27 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Zhen Ni @ 2022-03-02 7:42 UTC (permalink / raw)
To: perex, tiwai; +Cc: alsa-devel, linux-kernel, Zhen Ni
PCM buffers might be allocated dynamically when the buffer
preallocation failed or a larger buffer is requested, and it's not
guaranteed that substream->dma_buffer points to the actually used
buffer. The driver needs to refer to substream->runtime->dma_addr
instead for the buffer address.
Signed-off-by: Zhen Ni <nizhen@uniontech.com>
---
sound/x86/intel_hdmi_audio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index 1c94eaff1931..4a3ff6468aa7 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -1261,7 +1261,7 @@ static int had_pcm_mmap(struct snd_pcm_substream *substream,
{
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
return remap_pfn_range(vma, vma->vm_start,
- substream->dma_buffer.addr >> PAGE_SHIFT,
+ substream->runtime->dma_addr >> PAGE_SHIFT,
vma->vm_end - vma->vm_start, vma->vm_page_prot);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ALSA: intel_hdmi: Fix reference to PCM buffer address
2022-03-02 7:42 [PATCH] ALSA: intel_hdmi: Fix reference to PCM buffer address Zhen Ni
@ 2022-03-02 8:27 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2022-03-02 8:27 UTC (permalink / raw)
To: Zhen Ni; +Cc: perex, tiwai, alsa-devel, linux-kernel
On Wed, 02 Mar 2022 08:42:41 +0100,
Zhen Ni wrote:
>
> PCM buffers might be allocated dynamically when the buffer
> preallocation failed or a larger buffer is requested, and it's not
> guaranteed that substream->dma_buffer points to the actually used
> buffer. The driver needs to refer to substream->runtime->dma_addr
> instead for the buffer address.
>
> Signed-off-by: Zhen Ni <nizhen@uniontech.com>
Thanks, applied now with Cc-to-stable.
I guess the had_pcm_mmap() can be dropped completely and replaced with
the standard mmap helper, as what we really want is rather wc.
But it can be done for 5.18.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-02 8:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-02 7:42 [PATCH] ALSA: intel_hdmi: Fix reference to PCM buffer address Zhen Ni
2022-03-02 8:27 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox