Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1683625
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v5 2/5] tick: Add freeze timer events |
| Date | 2017-07-08 18:10 +0200 |
| Message-ID | <u10sV-4ls-1@gated-at.bofh.it> (permalink) |
| References | <u0LtT-35r-3@gated-at.bofh.it> <u0LtT-35r-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sat, Jul 8, 2017 at 3:03 AM, Derek Basehore <dbasehore@chromium.org> wrote:
> Adds a new feature to tick to schedule wakeups on a CPU during freeze.
> This won't fully wake up the system (devices are not resumed), but
> allow simple platform functionality to be run during freeze with
> little power impact.
>
> This implementation allows an idle driver to setup a timer event with
> the clock event device when entering freeze by calling
> tick_set_freeze_event. Only one caller should exist for the function.
>
> tick_freeze_event_expired is used to check if the timer went off when
> the CPU wakes.
>
> The event is cleared by tick_clear_freeze_event.
> +int tick_set_freeze_event(int cpu, ktime_t delta)
> +{
> + printk_deferred(KERN_WARNING
> + "[%s] unsupported by clock event device\n",
Can it be one line?
> + printk_deferred(KERN_WARNING
> + "[%s] clock event device in use\n",
Ditto.
> + printk_deferred(KERN_WARNING
> + "[%s] %lluns outside range: [%lluns, %lluns]\n",
Ditto.
> + printk_deferred(KERN_WARNING
> + "Failed to program freeze event\n");
Ditto.
> +int tick_freeze_event_expired(int cpu)
> +{
> + struct clock_event_device *dev = per_cpu(tick_cpu_device, cpu).evtdev;
> +
> + if (!(dev && dev->event_expired))
Usually we use a pattern (!x || !x->y). At least for me it looks
slightly better to read.
> + return 0;
> +
> + return dev->event_expired(dev);
> +}
--
With Best Regards,
Andy Shevchenko
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v5 2/5] tick: Add freeze timer events Derek Basehore <dbasehore@chromium.org> - 2017-07-08 02:10 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-07-08 18:10 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events "dbasehore ." <dbasehore@chromium.org> - 2017-07-10 23:20 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-10 15:10 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events Thomas Gleixner <tglx@linutronix.de> - 2017-07-12 23:30 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events "dbasehore ." <dbasehore@chromium.org> - 2017-07-13 03:20 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events Thomas Gleixner <tglx@linutronix.de> - 2017-07-13 07:00 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events Peter Zijlstra <peterz@infradead.org> - 2017-07-13 09:40 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events "Rafael J. Wysocki" <rafael@kernel.org> - 2017-07-13 17:10 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events "dbasehore ." <dbasehore@chromium.org> - 2017-07-14 01:00 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-15 14:50 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events "dbasehore ." <dbasehore@chromium.org> - 2017-07-18 02:40 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events "Rafael J. Wysocki" <rafael@kernel.org> - 2017-07-18 03:40 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events "dbasehore ." <dbasehore@chromium.org> - 2017-07-18 06:00 +0200
Re: [PATCH v5 2/5] tick: Add freeze timer events Thomas Gleixner <tglx@linutronix.de> - 2017-07-18 08:50 +0200
csiph-web