diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2018-01-17 04:38:28 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-01-17 06:46:18 -0500 |
commit | 1131b0a4af911de50b22239cabdf6dcd3f15df15 (patch) | |
tree | f2b41a7750240e9b338ca28679e220e06e31591e | |
parent | 617fcb673090e495f58565ff0171d07abdad53a7 (diff) |
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: 17218e0092f8 "PM / genpd: Stop/start devices without pm_runtime_force_suspend/resume()"
Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/dma/sh/rcar-dmac.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 2b2c7db3e480..35c3936edc45 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c | |||
@@ -1615,22 +1615,6 @@ static struct dma_chan *rcar_dmac_of_xlate(struct of_phandle_args *dma_spec, | |||
1615 | * Power management | 1615 | * Power management |
1616 | */ | 1616 | */ |
1617 | 1617 | ||
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 | |||
1634 | #ifdef CONFIG_PM | 1618 | #ifdef CONFIG_PM |
1635 | static int rcar_dmac_runtime_suspend(struct device *dev) | 1619 | static int rcar_dmac_runtime_suspend(struct device *dev) |
1636 | { | 1620 | { |
@@ -1646,7 +1630,13 @@ static int rcar_dmac_runtime_resume(struct device *dev) | |||
1646 | #endif | 1630 | #endif |
1647 | 1631 | ||
1648 | static const struct dev_pm_ops rcar_dmac_pm = { | 1632 | 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) | ||
1650 | SET_RUNTIME_PM_OPS(rcar_dmac_runtime_suspend, rcar_dmac_runtime_resume, | 1640 | SET_RUNTIME_PM_OPS(rcar_dmac_runtime_suspend, rcar_dmac_runtime_resume, |
1651 | NULL) | 1641 | NULL) |
1652 | }; | 1642 | }; |