Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-28 Thread Jon Hunter
On 25/08/15 23:46, Rafael J. Wysocki wrote: > On 8/25/2015 11:37 AM, Jon Hunter wrote: [snip] >> Vinod, thinking about this some more, I am wondering if it is just >> better to get rid of the suspend/resume callbacks and simply handling >> the state in the runtime suspend/resume callbacks. I

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-28 Thread Jon Hunter
On 25/08/15 23:46, Rafael J. Wysocki wrote: On 8/25/2015 11:37 AM, Jon Hunter wrote: [snip] Vinod, thinking about this some more, I am wondering if it is just better to get rid of the suspend/resume callbacks and simply handling the state in the runtime suspend/resume callbacks. I think

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-25 Thread Rafael J. Wysocki
On 8/25/2015 11:37 AM, Jon Hunter wrote: On 25/08/15 01:04, Rafael J. Wysocki wrote: On Monday, August 24, 2015 07:51:43 PM Vinod Koul wrote: On Mon, Aug 24, 2015 at 02:22:49PM +0100, Jon Hunter wrote: On 24/08/15 10:22, Vinod Koul wrote: On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-25 Thread Jon Hunter
On 25/08/15 01:04, Rafael J. Wysocki wrote: > On Monday, August 24, 2015 07:51:43 PM Vinod Koul wrote: >> On Mon, Aug 24, 2015 at 02:22:49PM +0100, Jon Hunter wrote: >>> >>> On 24/08/15 10:22, Vinod Koul wrote: On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter wrote: > > On

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-25 Thread Jon Hunter
On 25/08/15 01:04, Rafael J. Wysocki wrote: On Monday, August 24, 2015 07:51:43 PM Vinod Koul wrote: On Mon, Aug 24, 2015 at 02:22:49PM +0100, Jon Hunter wrote: On 24/08/15 10:22, Vinod Koul wrote: On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter wrote: On 23/08/15 15:17, Vinod Koul

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-25 Thread Rafael J. Wysocki
On 8/25/2015 11:37 AM, Jon Hunter wrote: On 25/08/15 01:04, Rafael J. Wysocki wrote: On Monday, August 24, 2015 07:51:43 PM Vinod Koul wrote: On Mon, Aug 24, 2015 at 02:22:49PM +0100, Jon Hunter wrote: On 24/08/15 10:22, Vinod Koul wrote: On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-24 Thread Rafael J. Wysocki
On Monday, August 24, 2015 07:51:43 PM Vinod Koul wrote: > On Mon, Aug 24, 2015 at 02:22:49PM +0100, Jon Hunter wrote: > > > > On 24/08/15 10:22, Vinod Koul wrote: > > > On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter wrote: > > >> > > >> On 23/08/15 15:17, Vinod Koul wrote: > > >>> On Tue,

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-24 Thread Vinod Koul
On Mon, Aug 24, 2015 at 02:22:49PM +0100, Jon Hunter wrote: > > On 24/08/15 10:22, Vinod Koul wrote: > > On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter wrote: > >> > >> On 23/08/15 15:17, Vinod Koul wrote: > >>> On Tue, Aug 18, 2015 at 02:49:09PM +0100, Jon Hunter wrote: > >>> > @@

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-24 Thread Jon Hunter
On 24/08/15 10:22, Vinod Koul wrote: > On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter wrote: >> >> On 23/08/15 15:17, Vinod Koul wrote: >>> On Tue, Aug 18, 2015 at 02:49:09PM +0100, Jon Hunter wrote: >>> @@ -1543,7 +1531,7 @@ static int tegra_dma_pm_suspend(struct device *dev)

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-24 Thread Vinod Koul
On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter wrote: > > On 23/08/15 15:17, Vinod Koul wrote: > > On Tue, Aug 18, 2015 at 02:49:09PM +0100, Jon Hunter wrote: > > > >> @@ -1543,7 +1531,7 @@ static int tegra_dma_pm_suspend(struct device *dev) > >>int ret; > >> > >>/* Enable clock

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-24 Thread Jon Hunter
On 23/08/15 15:17, Vinod Koul wrote: > On Tue, Aug 18, 2015 at 02:49:09PM +0100, Jon Hunter wrote: > >> @@ -1543,7 +1531,7 @@ static int tegra_dma_pm_suspend(struct device *dev) >> int ret; >> >> /* Enable clock before accessing register */ >> -ret =

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-24 Thread Jon Hunter
On 24/08/15 10:22, Vinod Koul wrote: On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter wrote: On 23/08/15 15:17, Vinod Koul wrote: On Tue, Aug 18, 2015 at 02:49:09PM +0100, Jon Hunter wrote: @@ -1543,7 +1531,7 @@ static int tegra_dma_pm_suspend(struct device *dev) int ret; /*

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-24 Thread Vinod Koul
On Mon, Aug 24, 2015 at 02:22:49PM +0100, Jon Hunter wrote: On 24/08/15 10:22, Vinod Koul wrote: On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter wrote: On 23/08/15 15:17, Vinod Koul wrote: On Tue, Aug 18, 2015 at 02:49:09PM +0100, Jon Hunter wrote: @@ -1543,7 +1531,7 @@ static

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-24 Thread Jon Hunter
On 23/08/15 15:17, Vinod Koul wrote: On Tue, Aug 18, 2015 at 02:49:09PM +0100, Jon Hunter wrote: @@ -1543,7 +1531,7 @@ static int tegra_dma_pm_suspend(struct device *dev) int ret; /* Enable clock before accessing register */ -ret = tegra_dma_runtime_resume(dev); +ret

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-24 Thread Vinod Koul
On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter wrote: On 23/08/15 15:17, Vinod Koul wrote: On Tue, Aug 18, 2015 at 02:49:09PM +0100, Jon Hunter wrote: @@ -1543,7 +1531,7 @@ static int tegra_dma_pm_suspend(struct device *dev) int ret; /* Enable clock before accessing

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-24 Thread Rafael J. Wysocki
On Monday, August 24, 2015 07:51:43 PM Vinod Koul wrote: On Mon, Aug 24, 2015 at 02:22:49PM +0100, Jon Hunter wrote: On 24/08/15 10:22, Vinod Koul wrote: On Mon, Aug 24, 2015 at 09:47:13AM +0100, Jon Hunter wrote: On 23/08/15 15:17, Vinod Koul wrote: On Tue, Aug 18, 2015 at

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-23 Thread Vinod Koul
On Tue, Aug 18, 2015 at 02:49:09PM +0100, Jon Hunter wrote: > @@ -1543,7 +1531,7 @@ static int tegra_dma_pm_suspend(struct device *dev) > int ret; > > /* Enable clock before accessing register */ > - ret = tegra_dma_runtime_resume(dev); > + ret = pm_runtime_get_sync(dev);

Re: [RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-23 Thread Vinod Koul
On Tue, Aug 18, 2015 at 02:49:09PM +0100, Jon Hunter wrote: @@ -1543,7 +1531,7 @@ static int tegra_dma_pm_suspend(struct device *dev) int ret; /* Enable clock before accessing register */ - ret = tegra_dma_runtime_resume(dev); + ret = pm_runtime_get_sync(dev); why is

[RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-18 Thread Jon Hunter
The tegra-apb DMA driver enables runtime-pm but never calls pm_runtime_get/put and hence the runtime-pm callbacks are never invoked. The driver manages the clocks by directly calling clk_prepare_enable() and clk_unprepare_disable(). Fix this by replacing the clk_prepare_enable() and

[RFC PATCH 1/7] DMA: tegra-apb: Correct runtime-pm usage

2015-08-18 Thread Jon Hunter
The tegra-apb DMA driver enables runtime-pm but never calls pm_runtime_get/put and hence the runtime-pm callbacks are never invoked. The driver manages the clocks by directly calling clk_prepare_enable() and clk_unprepare_disable(). Fix this by replacing the clk_prepare_enable() and