All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem registering interrupt
@ 2004-12-21 17:55 Sébastien Taylor
  0 siblings, 0 replies; 5+ messages in thread
From: Sébastien Taylor @ 2004-12-21 17:55 UTC (permalink / raw)
  To: linux-mips

Hello,

I am porting my driver from 2.4 to 2.6 and am having an issue with 
interrupts, I've updated my interrupt handler to return irqreturn_t 
instead of void and it looks like it should be ok, but on init, when I 
call request_irq it blows up in my face (trace bellow).

Now, if I request_irq with SA_SHIRQ it does boot up fine, but when I 
try to use the driver it blows up again. Now, I'm guessing that means 
something else is requesting my irq number first which is why it works 
with SA_SHIRQ but why would that cause a crash?  Should it not just 
return an error message?

Wasn't sure what code would be relevant so hopefully that explaination 
helps,
Any help would be greatly appreciated.


CPU 0 Unable to handle kernel paging request at virtual address 
00000004, epc =4
Oops in arch/mips/mm/fault.c::do_page_fault, line 166[#1]:
Cpu 0
$ 0   : 00000000 1000fc00 00000000 803382d8
$ 4   : 803382d8 80340000 00000001 804e92a8
$ 8   : 80340000 00000a35 80510000 80510000
$12   : 80510000 8113f074 8113f07c 0000ffff
$16   : 80367620 80367628 1000fc01 00000031
$20   : 805bef28 00000000 00000000 00000000
$24   : 00000000 00000078
$28   : 80570000 80571f20 00000000 801430c4
Hi    : 000000a1
Lo    : 47ad5a00
epc   : 801430c8 setup_irq+0x148/0x224     Not tainted
ra    : 801430c4 setup_irq+0x144/0x224
Status: 1000fc02    KERNEL EXL
Cause : 00808008
BadVA : 000000e1
PrId  : 03030200
Process swapper (pid: 1, threadinfo=80570000, task=80554b48)
Stack : 805bef28 80340000 00000001 804e92a8 805bef28 80217188 00000000 
00000000
         00000031 803250e8 801433b4 80143368 00000000 80340000 00000001 
804e92a8
         00000000 80320000 80380000 00000000 00000000 00000000 8037a958 
8037a56c
         00000000 00000001 80808081 00000000 00000000 00000000 80382fec 
00000000
         80380000 80100518 00000000 00000000 00000000 00000000 00000000 
00000000
         ...
Call Trace:
  [<80217188>] mc2interrupt+0x0/0x368
  [<801433b4>] request_irq+0xd0/0x12c
  [<80143368>] request_irq+0x84/0x12c
  [<80380000>] init+0x38/0xe0
  [<8037a958>] mc2init+0x80/0x1d4
  [<8037a56c>] tty_init+0x160/0x184
  [<80380000>] init+0x38/0xe0
  [<80100518>] init+0xbc/0x1f8
  [<80104de0>] kernel_thread_helper+0x10/0x18
  [<80104dd0>] kernel_thread_helper+0x0/0x18


Code: 0c049dad  ae00000c  8e020004 <8c420004> 1040000a  00000000  
3c048032  0c0
Kernel panic - not syncing: Attempted to kill init! 
                             

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

* Re: Problem registering interrupt
       [not found] <41C947CC.20709@innova-card.com>
@ 2004-12-22 10:19 ` moreau francis
  2004-12-22 10:44     ` Jan-Benedict Glaw
  0 siblings, 1 reply; 5+ messages in thread
From: moreau francis @ 2004-12-22 10:19 UTC (permalink / raw)
  To: linux-mips, sebastient


> CPU 0 Unable to handle kernel paging request at
> virtual address 00000004, epc =4

Well it suggests me that your driver is trying to 
access a really nasty pointer: 0x00000004...
How did you get this address ? From user space ?

   Francis


	

	
		
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

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

* Re: Problem registering interrupt
@ 2004-12-22 10:44     ` Jan-Benedict Glaw
  0 siblings, 0 replies; 5+ messages in thread
From: Jan-Benedict Glaw @ 2004-12-22 10:44 UTC (permalink / raw)
  To: linux-mips

[-- Attachment #1: Type: text/plain, Size: 1306 bytes --]

On Wed, 2004-12-22 11:19:06 +0100, moreau francis <francis_moreau2000@yahoo.fr>
wrote in message <20041222101906.27137.qmail@web25109.mail.ukl.yahoo.com>:
> 
> > CPU 0 Unable to handle kernel paging request at
> > virtual address 00000004, epc =4
> 
> Well it suggests me that your driver is trying to 
> access a really nasty pointer: 0x00000004...
> How did you get this address ? From user space ?

Accesses to nearly NULL are normally structure accesses where a pointer
to a given struct was supplied as a NULL pointer.

So an access to 0x00000004 is most probably an access to the second
element of a struct, given/expected that all fields are usually 4-byte
aligned.

>From looking at ./kernel/irq/manage.c:setup_irq(), I guess that you
supply NULL as the "struct irqaction *", which is the 2nd argument of
setup_irq(). It's 2nd structure element is "flags" then... This is the
first thing accessed by the "new" pointer in setup_irq().

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: Problem registering interrupt
@ 2004-12-22 10:44     ` Jan-Benedict Glaw
  0 siblings, 0 replies; 5+ messages in thread
From: Jan-Benedict Glaw @ 2004-12-22 10:44 UTC (permalink / raw)
  To: linux-mips

[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]

On Wed, 2004-12-22 11:19:06 +0100, moreau francis <francis_moreau2000@yahoo.fr>
wrote in message <20041222101906.27137.qmail@web25109.mail.ukl.yahoo.com>:
> 
> > CPU 0 Unable to handle kernel paging request at
> > virtual address 00000004, epc =4
> 
> Well it suggests me that your driver is trying to 
> access a really nasty pointer: 0x00000004...
> How did you get this address ? From user space ?

Accesses to nearly NULL are normally structure accesses where a pointer
to a given struct was supplied as a NULL pointer.

So an access to 0x00000004 is most probably an access to the second
element of a struct, given/expected that all fields are usually 4-byte
aligned.

From looking at ./kernel/irq/manage.c:setup_irq(), I guess that you
supply NULL as the "struct irqaction *", which is the 2nd argument of
setup_irq(). It's 2nd structure element is "flags" then... This is the
first thing accessed by the "new" pointer in setup_irq().

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: Problem registering interrupt
  2004-12-22 10:44     ` Jan-Benedict Glaw
  (?)
@ 2005-01-06 22:19     ` Sébastien Taylor
  -1 siblings, 0 replies; 5+ messages in thread
From: Sébastien Taylor @ 2005-01-06 22:19 UTC (permalink / raw)
  To: linux-mips

So the crash is happening because the handler pointer is null in the 
irq_desc for interrupt 49.  Is there something that I was supposed to 
do to setup that handler before registering my interrupt?  This was 
working fine under 2.4, is it a change in 2.6 or just in the alchemy 
port specifically?

Thanks for the help and happy new years,
Sébastien


Le 04-12-22, à 03:44, Jan-Benedict Glaw a écrit :

> On Wed, 2004-12-22 11:19:06 +0100, moreau francis 
> <francis_moreau2000@yahoo.fr>
> wrote in message 
> <20041222101906.27137.qmail@web25109.mail.ukl.yahoo.com>:
>>
>>> CPU 0 Unable to handle kernel paging request at
>>> virtual address 00000004, epc =4
>>
>> Well it suggests me that your driver is trying to
>> access a really nasty pointer: 0x00000004...
>> How did you get this address ? From user space ?
>
> Accesses to nearly NULL are normally structure accesses where a pointer
> to a given struct was supplied as a NULL pointer.
>
> So an access to 0x00000004 is most probably an access to the second
> element of a struct, given/expected that all fields are usually 4-byte
> aligned.
>
>> From looking at ./kernel/irq/manage.c:setup_irq(), I guess that you
> supply NULL as the "struct irqaction *", which is the 2nd argument of
> setup_irq(). It's 2nd structure element is "flags" then... This is the
> first thing accessed by the "new" pointer in setup_irq().
>
> MfG, JBG
>
> -- 
> Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481         
>     _ O _
> "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen 
> Krieg  _ _ O
>  fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im 
> Irak!   O O O
> ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | 
> TCPA));

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

end of thread, other threads:[~2005-01-06 22:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-21 17:55 Problem registering interrupt Sébastien Taylor
     [not found] <41C947CC.20709@innova-card.com>
2004-12-22 10:19 ` moreau francis
2004-12-22 10:44   ` Jan-Benedict Glaw
2004-12-22 10:44     ` Jan-Benedict Glaw
2005-01-06 22:19     ` Sébastien Taylor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.