kernel/0187-fix-Resolve-the-i2s-driver-crash-issue.patch

76 lines
2.9 KiB
Diff

From 4a1e9e19a419e67b4292e957eb768d13a5fb5cb5 Mon Sep 17 00:00:00 2001
From: denglei <denglei@eswincomputing.com>
Date: Mon, 14 Oct 2024 14:35:38 +0800
Subject: [PATCH 187/219] fix:Resolve the i2s driver crash issue.
Changelogs:
When async_tx and async_tx_dma are enabled, the async module will occupy all DMA channels,
causing i2s to fail to request for DMA channels.
Signed-off-by: denglei <denglei@eswincomputing.com>
---
.../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 4 ++++
sound/soc/eswin/esw-i2s.c | 24 ++-----------------
2 files changed, 6 insertions(+), 22 deletions(-)
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index cddc9a612ee3..6700a9b44f0f 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1564,6 +1564,10 @@ static int dw_probe(struct platform_device *pdev)
dma_cap_set(DMA_SLAVE, dw->dma.cap_mask);
dma_cap_set(DMA_CYCLIC, dw->dma.cap_mask);
+ if (of_node_name_prefix(chip->dev->of_node, "dma-controller-aon")) {
+ dma_cap_set(DMA_PRIVATE, dw->dma.cap_mask);
+ }
+
/* DMA capabilities */
dw->dma.max_burst = hdata->axi_rw_burst_len;
dw->dma.src_addr_widths = AXI_DMA_BUSWIDTHS;
diff --git a/sound/soc/eswin/esw-i2s.c b/sound/soc/eswin/esw-i2s.c
index 4c5d33faade4..5774a03a270b 100755
--- a/sound/soc/eswin/esw-i2s.c
+++ b/sound/soc/eswin/esw-i2s.c
@@ -334,17 +334,7 @@ static int i2s_configure_res_by_dt(struct i2s_dev *dev,
dev->play_dma_data.addr_width = bus_widths[idx];
dev->play_dma_data.fifo_size = fifo_depth *
(fifo_width[idx2]) >> 3;
- if (of_node_name_prefix(pcm->chan[SNDRV_PCM_STREAM_PLAYBACK]->device->dev->of_node,
- "dma-controller-hsp")) {
- dev->play_dma_data.addr = dma_map_resource(
- pcm->chan[SNDRV_PCM_STREAM_PLAYBACK]->device->dev,
- res->start + TXDMA_CH(0),
- dev->play_dma_data.fifo_size,
- DMA_BIDIRECTIONAL,
- DMA_ATTR_SKIP_CPU_SYNC);
- } else {
- dev->play_dma_data.addr = res->start + TXDMA_CH(0);
- }
+ dev->play_dma_data.addr = res->start + TXDMA_CH(0);
dev->play_dma_data.maxburst = 16;
}
if (COMP1_RX_ENABLED(comp1)) {
@@ -354,17 +344,7 @@ static int i2s_configure_res_by_dt(struct i2s_dev *dev,
dev->capture_dma_data.addr_width = bus_widths[idx];
dev->capture_dma_data.fifo_size = fifo_depth *
(fifo_width[idx2]) >> 3;
- if (of_node_name_prefix(pcm->chan[SNDRV_PCM_STREAM_CAPTURE]->device->dev->of_node,
- "dma-controller-hsp")) {
- dev->capture_dma_data.addr = dma_map_resource(
- pcm->chan[SNDRV_PCM_STREAM_CAPTURE]->device->dev,
- res->start + RXDMA_CH(0),
- dev->capture_dma_data.fifo_size,
- DMA_BIDIRECTIONAL,
- DMA_ATTR_SKIP_CPU_SYNC);
- } else {
- dev->capture_dma_data.addr = res->start + RXDMA_CH(0);
- }
+ dev->capture_dma_data.addr = res->start + RXDMA_CH(0);
dev->capture_dma_data.maxburst = 16;
}
return 0;
--
2.47.0