Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754771AbdGJVLQ (ORCPT ); Mon, 10 Jul 2017 17:11:16 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:33009 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752191AbdGJVLO (ORCPT ); Mon, 10 Jul 2017 17:11:14 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170708000303.21863-1-dbasehore@chromium.org> <20170708000303.21863-2-dbasehore@chromium.org> From: "dbasehore ." Date: Mon, 10 Jul 2017 14:11:11 -0700 X-Google-Sender-Auth: 4TKr5N2OBkK3_QsTaOGvT4lt0q4 Message-ID: Subject: Re: [PATCH v5 2/5] tick: Add freeze timer events To: Andy Shevchenko Cc: "linux-kernel@vger.kernel.org" , Thomas Gleixner , Ingo Molnar , Rajneesh Bhardwaj , "x86@kernel.org" , Platform Driver , "Rafael J . Wysocki" , Len Brown , "linux-pm@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2004 Lines: 65 On Sat, Jul 8, 2017 at 9:05 AM, Andy Shevchenko wrote: > On Sat, Jul 8, 2017 at 3:03 AM, Derek Basehore 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? Sure. It seems that some of these lines were at 80 characters on one line anyways. Putting some of these on one line breaks the 80 character limit and doesn't help with grepping through code, though. > >> + 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. Will do. > >> + return 0; >> + >> + return dev->event_expired(dev); >> +} > > -- > With Best Regards, > Andy Shevchenko