Skip to contentSkip to conversation

sh: clock framework update, fix count and kill off kref

PATCH Applied Magnus Damm 3 participants 5 messages May 8, 2009 – May 11, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: clock framework update, fix count and kill off kref

From: Magnus Damm <[email protected]>

This patch updates the clock framework use count code. With this patch the enable() and disable() callbacks only get called when counting from and to zero. While at it the kref stuff gets replaced with an int.

---

 arch/sh/include/asm/clock.h |    4 +-
 arch/sh/kernel/cpu/clock.c  |   69 +++++++++++++++++++++++--------------------
 2 files changed, 39 insertions(+), 34 deletions(-)
arch/sh/include/asm/clock.h +2 -2
@@ -1,7 +1,6 @@
 #ifndef __ASM_SH_CLOCK_H
 #define __ASM_SH_CLOCK_H
 
-#include <linux/kref.h>
 #include <linux/list.h>
 #include <linux/seq_file.h>
 #include <linux/clk.h>
@@ -28,7 +27,7 @@ struct clk {
 	struct clk		*parent;
 	struct clk_ops		*ops;
 
-	struct kref		kref;
+	int			usecount;
 
 	unsigned long		rate;
 	unsigned long		flags;
@@ -37,6 +36,7 @@ struct clk {
 
 #define CLK_ALWAYS_ENABLED	(1 << 0)
 #define CLK_RATE_PROPAGATES	(1 << 1)
+#define CLK_NEEDS_INIT		(1 << 2)
 
 /* Should be defined by processor-specific code */
 void arch_init_clk_ops(struct clk_ops **, int type);
arch/sh/kernel/cpu/clock.c +37 -32

137 lines not on this page · raw message

Applied
#1 lore raw
Quoted 4 lines · Magnus Damm

This patch updates the clock framework use count code. With this patch the enable() and disable() callbacks only get called when counting from and to zero. While at it the kref stuff gets replaced with an int.

Quoted 3 lines · Magnus Damm

This patch enables the TMU clocksource on sh7722. To prioritize TMU over CMT we also adjust the CMT clock source rating.

Quoted 3 lines · Magnus Damm

This patch adds TMU platform data for sh7723. Both clockevent and clocksource support is enabled. While at it, adjust the CMT clocksource rating to prioritize the TMU.

Applied, thanks.

#2 lore raw
In reply to Magnus Damm

Hi Paul
Few days ago I had a discussion with Magnus on the current status of the clock framework
and both we agree to change how the .init call back should work.

The design I have in mind is:
- the .init callback should be called during the clk_registration and if the init fails the clock framework rejects the clock.
- Any operations with (CLK_NEEDS_INIT) has to be managed internally to the clock-SOC implementation via archflag (or a void* private_data)
to hive any
implementation issue at clock framework level.

Magnus, Do you want add anything?
Paul, Do you have some issue on this design?

Regards
Francesco

Paul Mundt ha scritto:

Quoted 7 lines · Magnus Damm
Quoted 6 lines

This patch updates the clock framework use count code. With this patch the enable() and disable() callbacks only get called when counting from and to zero. While at it the kref stuff gets replaced with an int.

#3 lore raw
In reply to Magnus Damm
Quoted 9 lines · Francesco VIRLINZI

The design I have in mind is:
- the .init callback should be called during the clk_registration and if the init fails the clock framework rejects the clock.
- Any operations with (CLK_NEEDS_INIT)  has to be managed internally to the clock-SOC implementation via archflag (or a void* private_data) to hive any
 implementation issue at clock framework level.

Magnus, Do you want add anything?

Not really, except I have to test it and make sure it will work. =) There may be historical reasons why the code is written as it is, so let's try to only call init() from clock registration and see how that goes. Do you have a patch? =)

/ magnus

#4 lore raw
In reply to Magnus Damm

Hi Magnus

Quoted 5 lines

Not really, except I have to test it and make sure it will work. =) There may be historical reasons why the code is written as it is, so let's try to only call init() from clock registration and see how that goes. Do you have a patch? =)

I will post it asap, just the time to rebase my repository. Regards
Francesco

Quoted 7 lines

/ magnus
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html