Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Invalid ticks per second on PM support
@ 2005-07-24 17:39 Rodolfo Giometti
  0 siblings, 0 replies; only message in thread
From: Rodolfo Giometti @ 2005-07-24 17:39 UTC (permalink / raw)
  To: linux-mips

Hello.

When I sent my patch to fix PM support
«http://www.linux-mips.org/archives/linux-mips/2005-07/msg00255.html»
I modified function counter0_irq() as follow:

	  #ifdef CONFIG_PM
	 -void counter0_irq(int irq, void *dev_id, struct pt_regs *regs)
	 +irqreturn_t counter0_irq(int irq, void *dev_id, struct pt_regs *regs)
	  {
		 unsigned long pc0;
		 int time_elapsed;
		 static int jiffie_drift = 0;
	  
	 -	 kstat.irqs[0][irq]++;
		 if (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20) {

I removed line «kstat.irqs[0][irq]++;» since I supposed that counter
is managed by __do_IRQ(), but now I notice that without such line
reading from /proc/interrups I get:

   hostname:~# while sleep 1 ; do grep 17: /proc/interrupts ; done
    17:      31710  Au1000 Rise Edge  Au1xxx TOY                                   
    17:      32236  Au1000 Rise Edge  Au1xxx TOY                                   
    17:      32762  Au1000 Rise Edge  Au1xxx TOY                                   
    17:      33288  Au1000 Rise Edge  Au1xxx TOY                                   
    17:      33814  Au1000 Rise Edge  Au1xxx TOY                                   
    17:      34340  Au1000 Rise Edge  Au1xxx TOY                                   
    17:      34866  Au1000 Rise Edge  Au1xxx TOY                                   
    17:      35392  Au1000 Rise Edge  Au1xxx TOY                                   

Where you can see that I have 500 ticks per second...

Applying this patch:

Index: arch/mips/au1000/common/time.c
===================================================================
RCS file: /home/develop/cvs_private/linux-mips-exadron/arch/mips/au1000/common/time.c,v
retrieving revision 1.2
diff -u -r1.2 time.c
--- a/arch/mips/au1000/common/time.c	18 Jul 2005 17:16:57 -0000	1.2
+++ b/arch/mips/au1000/common/time.c	24 Jul 2005 14:31:32 -0000
@@ -125,6 +125,8 @@
 	int time_elapsed;
 	static int jiffie_drift = 0;
 
+	kstat_this_cpu.irqs[irq]++;
+
 	if (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20) {
 		/* should never happen! */
 		printk(KERN_WARNING "counter 0 w status error\n");

Everything works well... but I'm a little puzzled about it.

Can someone of you (guru) explain it? :-p

Thanks,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@linux.it
Linux Device Driver                             giometti@enneenne.com
Embedded Systems                     home page: giometti.enneenne.com
UNIX programming                     phone:     +39 349 2432127

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-24 17:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-24 17:39 Invalid ticks per second on PM support Rodolfo Giometti

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