From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] clockevents: add an optional frequency update function
Date: Tue, 12 Jun 2012 19:21:52 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.02.1206121852310.3086@ionos> (raw)
In-Reply-To: <1336479469-9246-1-git-send-email-linus.walleij@stericsson.com>
On Tue, 8 May 2012, Linus Walleij wrote:
Sorry for answering late and thanks for the reminder.
> int clockevents_update_freq(struct clock_event_device *dev, u32 freq)
> {
> + /* Call down to the driver to reconfigure for new frequency */
> + if (dev->update_freq)
> + dev->update_freq(dev->mode, dev);
This shouldn't be unconditional. If the device is not used or shut
down or in oneshot mode this call is pointless. So this wants to go
below.
> clockevents_config(dev, freq);
Shouldn't we store the frequency in the clock_event_device structure, so
the driver has it handy when either the set_mode, reprogram or
update_freq() function is called ?
> if (dev->mode != CLOCK_EVT_MODE_ONESHOT)
switch (dev->mode) {
case CLOCK_EVT_MODE_ONESHOT:
return clockevents_program_event(dev, dev->next_event, false);
case CLOCK_EVT_MODE_PERIODIC:
if (dev->update_freq)
dev->update_freq(dev->mode, dev);
}
return 0;
Thanks,
tglx
prev parent reply other threads:[~2012-06-12 17:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-08 12:17 [PATCH 1/2] clockevents: add an optional frequency update function Linus Walleij
2012-06-12 16:37 ` Linus Walleij
2012-06-12 17:21 ` Thomas Gleixner [this message]
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=alpine.LFD.2.02.1206121852310.3086@ionos \
--to=tglx@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.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