* [patch] pnx8xxx clocksource cleanups
@ 2008-01-12 13:03 Vitaly Wool
2008-01-12 17:21 ` Sergei Shtylyov
2008-01-14 0:18 ` Ralf Baechle
0 siblings, 2 replies; 4+ messages in thread
From: Vitaly Wool @ 2008-01-12 13:03 UTC (permalink / raw)
To: ralf, sshtylyov; +Cc: linux-mips
This patch does some PNX8XXX clocksource cleanups.
arch/mips/philips/pnx8550/common/time.c | 35 ++++++++++----------------------
1 file changed, 11 insertions(+), 24 deletions(-)
Signed-off-by: Vitaly Wool <vitalywool@gmail.com>
Index: linux-mips.git/arch/mips/philips/pnx8550/common/time.c
===================================================================
--- linux-mips.git.orig/arch/mips/philips/pnx8550/common/time.c
+++ linux-mips.git/arch/mips/philips/pnx8550/common/time.c
@@ -47,11 +47,6 @@ static struct clocksource pnx_clocksourc
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
-static void timer_ack(void)
-{
- write_c0_compare(cpj);
-}
-
static irqreturn_t pnx8xxx_timer_interrupt(int irq, void *dev_id)
{
struct clock_event_device *c = dev_id;
@@ -94,30 +89,22 @@ static struct clock_event_device pnx8xxx
.set_next_event = pnx8xxx_set_next_event,
};
-/*
- * plat_time_init() - it does the following things:
- *
- * 1) plat_time_init() -
- * a) (optional) set up RTC routines,
- * b) (optional) calibrate and set the mips_hpt_frequency
- * (only needed if you intended to use cpu counter as timer interrupt
- * source)
- */
+static inline void timer_ack(void)
+{
+ write_c0_compare(cpj);
+}
__init void plat_time_init(void)
{
- unsigned int configPR;
- unsigned int n;
- unsigned int m;
- unsigned int p;
- unsigned int pow2p;
+ unsigned int configPR;
+ unsigned int n;
+ unsigned int m;
+ unsigned int p;
+ unsigned int pow2p;
clockevents_register_device(&pnx8xxx_clockevent);
clocksource_register(&pnx_clocksource);
- setup_irq(PNX8550_INT_TIMER1, &pnx8xxx_timer_irq);
- setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);
-
/* Timer 1 start */
configPR = read_c0_config7();
configPR &= ~0x00000008;
@@ -158,6 +145,6 @@ __init void plat_time_init(void)
write_c0_count2(0);
write_c0_compare2(0xffffffff);
+ setup_irq(PNX8550_INT_TIMER1, &pnx8xxx_timer_irq);
+ setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);
}
-
-
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] pnx8xxx clocksource cleanups
2008-01-12 13:03 [patch] pnx8xxx clocksource cleanups Vitaly Wool
@ 2008-01-12 17:21 ` Sergei Shtylyov
2008-01-12 20:40 ` Vitaly Wool
2008-01-14 0:18 ` Ralf Baechle
1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2008-01-12 17:21 UTC (permalink / raw)
To: Vitaly Wool; +Cc: ralf, linux-mips
Hello.
Vitaly Wool wrote:
> This patch does some PNX8XXX clocksource cleanups.
> Signed-off-by: Vitaly Wool <vitalywool@gmail.com>
> Index: linux-mips.git/arch/mips/philips/pnx8550/common/time.c
> ===================================================================
> --- linux-mips.git.orig/arch/mips/philips/pnx8550/common/time.c
> +++ linux-mips.git/arch/mips/philips/pnx8550/common/time.c
> @@ -47,11 +47,6 @@ static struct clocksource pnx_clocksourc
> .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> };
>
> -static void timer_ack(void)
> -{
> - write_c0_compare(cpj);
> -}
> -
> static irqreturn_t pnx8xxx_timer_interrupt(int irq, void *dev_id)
> {
> struct clock_event_device *c = dev_id;
> @@ -94,30 +89,22 @@ static struct clock_event_device pnx8xxx
> .set_next_event = pnx8xxx_set_next_event,
> };
>
> -/*
> - * plat_time_init() - it does the following things:
> - *
> - * 1) plat_time_init() -
> - * a) (optional) set up RTC routines,
> - * b) (optional) calibrate and set the mips_hpt_frequency
> - * (only needed if you intended to use cpu counter as timer
> interrupt
> - * source)
> - */
> +static inline void timer_ack(void)
> +{
> + write_c0_compare(cpj);
> +}
I still don't understand why you need this function at all, and the 'cpj'
variable as well -- clockevents core will set the comparator to a needed
value. Also, I don't see much value in moving that function...
WBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] pnx8xxx clocksource cleanups
2008-01-12 17:21 ` Sergei Shtylyov
@ 2008-01-12 20:40 ` Vitaly Wool
0 siblings, 0 replies; 4+ messages in thread
From: Vitaly Wool @ 2008-01-12 20:40 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: ralf, linux-mips
> > +static inline void timer_ack(void)
> > +{
> > + write_c0_compare(cpj);
> > +}
>
> I still don't understand why you need this function at all, and the 'cpj'
> variable as well -- clockevents core will set the comparator to a needed
> value. Also, I don't see much value in moving that function...
Well, it's explicitly made inline and it has been moved closer to the
calling function.
Vitaly
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] pnx8xxx clocksource cleanups
2008-01-12 13:03 [patch] pnx8xxx clocksource cleanups Vitaly Wool
2008-01-12 17:21 ` Sergei Shtylyov
@ 2008-01-14 0:18 ` Ralf Baechle
1 sibling, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2008-01-14 0:18 UTC (permalink / raw)
To: Vitaly Wool; +Cc: sshtylyov, linux-mips
On Sat, Jan 12, 2008 at 04:03:40PM +0300, Vitaly Wool wrote:
> This patch does some PNX8XXX clocksource cleanups.
Queued for 2.6.25.
Ralf
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-01-14 0:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-12 13:03 [patch] pnx8xxx clocksource cleanups Vitaly Wool
2008-01-12 17:21 ` Sergei Shtylyov
2008-01-12 20:40 ` Vitaly Wool
2008-01-14 0:18 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox