Failure of request_irq() for MPC8313 using arch=powerpc

5 messages, 3 authors, 2008-07-23 · open the first message on its own page

Failure of request_irq() for MPC8313 using arch=powerpc

From: Duy-Ky Nguyen <hidden>
Date: 2008-07-16 01:03:41

Hello,

I had no problem in using request_irq() for MPC8272 with arch=ppc from Montavista Linux

But I have failure for MPC8313 with arch=powerpc from FreeScale LTIB Linux with error code -38

I found its header file mpc83xx.h under include/asm-ppc, while it's supposed to be under include/asm-powerpc.

I did try to copy the header file to directory asm-powerpc
From MPC8313 datasheet, I have 
GPIO_IRQ = 74

and I use

DEVICE_NAME = "ppc"
IRQ_FLAG = IRQF_SHARED    // use new flag
here my function call

request_irq (GPIO_IRQ,
      ppc_ISR,  
      IRQ_FLAG,
      DEVICE_NAME,   
      NULL);   

I'd appreciate any help on this problem.

Best Regards,

Duy-Kyng

RE: Failure of request_irq() for MPC8313 using arch=powerpc

From: Liu Dave <hidden>
Date: 2008-07-16 02:09:11

Hi Nguyen,
 
If current PowerPC linux is using the virq to request_irq,
you need do the irq_of_parse_and_map(np, 0) to get the virq.
 
like.
virq = irq_of_parse_and_map(np, 0)
request_irq(virq,...);
 
Hope it can help you.
Thanks,
Dave

________________________________

	From: linuxppc-embedded-bounces+daveliu=freescale.com@ozlabs.org [mailto:linuxppc-embedded-bounces+daveliu=freescale.com@ozlabs.org] On Behalf Of Duy-Ky Nguyen
	Sent: 2008?7?16? 8:59 AM
	To: linuxppc-embedded@ozlabs.org
	Subject: Failure of request_irq() for MPC8313 using arch=powerpc
	
	
	Hello,
	 
	I had no problem in using request_irq() for MPC8272 with arch=ppc from Montavista Linux
	 
	But I have failure for MPC8313 with arch=powerpc from FreeScale LTIB Linux with error code -38
	 
	I found its header file mpc83xx.h under include/asm-ppc, while it's supposed to be under include/asm-powerpc.
	 
	I did try to copy the header file to directory asm-powerpc
	 
	From MPC8313 datasheet, I have 
	 
	GPIO_IRQ = 74
	 
	and I use
	 
	DEVICE_NAME = "ppc"
	IRQ_FLAG = IRQF_SHARED    // use new flag
	here my function call
	 
	request_irq (GPIO_IRQ,
	      ppc_ISR,  
	      IRQ_FLAG,
	      DEVICE_NAME,   
	      NULL);   
	
	I'd appreciate any help on this problem.
	 
	Best Regards,
	 
	Duy-Kyng
	 
	 

Re: Failure of request_irq() for MPC8313 using arch=powerpc

From: Duy-Ky Nguyen <hidden>
Date: 2008-07-16 03:44:02

Hi Dave,

I've just tried it and it failed.

Before I had tried using the function
int virq = of_irq_to_resource(GPIO_IRQ, 0, NULL);
and it failed the same way

I call request_irq() in the operation init and open, it behaves the same

I greatky appreciate your help, Dave.

Best Regards,

Duy-Ky

//////////////////////////////////////////////////////////////////////////
// Start of capture

Unable to handle kernel paging request for data at address 0x0000005e
Faulting instruction address: 0xc000d1e8
Oops: Kernel access of bad area, sig: 11 [#1]

Modules linked in: ppc_drv
NIP: C000D1E8 LR: C000D274 CTR: C0006088
REGS: c7883d20 TRAP: 0300   Not tainted  (2.6.20)
MSR: 00009032 <EE,ME,IR,DR>  CR: 22000448  XER: 00000000
DAR: 0000005E, DSISR: 20000000
TASK = c053a810[767] 'rrgg' THREAD: c7882000
GPR00: C000D274 C7883DD0 C053A810 0000004A C0282BA8 C7883E08 C7FD9440 C0273EEC
GPR08: 00000000 00000000 00000100 C0006088 22000448 10018D00 07FFD000 28000422
GPR16: 10090000 100B0000 100B7328 00000000 00000000 00000000 100C8968 100C89A8
GPR24: 100BDFE8 00000000 00000000 C7FD9440 FFFFFFEA C7883E08 C0282BA8 0000004A
Call Trace:
[C7883DD0] [C7FD5EE8]  (unreliable)
[C7883DF0] [C000D274]
[C7883E00] [C0009FC8]
[C7883E30] [C000609C]
[C7883E60] [C9072030]
[C7883E70] [C0063E5C]
[C7883EA0] [C005FFAC]
[C7883EC0] [C0060244]
[C7883F20] [C00602B8]
[C7883F40] [C000F540]
--- Exception: c01Instruction dump:
409effc8 80030024 900b0020 4e800020 7d800026 9421ffe0 7c0802a6 bfa10014
7c9e2378 7cbd2b78 91810010 90010024 <83e30014> 2f9f0000 419e0028 2e050000
 Segmentation fault

// End of Capture

  ----- Original Message ----- 
  From: Liu Dave 
  To: Duy-Ky Nguyen ; linuxppc-embedded@ozlabs.org 
  Sent: Tuesday, July 15, 2008 7:09 PM
  Subject: RE: Failure of request_irq() for MPC8313 using arch=powerpc


  Hi Nguyen,

  If current PowerPC linux is using the virq to request_irq,
  you need do the irq_of_parse_and_map(np, 0) to get the virq.

  like.
  virq = irq_of_parse_and_map(np, 0)
  request_irq(virq,...);

  Hope it can help you.
  Thanks,
  Dave

----------------------------------------------------------------------------
    From: linuxppc-embedded-bounces+daveliu=freescale.com@ozlabs.org [mailto:linuxppc-embedded-bounces+daveliu=freescale.com@ozlabs.org] On Behalf Of Duy-Ky Nguyen
    Sent: 2008年7月16日 8:59 AM
    To: linuxppc-embedded@ozlabs.org
    Subject: Failure of request_irq() for MPC8313 using arch=powerpc


    Hello,

    I had no problem in using request_irq() for MPC8272 with arch=ppc from Montavista Linux

    But I have failure for MPC8313 with arch=powerpc from FreeScale LTIB Linux with error code -38

    I found its header file mpc83xx.h under include/asm-ppc, while it's supposed to be under include/asm-powerpc.

    I did try to copy the header file to directory asm-powerpc

    From MPC8313 datasheet, I have 

    GPIO_IRQ = 74

    and I use

    DEVICE_NAME = "ppc"
    IRQ_FLAG = IRQF_SHARED    // use new flag
    here my function call

    request_irq (GPIO_IRQ,
          ppc_ISR,  
          IRQ_FLAG,
          DEVICE_NAME,   
          NULL);   

    I'd appreciate any help on this problem.

    Best Regards,

    Duy-Kyng

Re: Failure of request_irq() for MPC8313 using arch=powerpc

From: Scott Wood <hidden>
Date: 2008-07-22 17:56:40

On Tue, Jul 15, 2008 at 08:43:59PM -0700, Duy-Ky Nguyen wrote:
Hi Dave,

I've just tried it and it failed.
Could you elaborate on exactly what you tried?  Did you pass the GPIO device
tree node?
Before I had tried using the function
int virq = of_irq_to_resource(GPIO_IRQ, 0, NULL);
and it failed the same way
The first argument of of_irq_to_resource is a device node pointer, not an
IRQ number.  Surely the compiler warned you about this.

-Scott

Re: Failure of request_irq() for MPC8313 using arch=powerpc

From: Duy-Ky Nguyen <hidden>
Date: 2008-07-23 01:54:57

Hello Scott,

I forgot to mention that I have less error if I use the existing device node 
"spi" in the DTS file

# Start of error capture

Got device node from device tree
Got Virtual IRQ
PPC : interrupt hook failed (-22)

# End of capture

So it's able to access the device node and to map "virq" while I had total 
failure in using "gpio" I put into DTS

I must make mistake in creating the node "gpio" in the DTS file

I'm using FreeScale Eva board MPC8313ERDB

Thanks,

Duy-Ky

----- Original Message ----- 
From: "Scott Wood" <redacted>
To: "Duy-Ky Nguyen" <redacted>
Cc: "Liu Dave" <redacted>; <redacted>
Sent: Tuesday, July 22, 2008 10:55 AM
Subject: Re: Failure of request_irq() for MPC8313 using arch=powerpc

On Tue, Jul 15, 2008 at 08:43:59PM -0700, Duy-Ky Nguyen wrote:
quoted
Hi Dave,

I've just tried it and it failed.
Could you elaborate on exactly what you tried?  Did you pass the GPIO 
device
tree node?
quoted
Before I had tried using the function
int virq = of_irq_to_resource(GPIO_IRQ, 0, NULL);
and it failed the same way
The first argument of of_irq_to_resource is a device node pointer, not an
IRQ number.  Surely the compiler warned you about this.

-Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help