diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-01-13 11:57:15 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-01-13 12:37:58 -0500 |
commit | 6acf3998d2c7420b2deb2b475fa78ba7573c6162 (patch) | |
tree | 9e60cdb03beedf64206164a60d2dbf45875e2683 | |
parent | 0ce3c066c49aa0bc3b98c0293f8f28d683dec768 (diff) |
dmaengine: dw: balance PM runtime calls
In case of PCI driver we will get a warning:
dw_dmac_pci 0000:00:18.0: Unbalanced pm_runtime_enable!
dw_dmac_pci 0000:00:18.0: DesignWare DMA Controller, 8 channels
This happens due to pm_runtime_enable() call from the driver when PM runtime is
enabled by core.
This patch moves that call to the platform driver where it might make sense.
Fixes: bb32baf76e56 (dmaengine: dw: enable runtime PM)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/dma/dw/core.c | 2 | ||||
-rw-r--r-- | drivers/dma/dw/platform.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 380478562b7d..5c062548957c 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c | |||
@@ -1505,7 +1505,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) | |||
1505 | dw->regs = chip->regs; | 1505 | dw->regs = chip->regs; |
1506 | chip->dw = dw; | 1506 | chip->dw = dw; |
1507 | 1507 | ||
1508 | pm_runtime_enable(chip->dev); | ||
1509 | pm_runtime_get_sync(chip->dev); | 1508 | pm_runtime_get_sync(chip->dev); |
1510 | 1509 | ||
1511 | dw_params = dma_read_byaddr(chip->regs, DW_PARAMS); | 1510 | dw_params = dma_read_byaddr(chip->regs, DW_PARAMS); |
@@ -1703,7 +1702,6 @@ int dw_dma_remove(struct dw_dma_chip *chip) | |||
1703 | } | 1702 | } |
1704 | 1703 | ||
1705 | pm_runtime_put_sync_suspend(chip->dev); | 1704 | pm_runtime_put_sync_suspend(chip->dev); |
1706 | pm_runtime_disable(chip->dev); | ||
1707 | return 0; | 1705 | return 0; |
1708 | } | 1706 | } |
1709 | EXPORT_SYMBOL_GPL(dw_dma_remove); | 1707 | EXPORT_SYMBOL_GPL(dw_dma_remove); |
diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c index a630161473a4..32ea1aca7a0e 100644 --- a/drivers/dma/dw/platform.c +++ b/drivers/dma/dw/platform.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | #include <linux/pm_runtime.h> | ||
18 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
19 | #include <linux/dmaengine.h> | 20 | #include <linux/dmaengine.h> |
20 | #include <linux/dma-mapping.h> | 21 | #include <linux/dma-mapping.h> |
@@ -185,6 +186,8 @@ static int dw_probe(struct platform_device *pdev) | |||
185 | if (err) | 186 | if (err) |
186 | return err; | 187 | return err; |
187 | 188 | ||
189 | pm_runtime_enable(&pdev->dev); | ||
190 | |||
188 | err = dw_dma_probe(chip, pdata); | 191 | err = dw_dma_probe(chip, pdata); |
189 | if (err) | 192 | if (err) |
190 | goto err_dw_dma_probe; | 193 | goto err_dw_dma_probe; |
@@ -205,6 +208,7 @@ static int dw_probe(struct platform_device *pdev) | |||
205 | return 0; | 208 | return 0; |
206 | 209 | ||
207 | err_dw_dma_probe: | 210 | err_dw_dma_probe: |
211 | pm_runtime_disable(&pdev->dev); | ||
208 | clk_disable_unprepare(chip->clk); | 212 | clk_disable_unprepare(chip->clk); |
209 | return err; | 213 | return err; |
210 | } | 214 | } |
@@ -217,6 +221,7 @@ static int dw_remove(struct platform_device *pdev) | |||
217 | of_dma_controller_free(pdev->dev.of_node); | 221 | of_dma_controller_free(pdev->dev.of_node); |
218 | 222 | ||
219 | dw_dma_remove(chip); | 223 | dw_dma_remove(chip); |
224 | pm_runtime_disable(&pdev->dev); | ||
220 | clk_disable_unprepare(chip->clk); | 225 | clk_disable_unprepare(chip->clk); |
221 | 226 | ||
222 | return 0; | 227 | return 0; |