Mike Morrell

GPIO IRQ Handler crashing kernel

Discussion created by Mike Morrell on May 4, 2011
Latest reply on Jul 28, 2013 by lategoodbye

Hi,

I am having trouble trying to setup a GPIO input as an interrupt to a driver. When I ground the GPIO pin, the kernel is crashing. I have requested the irq I want to use and I do not get an error so I don't know why the kernel crashes. I am using BSP L2.6.35_10.12.01. Here is some snippets of my code.

 

if (mxt->irq) {
  /* Try to request IRQ with falling edge first. This is
  * not always supported. If it fails, try with any edge. */
  printk(KERN_WARNING "register irq handler: irq = %i, address = %p, flags = %i, name = %s\n",
  mxt->irq, mxt_irq_handler, IRQF_TRIGGER_FALLING, client->dev.driver->name);

  error = request_irq(mxt->irq, mxt_irq_handler, IRQF_TRIGGER_FALLING, "IRQ_ATMEL_TOUCH");

}

 

Here is the output from cat /proc/interrupts. IRQ 151 is the interrupt that I am using.

 

root@freescale ~$ cat /proc/interrupts
CPU0
6: 0 - pswitch
17: 261 - mxs-kbd
25: 70275 - mxs-kbd
38: 0 - fb_irq
39: 0 - mxs-pxp
41: 18295 - GPMI NFC BCH Interrupt
47: 159 - DebugUART
48: 3873 - i.MX/mxs Timer Tick
52: 0 - dcp
53: 6 - dcp
69: 44 - mxs-i2c
82: 13 - mxs-mmc dma
84: 0 - mxs-spi.0
88: 79539 - GPMI NFC DMA Interrupt
92: 0 - fsl ehci pre interrupt, ehci_hcd:usb2
93: 291 - fsl ehci pre interrupt, ehci_hcd:usb1
94: 0 - usb_wakeup
95: 0 - usb_wakeup
96: 12 - mxs-mmc error
98: 0 - mxs-spi.0
110: 66 - mxs-i2c
151: 0 - IRQ_ATMEL_TOUCH
FIQ: mxs-battery
Err: 0

 

I am not setting up a Resource for this GPIO pin. Is that possibly the problem. I could use some examples on how to configure the GPIO pins for interrupts and using them in a device driver.

Outcomes