Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1480328

[RFC v6 20/23] clockevents: purge ->min_delta_ns

From Nicolai Stange <nicstange@gmail.com>
Newsgroups linux.kernel
Subject [RFC v6 20/23] clockevents: purge ->min_delta_ns
Date 2016-09-09 22:20 +0200
Message-ID <sfArg-7zf-27@gated-at.bofh.it> (permalink)
References <sfAhA-7rj-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The struct clock_event_device's ->min_delta_ns member isn't used anymore.

Purge it.

In __clockevents_update_bounds(), shortcut the
  ->min_delta_ticks => ->min_delta_ns => ->min_delta_ticks_adjusted
calculation detour -- it had been made solely for the purpose of ensuring
that ->min_delta_ticks_adjusted corresponds to something >= 1us.

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---
 include/linux/clockchips.h |  2 --
 kernel/time/clockevents.c  | 12 +++++-------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 7c3a193..2ff15f03 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -94,7 +94,6 @@ enum clock_event_state {
  * @tick_resume:	resume clkevt device
  * @broadcast:		function to broadcast events
  * @min_delta_ticks:	minimum delta value in ticks stored for reconfiguration
- * @min_delta_ns:	minimum delta value in ns
  * @name:		ptr to clock event name
  * @rating:		variable to rate clock event devices
  * @irq:		IRQ number (only for non CPU local devices)
@@ -127,7 +126,6 @@ struct clock_event_device {
 	void			(*suspend)(struct clock_event_device *);
 	void			(*resume)(struct clock_event_device *);
 	unsigned long		min_delta_ticks;
-	u64			min_delta_ns;
 
 	const char		*name;
 	int			rating;
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 86d9f97..394b8dc 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -492,14 +492,12 @@ static void __clockevents_update_bounds(struct clock_event_device *dev)
 	}
 
 	/*
-	 * cev_delta2ns() never returns values less than 1us and thus,
-	 * we'll never program any ced with anything less.
+	 * Enforce ->min_delta_ticks_adjusted to correspond to a value
+	 * >= 1us.
 	 */
-	dev->min_delta_ns = cev_delta2ns(dev->min_delta_ticks, dev, false);
-	dev->min_delta_ticks_adjusted = (unsigned long)((dev->min_delta_ns *
-						dev->mult) >> dev->shift);
-	dev->min_delta_ticks_adjusted = max(dev->min_delta_ticks_adjusted,
-						dev->min_delta_ticks);
+	dev->min_delta_ticks_adjusted =
+		max(dev->min_delta_ticks,
+			(unsigned long)((1000ULL * dev->mult) >> dev->shift));
 }
 
 /**
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC v6 00/23] adapt clockevents frequencies to mono clock Nicolai Stange <nicstange@gmail.com> - 2016-09-09 22:10 +0200
  [RFC v6 07/23] many clockevent drivers: set ->min_delta_ticks and ->max_delta_ticks Nicolai Stange <nicstange@gmail.com> - 2016-09-09 22:10 +0200
  [RFC v6 04/23] clocksource: em_sti: compute rate before registration Nicolai Stange <nicstange@gmail.com> - 2016-09-09 22:10 +0200
  [RFC v6 19/23] timer_list: print_tickdevice(): calculate ->min_delta_ns dynamically Nicolai Stange <nicstange@gmail.com> - 2016-09-09 22:20 +0200
  [RFC v6 22/23] clockevents: make setting of ->mult and ->mult_adjusted atomic Nicolai Stange <nicstange@gmail.com> - 2016-09-09 22:20 +0200
  [RFC v6 18/23] clockevents: min delta increment: calculate min_delta_ns from ticks Nicolai Stange <nicstange@gmail.com> - 2016-09-09 22:20 +0200
  [RFC v6 21/23] clockevents: initial support for mono to raw time conversion Nicolai Stange <nicstange@gmail.com> - 2016-09-09 22:20 +0200
  [RFC v6 20/23] clockevents: purge ->min_delta_ns Nicolai Stange <nicstange@gmail.com> - 2016-09-09 22:20 +0200
  [RFC v6 23/23] timekeeping: inform clockevents about freq adjustments Nicolai Stange <nicstange@gmail.com> - 2016-09-09 22:20 +0200
  [RFC v6 16/23] clockevents: clockevents_program_min_delta(): don't set ->next_event Nicolai Stange <nicstange@gmail.com> - 2016-09-09 22:20 +0200
  [RFC v6 17/23] clockevents: use ->min_delta_ticks_adjusted to program minimum delta Nicolai Stange <nicstange@gmail.com> - 2016-09-09 22:30 +0200

csiph-web