[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTimxkY4MvQ+-qiOwdwbo7jPUAQ1vxw@mail.gmail.com>
Date: Fri, 13 May 2011 14:24:10 -0700
From: Colin Cross <ccross@...roid.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Santosh Shilimkar <santosh.shilimkar@...com>,
Russell King <linux@....linux.org.uk>,
Srinidhi KASAGAR <srinidhi.kasagar@...ricsson.com>,
Harald Gustafsson <harald.gustafsson@...csson.com>,
Linus Walleij <linus.ml.walleij@...il.com>,
linux-kernel@...r.kernel.org,
Rickard ANDERSSON <rickard.andersson@...ricsson.com>,
martin persson <martin.persson@...ricsson.com>,
Varun Swara <Varun.Swara@....com>,
Catalin Marinas <catalin.marinas@....com>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] ARM: twd: Adjust localtimer frequency withcpufreqnotifiers
On Fri, May 13, 2011 at 3:02 AM, Thomas Gleixner <tglx@...utronix.de> wrote:
> Does the following work for you ?
Not if the comments are accurate.
> Thanks,
>
> tglx
>
> ---------->
> Subject: clock-ev-reconf.patch
> From: Thomas Gleixner <tglx@...utronix.de>
> Date: Fri, 13 May 2011 10:53:13 +0200
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
> include/linux/clockchips.h | 2 ++
> kernel/time/clockevents.c | 24 ++++++++++++++++++++++++
> 2 files changed, 26 insertions(+)
>
> Index: linux-2.6/include/linux/clockchips.h
> ===================================================================
> --- linux-2.6.orig/include/linux/clockchips.h
> +++ linux-2.6/include/linux/clockchips.h
> @@ -132,6 +132,8 @@ extern int clockevents_program_event(str
>
> extern void clockevents_handle_noop(struct clock_event_device *dev);
>
> +extern int clockevents_reconfigure(struct clock_event_device *ce, u32 freq, u32 minsec);
> +
> static inline void
> clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec)
> {
> Index: linux-2.6/kernel/time/clockevents.c
> ===================================================================
> --- linux-2.6.orig/kernel/time/clockevents.c
> +++ linux-2.6/kernel/time/clockevents.c
> @@ -133,6 +133,30 @@ int clockevents_program_event(struct clo
> }
>
> /**
> + * clockevents_reconfigure - Reconfigure and reprogram a clock event device.
> + * @dev: device to modify
> + * @freq: new device frequency
> + * @secr: guaranteed runtime conversion range in seconds
> + *
> + * Reconfigure and reprogram a clock event device in oneshot
> + * mode. Must only be called from low level idle code where
> + * interaction with hrtimers/nohz code etc. is not possible and
> + * guaranteed not to conflict. Must be called with interrupts
> + * disabled!
> + * Returns 0 on success, -ETIME when the event is in the past or
> + * -EINVAL when called with invalid parameters.
> + */
We need to call this from a cpufreq notifier with interrupts disabled,
not from idle.
> +int clockevents_reconfigure(struct clock_event_device *dev, u32 freq, u32 secr)
> +{
> + if (dev->mode != CLOCK_EVT_MODE_ONESHOT)
> + return -EINVAL;
> +
> + clockevents_calc_mult_shift(dev, freq, secr ? secr : 1);
> +
> + return clockevents_program_event(dev, dev->next_event, ktime_get());
> +}
> +
> +/**
> * clockevents_register_notifier - register a clock events change listener
> */
> int clockevents_register_notifier(struct notifier_block *nb)
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists