All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: "G, Manjunath Kondaiah" <manjugk@ti.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Benoit Cousson <b-cousson@ti.com>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>
Subject: Re: [PATCH v3 13/13] OMAP: PM: DMA: Enable runtime pm
Date: Tue, 09 Nov 2010 14:48:25 -0800	[thread overview]
Message-ID: <87fwvajepy.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1288099513-1854-14-git-send-email-manjugk@ti.com> (Manjunath Kondaiah G.'s message of "Tue, 26 Oct 2010 18:55:13 +0530")

"G, Manjunath Kondaiah" <manjugk@ti.com> writes:

> Enable runtime pm and use pm_runtime_get and pm_runtime_put
> for OMAP DMA driver.
>
> Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
> Cc: Benoit Cousson <b-cousson@ti.com>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  arch/arm/plat-omap/dma.c |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
> index 41b14b0..feac7ee 100644
> --- a/arch/arm/plat-omap/dma.c
> +++ b/arch/arm/plat-omap/dma.c
> @@ -35,6 +35,7 @@
>  #include <linux/io.h>
>  #include <linux/slab.h>
>  #include <linux/delay.h>
> +#include <linux/pm_runtime.h>
>  
>  #include <asm/system.h>
>  #include <mach/hardware.h>
> @@ -367,6 +368,8 @@ int omap_request_dma(int dev_id, const char *dev_name,
>  	chan = dma_chan + free_ch;
>  	chan->dev_id = dev_id;
>  
> +	pm_runtime_get(&pd->dev);

The _get() call is asynchronous.  So if the device was actually
idled/disabled, immediately after this call it may still be
idle/disabled.   When using the asynchronous versions of the API, the
device should not be touched until the driver's ->runtime_resume()
callback is called.

>  	if (d->dev_caps & IS_WORD_16)
>  		p->clear_lch_regs(free_ch);
>  	else
> @@ -452,6 +455,7 @@ void omap_free_dma(int lch)
>  		omap_clear_dma(lch);
>  		p->clear_dma_sglist_mode(lch);
>  	}
> +	pm_runtime_put(&pd->dev);
>  	spin_lock_irqsave(&dma_chan_lock, flags);
>  	dma_chan[lch].dev_id = -1;
>  	dma_chan[lch].next_lch = -1;
> @@ -819,6 +823,11 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
>  	dma_chan_count		= d->chan_count;
>  	dma_chan		= d->chan;
>  
> +	/* Enable run time PM */

comment is redundant

> +	pm_runtime_enable(&pd->dev);
> +
> +	/* Accessing hw registers, get clock */

comment is wrong, driver doesn't know anything about clocks.
Just drop comment as it doesn't tell you anything that the following
'get' doesn't.

> +	pm_runtime_get(&pd->dev);

see above Re: async calls.

>  	for (ch = 0; ch < dma_chan_count; ch++) {
>  		unsigned long flags;
>  		omap_clear_dma(ch);
> @@ -846,6 +855,10 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
>  		dma_chan[0].dev_id = 0;
>  		dma_chan[1].dev_id = 1;
>  	}
> +
> +	if (!omap_dma_reserve_channels)
> +		pm_runtime_put(&pd->dev);
> +

So if the reserve channels feature is used, PM is essentially disabled
for sDMA.  You should add a warning here to that effect as well.


>  	return 0;
>  
>  exit_release_region:

Kevin

WARNING: multiple messages have this Message-ID (diff)
From: khilman@deeprootsystems.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 13/13] OMAP: PM: DMA: Enable runtime pm
Date: Tue, 09 Nov 2010 14:48:25 -0800	[thread overview]
Message-ID: <87fwvajepy.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1288099513-1854-14-git-send-email-manjugk@ti.com> (Manjunath Kondaiah G.'s message of "Tue, 26 Oct 2010 18:55:13 +0530")

"G, Manjunath Kondaiah" <manjugk@ti.com> writes:

> Enable runtime pm and use pm_runtime_get and pm_runtime_put
> for OMAP DMA driver.
>
> Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
> Cc: Benoit Cousson <b-cousson@ti.com>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  arch/arm/plat-omap/dma.c |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
> index 41b14b0..feac7ee 100644
> --- a/arch/arm/plat-omap/dma.c
> +++ b/arch/arm/plat-omap/dma.c
> @@ -35,6 +35,7 @@
>  #include <linux/io.h>
>  #include <linux/slab.h>
>  #include <linux/delay.h>
> +#include <linux/pm_runtime.h>
>  
>  #include <asm/system.h>
>  #include <mach/hardware.h>
> @@ -367,6 +368,8 @@ int omap_request_dma(int dev_id, const char *dev_name,
>  	chan = dma_chan + free_ch;
>  	chan->dev_id = dev_id;
>  
> +	pm_runtime_get(&pd->dev);

The _get() call is asynchronous.  So if the device was actually
idled/disabled, immediately after this call it may still be
idle/disabled.   When using the asynchronous versions of the API, the
device should not be touched until the driver's ->runtime_resume()
callback is called.

>  	if (d->dev_caps & IS_WORD_16)
>  		p->clear_lch_regs(free_ch);
>  	else
> @@ -452,6 +455,7 @@ void omap_free_dma(int lch)
>  		omap_clear_dma(lch);
>  		p->clear_dma_sglist_mode(lch);
>  	}
> +	pm_runtime_put(&pd->dev);
>  	spin_lock_irqsave(&dma_chan_lock, flags);
>  	dma_chan[lch].dev_id = -1;
>  	dma_chan[lch].next_lch = -1;
> @@ -819,6 +823,11 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
>  	dma_chan_count		= d->chan_count;
>  	dma_chan		= d->chan;
>  
> +	/* Enable run time PM */

comment is redundant

> +	pm_runtime_enable(&pd->dev);
> +
> +	/* Accessing hw registers, get clock */

comment is wrong, driver doesn't know anything about clocks.
Just drop comment as it doesn't tell you anything that the following
'get' doesn't.

> +	pm_runtime_get(&pd->dev);

see above Re: async calls.

>  	for (ch = 0; ch < dma_chan_count; ch++) {
>  		unsigned long flags;
>  		omap_clear_dma(ch);
> @@ -846,6 +855,10 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
>  		dma_chan[0].dev_id = 0;
>  		dma_chan[1].dev_id = 1;
>  	}
> +
> +	if (!omap_dma_reserve_channels)
> +		pm_runtime_put(&pd->dev);
> +

So if the reserve channels feature is used, PM is essentially disabled
for sDMA.  You should add a warning here to that effect as well.


>  	return 0;
>  
>  exit_release_region:

Kevin

  reply	other threads:[~2010-11-09 22:48 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26 13:25 [PATCH v3 00/13] OMAP: DMA: hwmod and DMA as platform device G, Manjunath Kondaiah
2010-10-26 13:25 ` G, Manjunath Kondaiah
2010-10-26 13:25 ` [PATCH v3 01/13] OMAP: DMA: Replace read/write macros with functions G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-10-26 14:48   ` Nishanth Menon
2010-10-26 14:48     ` Nishanth Menon
2010-10-27  3:54     ` G, Manjunath Kondaiah
2010-10-27  3:54       ` G, Manjunath Kondaiah
2010-10-27 14:26       ` Menon, Nishanth
2010-10-27 14:26         ` Menon, Nishanth
2010-10-29  8:15         ` G, Manjunath Kondaiah
2010-10-29  8:15           ` G, Manjunath Kondaiah
2010-11-09 21:37   ` Kevin Hilman
2010-11-09 21:37     ` Kevin Hilman
2010-11-10 14:01     ` G, Manjunath Kondaiah
2010-11-10 14:01       ` G, Manjunath Kondaiah
2010-11-10 16:03       ` Kevin Hilman
2010-11-10 16:03         ` Kevin Hilman
2010-11-10 17:16         ` G, Manjunath Kondaiah
2010-11-10 17:16           ` G, Manjunath Kondaiah
2010-11-10 17:35           ` Kevin Hilman
2010-11-10 17:35             ` Kevin Hilman
2010-10-26 13:25 ` [PATCH v3 02/13] OMAP: DMA: Introduce errata handling feature G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-11-09 22:12   ` Kevin Hilman
2010-11-09 22:12     ` Kevin Hilman
2010-11-10 14:02     ` G, Manjunath Kondaiah
2010-11-10 14:02       ` G, Manjunath Kondaiah
2010-11-10 16:26       ` Kevin Hilman
2010-11-10 16:26         ` Kevin Hilman
2010-11-10 17:39         ` G, Manjunath Kondaiah
2010-11-10 17:39           ` G, Manjunath Kondaiah
2010-10-26 13:25 ` [PATCH v3 03/13] OMAP: DMA: Introduce DMA device attributes G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-11-09 21:46   ` Kevin Hilman
2010-11-09 21:46     ` Kevin Hilman
2010-10-26 13:25 ` [PATCH v3 04/13] OMAP2420: DMA: hwmod: add system DMA G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-11-09 23:13   ` Kevin Hilman
2010-11-09 23:13     ` Kevin Hilman
2010-11-11 23:04     ` Kevin Hilman
2010-11-11 23:04       ` Kevin Hilman
2010-10-26 13:25 ` [PATCH v3 05/13] OMAP2430: " G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-10-26 13:25 ` [PATCH v3 06/13] OMAP3: " G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-11-03 12:59   ` G, Manjunath Kondaiah
2010-11-03 12:59     ` G, Manjunath Kondaiah
2010-11-04  4:29     ` Cousson, Benoit
2010-11-04  4:29       ` Cousson, Benoit
2010-11-04  7:01       ` G, Manjunath Kondaiah
2010-11-04  7:01         ` G, Manjunath Kondaiah
2010-11-04 12:30         ` Cousson, Benoit
2010-11-04 12:30           ` Cousson, Benoit
2010-11-04 15:48           ` Kevin Hilman
2010-11-04 15:48             ` Kevin Hilman
2010-10-26 13:25 ` [PATCH v3 07/13] OMAP4: " G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-10-26 13:25 ` [PATCH v3 08/13] OMAP1: DMA: Introduce DMA driver as platform device G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-11-09 22:23   ` Kevin Hilman
2010-11-09 22:23     ` Kevin Hilman
2010-11-10 14:02     ` G, Manjunath Kondaiah
2010-11-10 14:02       ` G, Manjunath Kondaiah
2010-10-26 13:25 ` [PATCH v3 09/13] OMAP2+: DMA: hwmod: Device registration G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-10-26 13:25 ` [PATCH v3 10/13] OMAP: DMA: Convert DMA library into DMA platform Driver G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-11-09 22:26   ` Kevin Hilman
2010-11-09 22:26     ` Kevin Hilman
2010-11-10 14:02     ` G, Manjunath Kondaiah
2010-11-10 14:02       ` G, Manjunath Kondaiah
2010-11-10 16:24       ` Kevin Hilman
2010-11-10 16:24         ` Kevin Hilman
2010-11-10 17:23         ` G, Manjunath Kondaiah
2010-11-10 17:23           ` G, Manjunath Kondaiah
2010-11-10 17:56           ` Kevin Hilman
2010-11-10 17:56             ` Kevin Hilman
2010-11-09 23:29   ` Kevin Hilman
2010-11-09 23:29     ` Kevin Hilman
2010-11-10 14:02     ` G, Manjunath Kondaiah
2010-11-10 14:02       ` G, Manjunath Kondaiah
2010-10-26 13:25 ` [PATCH v3 11/13] OMAP: DMA: Use DMA device attributes G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-10-26 13:25 ` [PATCH v3 12/13] OMAP2+: DMA: descriptor autoloading feature G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-10-26 13:25 ` [PATCH v3 13/13] OMAP: PM: DMA: Enable runtime pm G, Manjunath Kondaiah
2010-10-26 13:25   ` G, Manjunath Kondaiah
2010-11-09 22:48   ` Kevin Hilman [this message]
2010-11-09 22:48     ` Kevin Hilman
2010-11-10 14:02     ` G, Manjunath Kondaiah
2010-11-10 14:02       ` G, Manjunath Kondaiah
2010-11-10 16:14       ` Kevin Hilman
2010-11-10 16:14         ` Kevin Hilman
2010-10-27  4:57 ` [PATCH v3 00/13] OMAP: DMA: hwmod and DMA as platform device G, Manjunath Kondaiah
2010-10-27  4:57   ` G, Manjunath Kondaiah
2010-11-09 23:11 ` Kevin Hilman
2010-11-09 23:11   ` Kevin Hilman
2010-11-10 14:02   ` G, Manjunath Kondaiah
2010-11-10 14:02     ` G, Manjunath Kondaiah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fwvajepy.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=b-cousson@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=manjugk@ti.com \
    --cc=santosh.shilimkar@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.