summaryrefslogtreecommitdiffstats
path: root/drivers/dma/fsl-edma-common.c
diff options
context:
space:
mode:
authorFrank Li <Frank.Li@nxp.com>2024-06-03 17:23:15 +0200
committerVinod Koul <vkoul@kernel.org>2024-06-11 20:25:34 +0200
commit44eb827264de4f14d8317692441e13f5e2aadbf2 (patch)
tree4399a62487e65f86d8ced2da0ab585c61068560e /drivers/dma/fsl-edma-common.c
parentdmaengine: stm32-dma3: defer channel registration to specify channel name (diff)
downloadlinux-44eb827264de4f14d8317692441e13f5e2aadbf2.tar.xz
linux-44eb827264de4f14d8317692441e13f5e2aadbf2.zip
dmaengine: fsl-edma: request per-channel IRQ only when channel is allocated
The edma feature individual IRQs for each DMA channel at some devices. Given the presence of numerous eDMA instances, each with multiple channels, IRQ request during probe results in an extensive list at /proc/interrupts. However, a significant portion of these channels remains unused by the system. Request irq only when a DMA client driver requests a DMA channel. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240603152317.69917-1-Frank.Li@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/fsl-edma-common.c')
-rw-r--r--drivers/dma/fsl-edma-common.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c
index 3af430787315..99107c08f9bf 100644
--- a/drivers/dma/fsl-edma-common.c
+++ b/drivers/dma/fsl-edma-common.c
@@ -805,6 +805,7 @@ void fsl_edma_issue_pending(struct dma_chan *chan)
int fsl_edma_alloc_chan_resources(struct dma_chan *chan)
{
struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan);
+ int ret;
if (fsl_edma_drvflags(fsl_chan) & FSL_EDMA_DRV_HAS_CHCLK)
clk_prepare_enable(fsl_chan->clk);
@@ -813,6 +814,17 @@ int fsl_edma_alloc_chan_resources(struct dma_chan *chan)
fsl_edma_drvflags(fsl_chan) & FSL_EDMA_DRV_TCD64 ?
sizeof(struct fsl_edma_hw_tcd64) : sizeof(struct fsl_edma_hw_tcd),
32, 0);
+
+ if (fsl_chan->txirq) {
+ ret = request_irq(fsl_chan->txirq, fsl_chan->irq_handler, IRQF_SHARED,
+ fsl_chan->chan_name, fsl_chan);
+
+ if (ret) {
+ dma_pool_destroy(fsl_chan->tcd_pool);
+ return ret;
+ }
+ }
+
return 0;
}
@@ -832,6 +844,9 @@ void fsl_edma_free_chan_resources(struct dma_chan *chan)
fsl_edma_unprep_slave_dma(fsl_chan);
spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags);
+ if (fsl_chan->txirq)
+ free_irq(fsl_chan->txirq, fsl_chan);
+
vchan_dma_desc_free_list(&fsl_chan->vchan, &head);
dma_pool_destroy(fsl_chan->tcd_pool);
fsl_chan->tcd_pool = NULL;