public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] Reentrant clock sources
@ 2008-11-25 13:28 Magnus Damm
  2008-11-25 14:55 ` Ingo Molnar
  2008-11-25 21:22 ` Thomas Gleixner
  0 siblings, 2 replies; 8+ messages in thread
From: Magnus Damm @ 2008-11-25 13:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: akpm, lethal, johnstul, magnus.damm, mingo, Magnus Damm, tglx

Hi everyone,

Is there any special reason behind the non-reentrant clock source
code? I'm writing some timer help code and getting the struct
clocksource as argument to the callbacks would make the code much
cleaner and better.

Extending the callbacks to be able to start and stop clock sources
for improved power management would be good too in my opinion.
Any thoughts?

I realize that there are quite a few clock source drivers
that need to be modified, any recommendation on which tree
to do it against and how to split up the patch? Thanks.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 include/linux/clocksource.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- 0001/include/linux/clocksource.h
+++ work/include/linux/clocksource.h	2008-11-25 21:07:13.000000000 +0900
@@ -61,14 +61,14 @@ struct clocksource {
 	char *name;
 	struct list_head list;
 	int rating;
-	cycle_t (*read)(void);
+	cycle_t (*read)(struct clocksource *cs);
 	cycle_t mask;
 	u32 mult;
 	u32 mult_orig;
 	u32 shift;
 	unsigned long flags;
-	cycle_t (*vread)(void);
-	void (*resume)(void);
+	cycle_t (*vread)(struct clocksource *cs);
+	void (*resume)(struct clocksource *cs);
 #ifdef CONFIG_IA64
 	void *fsys_mmio;        /* used by fsyscall asm code */
 #define CLKSRC_FSYS_MMIO_SET(mmio, addr)      ((mmio) = (addr))
@@ -170,7 +170,7 @@ static inline u32 clocksource_hz2mult(u3
  */
 static inline cycle_t clocksource_read(struct clocksource *cs)
 {
-	return cs->read();
+	return cs->read(cs);
 }
 
 /**

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-11-26  5:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-25 13:28 [RFC] Reentrant clock sources Magnus Damm
2008-11-25 14:55 ` Ingo Molnar
2008-11-25 21:22 ` Thomas Gleixner
2008-11-26  3:07   ` Ingo Molnar
2008-11-26  3:20     ` john stultz
2008-11-26  3:52       ` Ingo Molnar
2008-11-26  5:21         ` Magnus Damm
2008-11-26  5:32   ` Magnus Damm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox