All of lore.kernel.org
 help / color / mirror / Atom feed
From: Santosh <santosh.shilimkar@ti.com>
To: Kevin Hilman <khilman@ti.com>
Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>,
	linux-omap@vger.kernel.org, tony@atomide.com,
	linux-arm-kernel@lists.infradead.org,
	Partha Basak <p-basak2@ti.com>
Subject: Re: [PATCH v14 REPOST 07/12] OMAP: dmtimer: pm_runtime support
Date: Fri, 26 Aug 2011 22:04:00 +0530	[thread overview]
Message-ID: <4E57CAF8.3030109@ti.com> (raw)
In-Reply-To: <87liug3zw0.fsf@ti.com>

On Friday 26 August 2011 09:53 PM, Kevin Hilman wrote:
> Santosh<santosh.shilimkar@ti.com>  writes:
>
>> On Friday 15 July 2011 05:34 PM, Tarun Kanti DebBarma wrote:
>>> Add pm_runtime feature to dmtimer whereby _get_sync() is called within
>>> omap_dm_timer_enable(), _put_sync() is called in omap_dm_timer_disable().
>>>
>>> Signed-off-by: Tarun Kanti DebBarma<tarun.kanti@ti.com>
>>> [p-basak2@ti.com: added pm_runtime logic in probe()]
>>> Signed-off-by: Partha Basak<p-basak2@ti.com>
>>> Reviewed-by: Varadarajan, Charulatha<charu@ti.com>
>>> Acked-by: Cousson, Benoit<b-cousson@ti.com>
>>> ---
>>>    arch/arm/plat-omap/dmtimer.c              |   31 +++++++---------------------
>>>    arch/arm/plat-omap/include/plat/dmtimer.h |    1 -
>>>    2 files changed, 8 insertions(+), 24 deletions(-)
>>>
>>> diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
>>> index 54564e9..0560248 100644
>>> --- a/arch/arm/plat-omap/dmtimer.c
>>> +++ b/arch/arm/plat-omap/dmtimer.c
>>> @@ -38,6 +38,7 @@
>>>    #include<linux/io.h>
>>>    #include<linux/slab.h>
>>>    #include<linux/err.h>
>>> +#include<linux/pm_runtime.h>
>>>
>>>    #include<plat/dmtimer.h>
>>>
>>> @@ -193,33 +194,13 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_free);
>>>
>>>    void omap_dm_timer_enable(struct omap_dm_timer *timer)
>>>    {
>>> -	struct dmtimer_platform_data *pdata = timer->pdev->dev.platform_data;
>>> -
>>> -	if (timer->enabled)
>>> -		return;
>>> -
>>> -	if (!pdata->needs_manual_reset) {
>>> -		clk_enable(timer->fclk);
>>> -		clk_enable(timer->iclk);
>>> -	}
>>> -
>>> -	timer->enabled = 1;
>>> +	pm_runtime_get_sync(&timer->pdev->dev);
>>>    }
>>>    EXPORT_SYMBOL_GPL(omap_dm_timer_enable);
>>>
>>>    void omap_dm_timer_disable(struct omap_dm_timer *timer)
>>>    {
>>> -	struct dmtimer_platform_data *pdata = timer->pdev->dev.platform_data;
>>> -
>>> -	if (!timer->enabled)
>>> -		return;
>>> -
>>> -	if (!pdata->needs_manual_reset) {
>>> -		clk_disable(timer->iclk);
>>> -		clk_disable(timer->fclk);
>>> -	}
>>> -
>>> -	timer->enabled = 0;
>>> +	pm_runtime_put_sync(&timer->pdev->dev);
>> Better to use pm_runtime_put_sync_suspend() to make
>> it irq safe.
>
> Actually, better to just use the async version: pm_runtime_put()
>
> Why does it need to be IRQ safe?
>
>>>    }
>>>    EXPORT_SYMBOL_GPL(omap_dm_timer_disable);
>>>
>>> @@ -461,7 +442,7 @@ int omap_dm_timers_active(void)
>>>    	struct omap_dm_timer *timer;
>>>
>>>    	list_for_each_entry(timer,&omap_timer_list, node) {
>>> -		if (!timer->enabled)
>>> +		if (!timer->reserved)
>>>    			continue;
>>>
>>>    		if (omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG)&
>>> @@ -536,6 +517,10 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
>>>    	timer->irq = irq->start;
>>>    	timer->pdev = pdev;
>>>
>>> +	/* Skip pm_runtime_enable for OMAP1 */
>>> +	if (!pdata->needs_manual_reset)
>>> +		pm_runtime_enable(&pdev->dev);
>>> +
>> Here too.
>> /s /pm_runtime_enable /pm_runtime_irq_safe
>
> I think you mean adding _irq_safe, not removing the _enable?
>
> I disagree with the IRQ-safe part.  Let's avoid using IRQ-safe unless
> *really* needed, and justified.
>
The reason may not be satisfactory, bust some the client drivers
are calling the timer APIs from IRQ context that created regressions
on internal trees. That's was the only reason behind my comment.

On other hand, none of this client drivers are supported in
mainline, so my comment from mainline point of is void.

Regards
Santosh

WARNING: multiple messages have this Message-ID (diff)
From: santosh.shilimkar@ti.com (Santosh)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v14 REPOST 07/12] OMAP: dmtimer: pm_runtime support
Date: Fri, 26 Aug 2011 22:04:00 +0530	[thread overview]
Message-ID: <4E57CAF8.3030109@ti.com> (raw)
In-Reply-To: <87liug3zw0.fsf@ti.com>

On Friday 26 August 2011 09:53 PM, Kevin Hilman wrote:
> Santosh<santosh.shilimkar@ti.com>  writes:
>
>> On Friday 15 July 2011 05:34 PM, Tarun Kanti DebBarma wrote:
>>> Add pm_runtime feature to dmtimer whereby _get_sync() is called within
>>> omap_dm_timer_enable(), _put_sync() is called in omap_dm_timer_disable().
>>>
>>> Signed-off-by: Tarun Kanti DebBarma<tarun.kanti@ti.com>
>>> [p-basak2 at ti.com: added pm_runtime logic in probe()]
>>> Signed-off-by: Partha Basak<p-basak2@ti.com>
>>> Reviewed-by: Varadarajan, Charulatha<charu@ti.com>
>>> Acked-by: Cousson, Benoit<b-cousson@ti.com>
>>> ---
>>>    arch/arm/plat-omap/dmtimer.c              |   31 +++++++---------------------
>>>    arch/arm/plat-omap/include/plat/dmtimer.h |    1 -
>>>    2 files changed, 8 insertions(+), 24 deletions(-)
>>>
>>> diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
>>> index 54564e9..0560248 100644
>>> --- a/arch/arm/plat-omap/dmtimer.c
>>> +++ b/arch/arm/plat-omap/dmtimer.c
>>> @@ -38,6 +38,7 @@
>>>    #include<linux/io.h>
>>>    #include<linux/slab.h>
>>>    #include<linux/err.h>
>>> +#include<linux/pm_runtime.h>
>>>
>>>    #include<plat/dmtimer.h>
>>>
>>> @@ -193,33 +194,13 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_free);
>>>
>>>    void omap_dm_timer_enable(struct omap_dm_timer *timer)
>>>    {
>>> -	struct dmtimer_platform_data *pdata = timer->pdev->dev.platform_data;
>>> -
>>> -	if (timer->enabled)
>>> -		return;
>>> -
>>> -	if (!pdata->needs_manual_reset) {
>>> -		clk_enable(timer->fclk);
>>> -		clk_enable(timer->iclk);
>>> -	}
>>> -
>>> -	timer->enabled = 1;
>>> +	pm_runtime_get_sync(&timer->pdev->dev);
>>>    }
>>>    EXPORT_SYMBOL_GPL(omap_dm_timer_enable);
>>>
>>>    void omap_dm_timer_disable(struct omap_dm_timer *timer)
>>>    {
>>> -	struct dmtimer_platform_data *pdata = timer->pdev->dev.platform_data;
>>> -
>>> -	if (!timer->enabled)
>>> -		return;
>>> -
>>> -	if (!pdata->needs_manual_reset) {
>>> -		clk_disable(timer->iclk);
>>> -		clk_disable(timer->fclk);
>>> -	}
>>> -
>>> -	timer->enabled = 0;
>>> +	pm_runtime_put_sync(&timer->pdev->dev);
>> Better to use pm_runtime_put_sync_suspend() to make
>> it irq safe.
>
> Actually, better to just use the async version: pm_runtime_put()
>
> Why does it need to be IRQ safe?
>
>>>    }
>>>    EXPORT_SYMBOL_GPL(omap_dm_timer_disable);
>>>
>>> @@ -461,7 +442,7 @@ int omap_dm_timers_active(void)
>>>    	struct omap_dm_timer *timer;
>>>
>>>    	list_for_each_entry(timer,&omap_timer_list, node) {
>>> -		if (!timer->enabled)
>>> +		if (!timer->reserved)
>>>    			continue;
>>>
>>>    		if (omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG)&
>>> @@ -536,6 +517,10 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
>>>    	timer->irq = irq->start;
>>>    	timer->pdev = pdev;
>>>
>>> +	/* Skip pm_runtime_enable for OMAP1 */
>>> +	if (!pdata->needs_manual_reset)
>>> +		pm_runtime_enable(&pdev->dev);
>>> +
>> Here too.
>> /s /pm_runtime_enable /pm_runtime_irq_safe
>
> I think you mean adding _irq_safe, not removing the _enable?
>
> I disagree with the IRQ-safe part.  Let's avoid using IRQ-safe unless
> *really* needed, and justified.
>
The reason may not be satisfactory, bust some the client drivers
are calling the timer APIs from IRQ context that created regressions
on internal trees. That's was the only reason behind my comment.

On other hand, none of this client drivers are supported in
mainline, so my comment from mainline point of is void.

Regards
Santosh

  reply	other threads:[~2011-08-26 16:34 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 12:04 [PATCH v14 REPOST 00/12] dmtimer adaptation to platform_driver Tarun Kanti DebBarma
2011-07-15 12:04 ` Tarun Kanti DebBarma
2011-07-15 12:04 ` [PATCH v14 REPOST 01/12] OMAP2+: dmtimer: add device names to flck nodes Tarun Kanti DebBarma
2011-07-15 12:04   ` Tarun Kanti DebBarma
2011-08-26 14:15   ` Santosh
2011-08-26 14:15     ` Santosh
2011-07-15 12:04 ` [PATCH v14 REPOST 02/12] OMAP4: hwmod data: add dmtimer version information Tarun Kanti DebBarma
2011-07-15 12:04   ` Tarun Kanti DebBarma
2011-08-26 15:21   ` Santosh
2011-08-26 15:21     ` Santosh
2011-07-15 12:04 ` [PATCH v14 REPOST 03/12] OMAP1: dmtimer: conversion to platform devices Tarun Kanti DebBarma
2011-07-15 12:04   ` Tarun Kanti DebBarma
2011-08-26 14:26   ` Santosh
2011-08-26 14:26     ` Santosh
2011-07-15 12:04 ` [PATCH v14 REPOST 04/12] OMAP2+: dmtimer: convert " Tarun Kanti DebBarma
2011-07-15 12:04   ` Tarun Kanti DebBarma
2011-08-26 14:33   ` Santosh
2011-08-26 14:33     ` Santosh
2011-07-15 12:04 ` [PATCH v14 REPOST 05/12] OMAP: dmtimer: platform driver Tarun Kanti DebBarma
2011-07-15 12:04   ` Tarun Kanti DebBarma
2011-08-26 14:34   ` Santosh
2011-08-26 14:34     ` Santosh
2011-07-15 12:04 ` [PATCH v14 REPOST 06/12] OMAP: dmtimer: switch-over to platform device driver Tarun Kanti DebBarma
2011-07-15 12:04   ` Tarun Kanti DebBarma
2011-08-26 15:20   ` Santosh
2011-08-26 15:20     ` Santosh
2011-07-15 12:04 ` [PATCH v14 REPOST 07/12] OMAP: dmtimer: pm_runtime support Tarun Kanti DebBarma
2011-07-15 12:04   ` Tarun Kanti DebBarma
2011-08-26 15:27   ` Santosh
2011-08-26 15:27     ` Santosh
2011-08-26 16:23     ` Kevin Hilman
2011-08-26 16:23       ` Kevin Hilman
2011-08-26 16:34       ` Santosh [this message]
2011-08-26 16:34         ` Santosh
2011-07-15 12:04 ` [PATCH v14 REPOST 08/12] OMAP: dmtimer: add timeout to low-level routines Tarun Kanti DebBarma
2011-07-15 12:04   ` Tarun Kanti DebBarma
2011-08-26 15:30   ` Santosh
2011-08-26 15:30     ` Santosh
2011-07-15 12:04 ` [PATCH v14 REPOST 09/12] OMAP: dmtimer: use mutex instead of spinlock Tarun Kanti DebBarma
2011-07-15 12:04   ` Tarun Kanti DebBarma
2011-08-26 15:34   ` Santosh
2011-08-26 15:34     ` Santosh
2011-08-26 16:09     ` Santosh
2011-08-26 16:09       ` Santosh
2011-07-15 12:04 ` [PATCH v14 REPOST 10/12] OMAP: dmtimer: mark clocksource and clockevent timers reserved Tarun Kanti DebBarma
2011-07-15 12:04   ` Tarun Kanti DebBarma
2011-08-26 15:44   ` Santosh
2011-08-26 15:44     ` Santosh
2011-07-15 12:05 ` [PATCH v14 REPOST 11/12] OMAP: dmtimer: add context save/restore routines Tarun Kanti DebBarma
2011-07-15 12:05   ` Tarun Kanti DebBarma
2011-08-26 15:46   ` Santosh
2011-08-26 15:46     ` Santosh
2011-07-15 12:05 ` [PATCH v14 REPOST 12/12] OMAP: dmtimer: Off mode support Tarun Kanti DebBarma
2011-07-15 12:05   ` Tarun Kanti DebBarma
2011-08-26 16:04   ` Santosh
2011-08-26 16:04     ` Santosh

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=4E57CAF8.3030109@ti.com \
    --to=santosh.shilimkar@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=p-basak2@ti.com \
    --cc=tarun.kanti@ti.com \
    --cc=tony@atomide.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.