Skip to content

Commit 1131b0a

Browse files
geerturafaeljw
authored andcommitted
dmaengine: rcar-dmac: Make DMAC reinit during system resume explicit
The current (empty) system sleep callbacks rely on the PM core to force a runtime resume to reinitialize the DMAC registers during system resume. Without a reinitialization, e.g. SCIF DMA will hang silently after a system resume on R-Car Gen3. Make this explicit by using pm_runtime_force_{suspend,resume}() as the system sleep callbacks instead. Use SET_LATE_SYSTEM_SLEEP_PM_OPS() as DMA engines must be initialized before all DMA slave devices. Fixes: 17218e0 "PM / genpd: Stop/start devices without pm_runtime_force_suspend/resume()" Suggested-by: Ulf Hansson <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Acked-by: Vinod Koul <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 617fcb6 commit 1131b0a

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

drivers/dma/sh/rcar-dmac.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,22 +1615,6 @@ static struct dma_chan *rcar_dmac_of_xlate(struct of_phandle_args *dma_spec,
16151615
* Power management
16161616
*/
16171617

1618-
#ifdef CONFIG_PM_SLEEP
1619-
static int rcar_dmac_sleep_suspend(struct device *dev)
1620-
{
1621-
/*
1622-
* TODO: Wait for the current transfer to complete and stop the device.
1623-
*/
1624-
return 0;
1625-
}
1626-
1627-
static int rcar_dmac_sleep_resume(struct device *dev)
1628-
{
1629-
/* TODO: Resume transfers, if any. */
1630-
return 0;
1631-
}
1632-
#endif
1633-
16341618
#ifdef CONFIG_PM
16351619
static int rcar_dmac_runtime_suspend(struct device *dev)
16361620
{
@@ -1646,7 +1630,13 @@ static int rcar_dmac_runtime_resume(struct device *dev)
16461630
#endif
16471631

16481632
static const struct dev_pm_ops rcar_dmac_pm = {
1649-
SET_SYSTEM_SLEEP_PM_OPS(rcar_dmac_sleep_suspend, rcar_dmac_sleep_resume)
1633+
/*
1634+
* TODO for system sleep/resume:
1635+
* - Wait for the current transfer to complete and stop the device,
1636+
* - Resume transfers, if any.
1637+
*/
1638+
SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1639+
pm_runtime_force_resume)
16501640
SET_RUNTIME_PM_OPS(rcar_dmac_runtime_suspend, rcar_dmac_runtime_resume,
16511641
NULL)
16521642
};

0 commit comments

Comments
 (0)