linux-mips
[Top] [All Lists]

Re: power management status for au1100

To: Dan Malek <dan@embeddededge.com>
Subject: Re: power management status for au1100
From: Rodolfo Giometti <giometti@linux.it>
Date: Sat, 16 Jul 2005 17:19:50 +0200
Cc: linux-mips@linux-mips.org
In-reply-to: <a2882b70a3d6c0f32728086e0c63764c@embeddededge.com>
Organization: Programmi e soluzioni GNU/Linux
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20050712142202.GB9234@gundam.enneenne.com> <20050712181013.GC9234@gundam.enneenne.com> <a2882b70a3d6c0f32728086e0c63764c@embeddededge.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.6+20040722i
Looking function mips_timer_interrupt() (which is the normal timer
interrupt when PM is not enabled) I noticed that it has called from
file «arch/mips/au1000/common/int-handler.S» as follow:

        ...
        .text
        .set    macro
        .set    noat
        .align  5

NESTED(au1000_IRQ, PT_SIZE, sp)
        SAVE_ALL
        CLI                             # Important: mark KERNEL mode !

        mfc0    t0,CP0_CAUSE            # get pending interrupts
        mfc0    t1,CP0_STATUS           # get enabled interrupts
        and     t0,t1                   # isolate allowed ones

        andi    t0,0xff00               # isolate pending bits
        beqz    t0, 3f                  # spurious interrupt

        andi    a0, t0, CAUSEF_IP7
        beq     a0, zero, 1f
        move    a0, sp
        jal     mips_timer_interrupt
        j       ret_from_irq
        ...

Looking at «CLI» implementation into «include/asm/stackframe.h»:

   /*
    * Move to kernel mode and disable interrupts.
    * Set cp0 enable bit as sign that we're running on the kernel stack
    */
                   .macro  CLI
                   mfc0    t0, CP0_STATUS
                   li      t1, ST0_CU0 | 0x1f
                   or      t0, t1
                   xori    t0, 0x1f
                   mtc0    t0, CP0_STATUS
                   irq_disable_hazard
                   .endm

I see that the CLI macro ensures that mips_timer_interrupt() will be
executed into «kernel mode».

What do you think about that? Can it cause the error «Break
instruction in kernel code in arch/mips/kernel/traps.c::do_bp, line
629[#1]:»?

If so, can someone help me in fixing such bug? I'm not a MIPS assembly
master! ;-p

Ciao,

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

Attachment: signature.asc
Description: Digital signature

<Prev in Thread] Current Thread [Next in Thread>