Re: [PATCH v1] dmaengine: dw: balance PM runtime calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2014-12-22 at 20:36 +0530, Vinod Koul wrote:
> On Tue, Dec 16, 2014 at 11:40:01AM +0200, Andy Shevchenko wrote:
> > In case of the 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.
> Hmmm, sorry but it is not clear to me how moving it from core to platform
> helps solve the problem.

In case of PCI driver we already have runtime PM enabled, meanwhile it's
not true for an ACPI case (since there is no _PS0 / _PS3 methods for the
DMA device).

>  Also this make more sense in core as it can be
> common acorss various devices

We can enable it if it was disabled.

> 
> -- 
> ~Vinod
> 
> > 
> > Fixes: bb32baf76e56 (dmaengine: dw: enable runtime PM)
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > ---
> > Vinod, this is a material for v3.19-rc1. Could you, please, review and apply?
> > 
> >  drivers/dma/dw/core.c     | 2 --
> >  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 bbae202..dcf19f0 100644
> > --- a/drivers/dma/dw/core.c
> > +++ b/drivers/dma/dw/core.c
> > @@ -1569,7 +1569,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
> >  	dw->type = chip->type;
> >  	chip->dw = dw;
> >  
> > -	pm_runtime_enable(chip->dev);
> >  	pm_runtime_get_sync(chip->dev);
> >  
> >  	dw_params = dma_read_byaddr(chip->regs, DW_PARAMS);
> > @@ -1768,7 +1767,6 @@ int dw_dma_remove(struct dw_dma_chip *chip)
> >  	}
> >  
> >  	pm_runtime_put_sync_suspend(chip->dev);
> > -	pm_runtime_disable(chip->dev);
> >  	return 0;
> >  }
> >  EXPORT_SYMBOL_GPL(dw_dma_remove);
> > diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
> > index 42036dd..7edc99f 100644
> > --- a/drivers/dma/dw/platform.c
> > +++ b/drivers/dma/dw/platform.c
> > @@ -15,6 +15,7 @@
> >  #include <linux/module.h>
> >  #include <linux/device.h>
> >  #include <linux/clk.h>
> > +#include <linux/pm_runtime.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/dmaengine.h>
> >  #include <linux/dma-mapping.h>
> > @@ -187,6 +188,8 @@ static int dw_probe(struct platform_device *pdev)
> >  	if (err)
> >  		return err;
> >  
> > +	pm_runtime_enable(&pdev->dev);
> > +
> >  	err = dw_dma_probe(chip, pdata);
> >  	if (err)
> >  		goto err_dw_dma_probe;
> > @@ -207,6 +210,7 @@ static int dw_probe(struct platform_device *pdev)
> >  	return 0;
> >  
> >  err_dw_dma_probe:
> > +	pm_runtime_disable(&pdev->dev);
> >  	clk_disable_unprepare(chip->clk);
> >  	return err;
> >  }
> > @@ -219,6 +223,7 @@ static int dw_remove(struct platform_device *pdev)
> >  		of_dma_controller_free(pdev->dev.of_node);
> >  
> >  	dw_dma_remove(chip);
> > +	pm_runtime_disable(&pdev->dev);
> >  	clk_disable_unprepare(chip->clk);
> >  
> >  	return 0;
> > -- 
> > 2.1.3
> > 
> 


-- 
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
Intel Finland Oy
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
��.n��������+%������w��{.n��������)�)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux