mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolai Stange <nicstange@gmail.com>
To: John Stultz <john.stultz@linaro.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Magnus Damm <damm@opensource.se>,
	linux-kernel@vger.kernel.org,
	uclinux-h8-devel@lists.sourceforge.jp,
	Nicolai Stange <nicstange@gmail.com>
Subject: [PATCH 5/6] clocksource: h8300_timer8: don't reset rate in ->set_state_oneshot()
Date: Mon,  6 Feb 2017 22:12:03 +0100	[thread overview]
Message-ID: <20170206211204.25251-6-nicstange@gmail.com> (raw)
In-Reply-To: <20170206211204.25251-1-nicstange@gmail.com>

With the upcoming NTP correction related rate adjustments to be implemented
in the clockevents core, the latter needs to get informed about every rate
change of a clockevent device made after its registration.

Currently, h8300_timer8 violates this requirement in that it registers its
clockevent device with the correct rate, but resets its ->mult and ->rate
values in timer8_clock_event_start(), called from its ->set_state_oneshot()
function.

It seems like
  commit 4633f4cac85a ("clocksource/drivers/h8300: Cleanup startup and
                        remove module code."),
which introduced the rate initialization at registration, missed to remove
the manual setting of ->mult and ->shift from timer8_clock_event_start().

Purge the setting of ->mult, ->shift, ->min_delta_ns and ->max_delta_ns
from timer8_clock_event_start().

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---

Notes:
    Compile-only tested on ARCH=h8300.

 drivers/clocksource/h8300_timer8.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 546bb180f5a4..804c489531d6 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -101,15 +101,7 @@ static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)
 
 static void timer8_clock_event_start(struct timer8_priv *p, unsigned long delta)
 {
-	struct clock_event_device *ced = &p->ced;
-
 	timer8_start(p);
-
-	ced->shift = 32;
-	ced->mult = div_sc(p->rate, NSEC_PER_SEC, ced->shift);
-	ced->max_delta_ns = clockevent_delta2ns(0xffff, ced);
-	ced->min_delta_ns = clockevent_delta2ns(0x0001, ced);
-
 	timer8_set_next(p, delta);
 }
 
-- 
2.11.1

  parent reply	other threads:[~2017-02-06 21:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06 21:11 [PATCH 0/6] adapt clockevents frequencies to mono clock: prerequisites 1 Nicolai Stange
2017-02-06 21:11 ` [PATCH 1/6] clocksource: sh_cmt: compute rate before registration again Nicolai Stange
2017-02-14  4:35   ` John Stultz
2017-02-06 21:12 ` [PATCH 2/6] clocksource: sh_tmu: " Nicolai Stange
2017-02-06 21:12 ` [PATCH 3/6] clocksource: em_sti: split clock prepare and enable steps Nicolai Stange
2017-02-06 21:12 ` [PATCH 4/6] clocksource: em_sti: compute rate before registration Nicolai Stange
2017-02-06 21:12 ` Nicolai Stange [this message]
2017-02-06 21:12 ` [PATCH 6/6] clockevents: make clockevents_config() static Nicolai Stange

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=20170206211204.25251-6-nicstange@gmail.com \
    --to=nicstange@gmail.com \
    --cc=damm@opensource.se \
    --cc=daniel.lezcano@linaro.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=uclinux-h8-devel@lists.sourceforge.jp \
    --cc=ysato@users.sourceforge.jp \
    /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®