Commit 23f49fd2 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Vinod Koul

dmaengine: edma: Remove dynamic TPTC power management feature

The dynamic or on demand pm_runtime does not work correctly on am335x and
am437x due to interference with hwmod.
Fall back using the pm_runtime usage as it was in the old driver stack,
meaning that at probe time call pm_runtime_enable() and
pm_runtime_get_sync() for the TPTCs as well.

Fixes: 1be5336b ("dmaengine: edma: New device tree binding")
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Reported-by: default avatarTero Kristo <t-kristo@ti.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent f55532a0
...@@ -1570,32 +1570,6 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data) ...@@ -1570,32 +1570,6 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void edma_tc_set_pm_state(struct edma_tc *tc, bool enable)
{
struct platform_device *tc_pdev;
int ret;
if (!IS_ENABLED(CONFIG_OF) || !tc)
return;
tc_pdev = of_find_device_by_node(tc->node);
if (!tc_pdev) {
pr_err("%s: TPTC device is not found\n", __func__);
return;
}
if (!pm_runtime_enabled(&tc_pdev->dev))
pm_runtime_enable(&tc_pdev->dev);
if (enable)
ret = pm_runtime_get_sync(&tc_pdev->dev);
else
ret = pm_runtime_put_sync(&tc_pdev->dev);
if (ret < 0)
pr_err("%s: pm_runtime_%s_sync() failed for %s\n", __func__,
enable ? "get" : "put", dev_name(&tc_pdev->dev));
}
/* Alloc channel resources */ /* Alloc channel resources */
static int edma_alloc_chan_resources(struct dma_chan *chan) static int edma_alloc_chan_resources(struct dma_chan *chan)
{ {
...@@ -1632,8 +1606,6 @@ static int edma_alloc_chan_resources(struct dma_chan *chan) ...@@ -1632,8 +1606,6 @@ static int edma_alloc_chan_resources(struct dma_chan *chan)
EDMA_CHAN_SLOT(echan->ch_num), chan->chan_id, EDMA_CHAN_SLOT(echan->ch_num), chan->chan_id,
echan->hw_triggered ? "HW" : "SW"); echan->hw_triggered ? "HW" : "SW");
edma_tc_set_pm_state(echan->tc, true);
return 0; return 0;
err_slot: err_slot:
...@@ -1670,7 +1642,6 @@ static void edma_free_chan_resources(struct dma_chan *chan) ...@@ -1670,7 +1642,6 @@ static void edma_free_chan_resources(struct dma_chan *chan)
echan->alloced = false; echan->alloced = false;
} }
edma_tc_set_pm_state(echan->tc, false);
echan->tc = NULL; echan->tc = NULL;
echan->hw_triggered = false; echan->hw_triggered = false;
...@@ -2417,10 +2388,8 @@ static int edma_pm_suspend(struct device *dev) ...@@ -2417,10 +2388,8 @@ static int edma_pm_suspend(struct device *dev)
int i; int i;
for (i = 0; i < ecc->num_channels; i++) { for (i = 0; i < ecc->num_channels; i++) {
if (echan[i].alloced) { if (echan[i].alloced)
edma_setup_interrupt(&echan[i], false); edma_setup_interrupt(&echan[i], false);
edma_tc_set_pm_state(echan[i].tc, false);
}
} }
return 0; return 0;
...@@ -2450,8 +2419,6 @@ static int edma_pm_resume(struct device *dev) ...@@ -2450,8 +2419,6 @@ static int edma_pm_resume(struct device *dev)
/* Set up channel -> slot mapping for the entry slot */ /* Set up channel -> slot mapping for the entry slot */
edma_set_chmap(&echan[i], echan[i].slot[0]); edma_set_chmap(&echan[i], echan[i].slot[0]);
edma_tc_set_pm_state(echan[i].tc, true);
} }
} }
...@@ -2475,7 +2442,8 @@ static struct platform_driver edma_driver = { ...@@ -2475,7 +2442,8 @@ static struct platform_driver edma_driver = {
static int edma_tptc_probe(struct platform_device *pdev) static int edma_tptc_probe(struct platform_device *pdev)
{ {
return 0; pm_runtime_enable(&pdev->dev);
return pm_runtime_get_sync(&pdev->dev);
} }
static struct platform_driver edma_tptc_driver = { static struct platform_driver edma_tptc_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment