linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Got trap No.23 when booting mips32 ?
@ 2009-10-21 14:40 wilbur.chan
  2009-10-21 16:09 ` David Daney
  2009-10-21 16:12 ` Sergei Shtylyov
  0 siblings, 2 replies; 10+ messages in thread
From: wilbur.chan @ 2009-10-21 14:40 UTC (permalink / raw)
  To: linux-mips

Hi all,


I've got some problem when booting mips32.


I got a No.23 trap when calling start_kernel --->  local_irq_enable :


irq 23, desc: 802a98a0, depth: 1, count: 0, unhandled: 0
->handle_irq():  80148c6c, handle_bad_irq+0x0/0x2b4
->chip(): 8029f738, 0x8029f738
->action(): 00000000
  IRQ_DISABLED set
unexpected IRQ # 23


No.23 trap is a Watch trap, which means that, when

"Physical address of load/store matched enabled value in


WatchLo/ WatahHi registers." happened, a No.23 trap was triggered by cpu.


So I used macro

__u32 watch_regh0= read_c0_watchhi0();
__u32 watch_regl0= read_c0_watchlo0();

to retrieve value from WatchHi and WatchLo,found them 0x1 and 0x0
respectively,which mean that ,

'r' together with  'w' bits were set to zero and no trap should be triggered.


But now , I got a 23 trap, why ?


At last , I used  to set WatchHi to 0x0, but failed , found it  still 0x1 after

calling write_c0_watchhi0(0)


Any suggestion would be grateful.

regards

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Got trap No.23 when booting mips32 ?
@ 2009-10-22 20:16 David VomLehn
  2009-10-23 10:25 ` wilbur.chan
  0 siblings, 1 reply; 10+ messages in thread
From: David VomLehn @ 2009-10-22 20:16 UTC (permalink / raw)
  To: wilbur.chan; +Cc: Linux MIPS Mailing List

>And I found that , as a matter of  fact , kernel has registered No.23 as a trap.
>
>In trap_init :
>
>/*
>1419          * Only some CPUs have the watch exceptions.
>1420          */
>1421         if (cpu_has_watch)
>1422                 set_except_vector(23, handle_watch);
>
>
>So, if a No.23 "signal" happened , kernel should  invoke handle_watch instead.
>
>
>But why here kernel complained ? and why kernel entered the IRQ branch
>(do_IRQ) rather than trap branch?

It looks like you are confusing interrupts and exceptions. Exceptions
are a generally a change in the flow of execution of a processor due to
a condition internal to the processor. So, a divide by zero is an a exception.

An interrupt is a change in execution flow due to a device external to the
processor. Keyboards use interrupts to indicate that a key has been
pressed.

Things can be slightly confusing on the MIPS processor because interrupts
are normally treated as a type of exception. In this case, the exception
type in the ExcCode field of the Cause register is "Int". If your system
uses the external vectored interrupt controller, it will not use an
exception and will instead use an array of interrupt handlers.

In your case, you are getting interrupt request (IRQ) number 23. The message
you are getting indicates that no device driver has told the kernel that
it can handle this interrupt. I suggest that you consult the documentation
for your system to determine which device is using IRQ 23 and ensure that
you have a device driver installed for that device. It is unusual that
a device would cause an interrupt without actions from the device driver;
you might want to investigate the possibility that your system is
incorrectly configured, causing the incorrect IRQ to be generated.

I suggest reading the book, "See MIPS Run Linux" by Dominic Sweetman, to learn
more about the low level details of interrupts and exceptions on the MIPS
processor. For exact details, consult "MIPS32® Architecture For Programmers
Volume III: The MIPS32® Privileged Resource Architecture", available at
mips.com (you need to sign up for a free account)

David VL

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-10-23 10:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-21 14:40 Got trap No.23 when booting mips32 ? wilbur.chan
2009-10-21 16:09 ` David Daney
2009-10-22  0:02   ` wilbur.chan
2009-10-21 16:12 ` Sergei Shtylyov
2009-10-22  0:04   ` wilbur.chan
2009-10-22  0:50     ` Kevin D. Kissell
2009-10-22 14:55       ` wilbur.chan
2009-10-22 16:03         ` David Daney
  -- strict thread matches above, loose matches on Subject: below --
2009-10-22 20:16 David VomLehn
2009-10-23 10:25 ` wilbur.chan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).