* [PATCH] PR15789/gettimeofday: do not bail out if cpufreq_register_notifier fails
@ 2013-07-30 8:10 Timo Juhani Lindfors
2013-08-02 18:09 ` David Smith
0 siblings, 1 reply; 3+ messages in thread
From: Timo Juhani Lindfors @ 2013-07-30 8:10 UTC (permalink / raw)
To: systemtap; +Cc: Timo Juhani Lindfors
Linux commit d5aaffa9dd531c978c6f3fea06a2972653bd7fc8 (cpufreq: handle
cpufreq being disabled for all exported function.) causes
cpufreq_register_notifier to fail if cpufreq gets disabled at
runtime. This patch simply ignores the failure of
cpufreq_register_notifier so that gettimeofday can continue to work.
Once cpufreq is disabled it can not be enabled at runtime so this
should be safe.
---
runtime/time.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/runtime/time.c b/runtime/time.c
index 34df72a..a01d922 100644
--- a/runtime/time.c
+++ b/runtime/time.c
@@ -253,10 +253,8 @@ _stp_init_time(void)
#ifdef CONFIG_CPU_FREQ
if (!ret && !__stp_constant_freq()) {
- ret = cpufreq_register_notifier(&__stp_time_notifier,
- CPUFREQ_TRANSITION_NOTIFIER);
-
- if (!ret) {
+ if (!cpufreq_register_notifier(&__stp_time_notifier,
+ CPUFREQ_TRANSITION_NOTIFIER)) {
for_each_online_cpu(cpu) {
unsigned long flags;
int freq_khz = cpufreq_get(cpu);
--
1.7.2.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PR15789/gettimeofday: do not bail out if cpufreq_register_notifier fails
2013-07-30 8:10 [PATCH] PR15789/gettimeofday: do not bail out if cpufreq_register_notifier fails Timo Juhani Lindfors
@ 2013-08-02 18:09 ` David Smith
2013-08-16 11:56 ` Timo Juhani Lindfors
0 siblings, 1 reply; 3+ messages in thread
From: David Smith @ 2013-08-02 18:09 UTC (permalink / raw)
To: Timo Juhani Lindfors; +Cc: systemtap
On 07/30/2013 03:10 AM, Timo Juhani Lindfors wrote:
> Linux commit d5aaffa9dd531c978c6f3fea06a2972653bd7fc8 (cpufreq: handle
> cpufreq being disabled for all exported function.) causes
> cpufreq_register_notifier to fail if cpufreq gets disabled at
> runtime. This patch simply ignores the failure of
> cpufreq_register_notifier so that gettimeofday can continue to work.
> Once cpufreq is disabled it can not be enabled at runtime so this
> should be safe.
> ---
> runtime/time.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/runtime/time.c b/runtime/time.c
> index 34df72a..a01d922 100644
> --- a/runtime/time.c
> +++ b/runtime/time.c
> @@ -253,10 +253,8 @@ _stp_init_time(void)
>
> #ifdef CONFIG_CPU_FREQ
> if (!ret && !__stp_constant_freq()) {
> - ret = cpufreq_register_notifier(&__stp_time_notifier,
> - CPUFREQ_TRANSITION_NOTIFIER);
> -
> - if (!ret) {
> + if (!cpufreq_register_notifier(&__stp_time_notifier,
> + CPUFREQ_TRANSITION_NOTIFIER)) {
> for_each_online_cpu(cpu) {
> unsigned long flags;
> int freq_khz = cpufreq_get(cpu);
>
I've looked at this patch, and while the patch looks simple enough, I
can't really test it (since I don't run xen anywhere). It seemed to work
on my fedora kernel (3.11.0-0.rc3.git1.1.fc20.x86_64).
I went ahead and committed it (with a minor tweak, to only unregister
the notifier it the registration worked).
If the patch doesn't fix your issue, let us know.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PR15789/gettimeofday: do not bail out if cpufreq_register_notifier fails
2013-08-02 18:09 ` David Smith
@ 2013-08-16 11:56 ` Timo Juhani Lindfors
0 siblings, 0 replies; 3+ messages in thread
From: Timo Juhani Lindfors @ 2013-08-16 11:56 UTC (permalink / raw)
To: systemtap
David Smith <dsmith@redhat.com> writes:
> If the patch doesn't fix your issue, let us know.
Seems to work still, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-16 11:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-30 8:10 [PATCH] PR15789/gettimeofday: do not bail out if cpufreq_register_notifier fails Timo Juhani Lindfors
2013-08-02 18:09 ` David Smith
2013-08-16 11:56 ` Timo Juhani Lindfors
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).