diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0582-amd-i2s-fix-to-the-fage-fault-when-iommu-is-enabled.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0582-amd-i2s-fix-to-the-fage-fault-when-iommu-is-enabled.patch | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0582-amd-i2s-fix-to-the-fage-fault-when-iommu-is-enabled.patch b/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0582-amd-i2s-fix-to-the-fage-fault-when-iommu-is-enabled.patch new file mode 100644 index 00000000..3dfb2eb0 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0582-amd-i2s-fix-to-the-fage-fault-when-iommu-is-enabled.patch @@ -0,0 +1,91 @@ +From 1611ff1a3d6b1f9da9dad8231f42f28686df4339 Mon Sep 17 00:00:00 2001 +From: Sudheesh Mavila <sudheesh.mavila@amd.com> +Date: Thu, 24 Jan 2019 11:06:06 +0530 +Subject: [PATCH 0582/2940] amd-i2s fix to the fage fault when iommu is enabled + +Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com> +--- + sound/soc/amd/raven/acp3x-pcm-dma.c | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c +index 3faf3456e35b..23b0fe631a5b 100755 +--- a/sound/soc/amd/raven/acp3x-pcm-dma.c ++++ b/sound/soc/amd/raven/acp3x-pcm-dma.c +@@ -41,7 +41,7 @@ struct i2s_stream_instance { + u16 channels; + u32 xfer_resolution; + u32 val; +- struct page *pg; ++ dma_addr_t dma_addr; + void __iomem *acp3x_base; + }; + +@@ -225,10 +225,10 @@ static irqreturn_t i2s_irq_handler(int irq, void *dev_id) + static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction) + { + u16 page_idx; +- u64 addr; + u32 low, high, val, acp_fifo_addr; +- struct page *pg = rtd->pg; ++ dma_addr_t addr; + ++ addr = rtd->dma_addr; + /* 8 scratch registers used to map one 64 bit address. + * For 2 pages (8192 * 2 bytes), it will be 16 registers. + */ +@@ -239,7 +239,6 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction) + + for (page_idx = 0; page_idx < rtd->num_pages; page_idx++) { + /* Load the low address of page int ACP SRAM through SRBM */ +- addr = page_to_phys(pg); + low = lower_32_bits(addr); + high = upper_32_bits(addr); + +@@ -249,7 +248,7 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction) + + 4); + /* Move to next physically contiguos page */ + val += 8; +- pg++; ++ addr += PAGE_SIZE; + } + + if (direction == SNDRV_PCM_STREAM_PLAYBACK) { +@@ -338,7 +337,6 @@ static int acp3x_dma_hw_params(struct snd_pcm_substream *substream, + int status; + uint64_t size; + struct snd_dma_buffer *dma_buffer; +- struct page *pg; + struct i2s_stream_instance *rtd = substream->runtime->private_data; + + if (rtd == NULL) +@@ -351,9 +349,8 @@ static int acp3x_dma_hw_params(struct snd_pcm_substream *substream, + return status; + + memset(substream->runtime->dma_area, 0, params_buffer_bytes(params)); +- pg = virt_to_page(substream->dma_buffer.area); +- if (pg != NULL) { +- rtd->pg = pg; ++ if (substream->dma_buffer.area) { ++ rtd->dma_addr = substream->dma_buffer.addr; + rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); + config_acp3x_dma(rtd, substream->stream); + status = 0; +@@ -383,9 +380,13 @@ static snd_pcm_uframes_t acp3x_dma_pointer(struct snd_pcm_substream *substream) + + static int acp3x_dma_new(struct snd_soc_pcm_runtime *rtd) + { ++ struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, ++ DRV_NAME); ++ struct device *parent = component->dev->parent; ++ + return snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, + SNDRV_DMA_TYPE_DEV, +- NULL, MIN_BUFFER, ++ parent, MIN_BUFFER, + MAX_BUFFER); + } + +-- +2.17.1 + |