Skip to content

Commit 23f49fd

Browse files
Peter UjfalusiVinod Koul
authored andcommitted
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: 1be5336 ("dmaengine: edma: New device tree binding") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reported-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
1 parent f55532a commit 23f49fd

File tree

1 file changed

+3
-35
lines changed

1 file changed

+3
-35
lines changed

drivers/dma/edma.c

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,32 +1570,6 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data)
15701570
return IRQ_HANDLED;
15711571
}
15721572

1573-
static void edma_tc_set_pm_state(struct edma_tc *tc, bool enable)
1574-
{
1575-
struct platform_device *tc_pdev;
1576-
int ret;
1577-
1578-
if (!IS_ENABLED(CONFIG_OF) || !tc)
1579-
return;
1580-
1581-
tc_pdev = of_find_device_by_node(tc->node);
1582-
if (!tc_pdev) {
1583-
pr_err("%s: TPTC device is not found\n", __func__);
1584-
return;
1585-
}
1586-
if (!pm_runtime_enabled(&tc_pdev->dev))
1587-
pm_runtime_enable(&tc_pdev->dev);
1588-
1589-
if (enable)
1590-
ret = pm_runtime_get_sync(&tc_pdev->dev);
1591-
else
1592-
ret = pm_runtime_put_sync(&tc_pdev->dev);
1593-
1594-
if (ret < 0)
1595-
pr_err("%s: pm_runtime_%s_sync() failed for %s\n", __func__,
1596-
enable ? "get" : "put", dev_name(&tc_pdev->dev));
1597-
}
1598-
15991573
/* Alloc channel resources */
16001574
static int edma_alloc_chan_resources(struct dma_chan *chan)
16011575
{
@@ -1632,8 +1606,6 @@ static int edma_alloc_chan_resources(struct dma_chan *chan)
16321606
EDMA_CHAN_SLOT(echan->ch_num), chan->chan_id,
16331607
echan->hw_triggered ? "HW" : "SW");
16341608

1635-
edma_tc_set_pm_state(echan->tc, true);
1636-
16371609
return 0;
16381610

16391611
err_slot:
@@ -1670,7 +1642,6 @@ static void edma_free_chan_resources(struct dma_chan *chan)
16701642
echan->alloced = false;
16711643
}
16721644

1673-
edma_tc_set_pm_state(echan->tc, false);
16741645
echan->tc = NULL;
16751646
echan->hw_triggered = false;
16761647

@@ -2417,10 +2388,8 @@ static int edma_pm_suspend(struct device *dev)
24172388
int i;
24182389

24192390
for (i = 0; i < ecc->num_channels; i++) {
2420-
if (echan[i].alloced) {
2391+
if (echan[i].alloced)
24212392
edma_setup_interrupt(&echan[i], false);
2422-
edma_tc_set_pm_state(echan[i].tc, false);
2423-
}
24242393
}
24252394

24262395
return 0;
@@ -2450,8 +2419,6 @@ static int edma_pm_resume(struct device *dev)
24502419

24512420
/* Set up channel -> slot mapping for the entry slot */
24522421
edma_set_chmap(&echan[i], echan[i].slot[0]);
2453-
2454-
edma_tc_set_pm_state(echan[i].tc, true);
24552422
}
24562423
}
24572424

@@ -2475,7 +2442,8 @@ static struct platform_driver edma_driver = {
24752442

24762443
static int edma_tptc_probe(struct platform_device *pdev)
24772444
{
2478-
return 0;
2445+
pm_runtime_enable(&pdev->dev);
2446+
return pm_runtime_get_sync(&pdev->dev);
24792447
}
24802448

24812449
static struct platform_driver edma_tptc_driver = {

0 commit comments

Comments
 (0)