linux-mips
[Top] [All Lists]

Invalid ticks per second on PM support

To: linux-mips@linux-mips.org
Subject: Invalid ticks per second on PM support
From: Rodolfo Giometti <giometti@linux.it>
Date: Sun, 24 Jul 2005 19:39:04 +0200
Organization: Programmi e soluzioni GNU/Linux
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.6+20040722i
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

<Prev in Thread] Current Thread [Next in Thread>
  • Invalid ticks per second on PM support, Rodolfo Giometti <=