mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Linaro Kernel Mailman List <linaro-kernel@lists.linaro.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Kevin Hilman <khilman@linaro.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Preeti U Murthy <preeti@linux.vnet.ibm.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Linaro Networking <linaro-networking@linaro.org>
Subject: Re: [PATCH] clockevents: Introduce mode specific callbacks
Date: Wed, 11 Feb 2015 11:38:45 +0100	[thread overview]
Message-ID: <20150211103845.GR23123@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKohpomhTO=ZaOAm8Q4dyX0=1vYOktm_y=u-++dNtgGm8j172A@mail.gmail.com>

On Wed, Feb 11, 2015 at 11:24:53AM +0800, Viresh Kumar wrote:
> On 10 February 2015 at 22:15, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Wed, Feb 04, 2015 at 01:06:23PM +0530, Viresh Kumar wrote:
> >> +     /*
> >> +      * Mode transition callback(s): Only one of the two groups should be
> >> +      * defined:
> >> +      * - set_mode(), only for modes <= CLOCK_EVT_MODE_RESUME.
> >> +      * - set_mode_{shutdown|periodic|oneshot|resume}().
> >> +      */

> >> +static int clockevents_sanity_check(struct clock_event_device *dev)
> >> +{
> >> +}
> >
> > It appears to me you've not actually checked that condition outlined
> > above, a driver could set both the legacy and the new callbacks.
> 
> Exactly for this reason I mentioned this in the logs:
> 
> >> If the legacy ->set_mode() callback is provided, all mode specific
> >> callbacks would be ignored.
> 
> So, either we can mention that in the code as well OR add code to
> check and WARN about that. Will do whatever looks better to you
> guys.

I think its better to be strict; esp. with new interfaces. It avoids
confusion.

Suppose a driver writer sees these new methods and thinks to use one
while still having the set_mode() one -- ie. he didn't actually read the
comment. We'd better make sure he fails and goes back to read it.

  reply	other threads:[~2015-02-11 10:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04  7:36 Viresh Kumar
2015-02-10 14:15 ` Peter Zijlstra
2015-02-11  3:24   ` Viresh Kumar
2015-02-11 10:38     ` Peter Zijlstra [this message]
2015-02-12  1:09       ` Viresh Kumar
2015-02-12  8:23         ` Peter Zijlstra

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=20150211103845.GR23123@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=fweisbec@gmail.com \
    --cc=khilman@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linaro-networking@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.org \
    /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®