Skip to contentSkip to conversation

Invalid ticks per second on PM support

PATCH Rodolfo Giometti 1 participant 1 message Jul 24, 2005 MIPS

lore
Share & tools
lore
#0 lore raw

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

arch/mips/au1000/common/time.c +2 -0
diff -u -r1.2 time.c
@@ -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

Signature · 4 lines
GNU/Linux Solutions                  e-mail:    [email protected]
Linux Device Driver                             [email protected]
Embedded Systems                     home page: giometti.enneenne.com
UNIX programming                     phone:     +39 349 2432127