public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org,
	sylvain.rochet@finsecur.com
Subject: Re: [PATCH] clockevents: check 'state' instead of 'mode' in suspend/resume path
Date: Thu, 18 Jun 2015 16:26:09 +0200	[thread overview]
Message-ID: <20150618142609.GF27492@piout.net> (raw)
In-Reply-To: <a1964eef6e8a47d02b1ff9083c6c91f73f0ff643.1434537215.git.viresh.kumar@linaro.org>

On 17/06/2015 at 16:04:46 +0530, Viresh Kumar wrote :
> CLOCK_EVT_MODE_* macros are present for backward compatibility (as most
> of the drivers are still using old ->set_mode() interface).
> 
> These macro's shouldn't be used anymore in code, that is common to both
> driver interfaces, i.e. ->set_mode() and ->set_state_*().
> 
> Drivers implementing ->set_state_*() interface, which have their
> clkevt->mode set to 0 (clkevt device structures are normally globally
> defined), will not participate in suspend/resume as they will always be
> marked as UNUSED.
> 
> Fix this by checking state of the clockevent device instead of mode,
> which is updated for both the interfaces.
> 
> Fixes: ac34ad27fc16 ("clockevents: Do not suspend/resume if unused")
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Reviewed-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

> ---
>  kernel/time/clockevents.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
> index 2397b97320d8..08ccc3da3ca0 100644
> --- a/kernel/time/clockevents.c
> +++ b/kernel/time/clockevents.c
> @@ -639,7 +639,7 @@ void clockevents_suspend(void)
>  	struct clock_event_device *dev;
>  
>  	list_for_each_entry_reverse(dev, &clockevent_devices, list)
> -		if (dev->suspend && dev->mode != CLOCK_EVT_MODE_UNUSED)
> +		if (dev->suspend && !clockevent_state_detached(dev))
>  			dev->suspend(dev);
>  }
>  
> @@ -651,7 +651,7 @@ void clockevents_resume(void)
>  	struct clock_event_device *dev;
>  
>  	list_for_each_entry(dev, &clockevent_devices, list)
> -		if (dev->resume && dev->mode != CLOCK_EVT_MODE_UNUSED)
> +		if (dev->resume && !clockevent_state_detached(dev))
>  			dev->resume(dev);
>  }
>  
> -- 
> 2.4.0
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  parent reply	other threads:[~2015-06-18 14:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17 10:34 [PATCH] clockevents: check 'state' instead of 'mode' in suspend/resume path Viresh Kumar
2015-06-18  7:31 ` [tip:timers/core] clockevents: Check state instead of mode " tip-bot for Viresh Kumar
2015-06-18 14:26 ` Alexandre Belloni [this message]
2015-06-18 14:38   ` [PATCH] clockevents: check 'state' instead of 'mode' " Viresh Kumar
2015-06-18 14:44     ` Alexandre Belloni

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=20150618142609.GF27492@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sylvain.rochet@finsecur.com \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox