From: Thomas Gleixner <tglx@linutronix.de>
To: Xunlei Pang <pang.xunlei@linaro.org>
Cc: linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com,
Alessandro Zummo <a.zummo@towertech.it>,
Feng Tang <feng.tang@intel.com>,
John Stultz <john.stultz@linaro.org>,
Arnd Bergmann <arnd.bergmann@linaro.org>
Subject: Re: [PATCH 1/3] time: Don't bother to run rtc_resume() for nonstop clocksource
Date: Wed, 21 Jan 2015 11:22:20 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.11.1501211109410.5526@nanos> (raw)
In-Reply-To: <1421772090-13113-1-git-send-email-pang.xunlei@linaro.org>
On Tue, 20 Jan 2015, Xunlei Pang wrote:
> ---
> drivers/rtc/class.c | 2 +-
> include/linux/timekeeping.h | 11 +++++++++++
> kernel/time/timekeeping.c | 3 ++-
> 3 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
> index 472a5ad..c8f35a5 100644
> --- a/drivers/rtc/class.c
> +++ b/drivers/rtc/class.c
> @@ -102,7 +102,7 @@ static int rtc_resume(struct device *dev)
> struct timespec64 sleep_time;
> int err;
>
> - if (has_persistent_clock())
> + if (rtc_resume_skip())
> return 0;
>
> rtc_hctosys_ret = -ENODEV;
> diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
> index 9b63d13..6f3283b 100644
> --- a/include/linux/timekeeping.h
> +++ b/include/linux/timekeeping.h
> @@ -238,6 +238,17 @@ extern void getnstime_raw_and_real(struct timespec *ts_raw,
> */
> extern bool persistent_clock_exist;
> extern int persistent_clock_is_local;
> +extern bool suspendtime_found;
> +
> +#ifdef CONFIG_RTC_LIB
> +/* Used by rtc_resume() */
> +static inline bool rtc_resume_skip(void)
> +{
> + return suspendtime_found;
> +}
> +#else
> +static inline void rtc_resume_skip(void) { }
> +#endif
What's the point of this ifdeffery and the inline which is different
than the real one?
> static inline bool has_persistent_clock(void)
> {
> diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
> index 6a93185..586bb5c 100644
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -65,6 +65,7 @@ int __read_mostly timekeeping_suspended;
>
> /* Flag for if there is a persistent clock on this platform */
> bool __read_mostly persistent_clock_exist = false;
> +bool suspendtime_found;
This is horrible. The variable name was ugly already, so now you just
make it global without any thought. Global variables are supposed to
have a proper name which allows us to figure out what they are used
for and to which susbsystem they belong.
Aside of that we have now two different mechanisms to guard
timekeeping_inject_sleeptime64(). One in the rtc code and one in the
timekeeping code itself. This is just wrong.
Thanks,
tglx
prev parent reply other threads:[~2015-01-21 10:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-20 16:41 Xunlei Pang
2015-01-20 16:41 ` [PATCH 2/3] rtc: Remove redundant rtc_valid_tm() from rtc_resume() Xunlei Pang
2015-01-20 16:41 ` [PATCH 3/3] time: clocksource: Add a comment to CLOCK_SOURCE_SUSPEND_NONSTOP Xunlei Pang
2015-01-21 10:22 ` Thomas Gleixner [this message]
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=alpine.DEB.2.11.1501211109410.5526@nanos \
--to=tglx@linutronix.de \
--cc=a.zummo@towertech.it \
--cc=arnd.bergmann@linaro.org \
--cc=feng.tang@intel.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pang.xunlei@linaro.org \
--cc=rtc-linux@googlegroups.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®