[help] kernel oops in function gpio_to_irq

Mylene Josserand Mylene.Josserand at navocap.com
Wed Mar 27 13:15:22 EDT 2013


Hi everyone,


I have a problem with gpio functions.
My kernel version is 3.8.2 and my SoC is a imX27 on a "home-made" board.

First, when I boot, I had only the "Starting kernel..." message.
So I rebuild my kernel with CONFIG_DEBUG_KERNEL, CONFIG_DEBUG_LL and 
CONFIG_EARLY_PRINTK. I have also add the line 
"earlyprintk=console,UART0,115200" on the bootargs of my Barebox.

With that, I can see more messages :

[...]
Unable to handle kernel NULL pointer dereference at virtual address 0000002c
pgd = c0004000
[0000002c] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT ARM
Modules linked in:
CPU: 0    Not tainted  (3.8.2+ #4)
PC is at __gpio_to_irq+0x1c/0x44
LR is at navocap_baseboard_init+0xd8/0x2c8
pc : [<c01fd194>]    lr : [<c04fd468>]    psr: 60000053
sp : c7835ef0  ip : 00000079  fp : c05a5628
r10: c04f817c  r9 : 00000000  r8 : c05a562c
r7 : c7834000  r6 : 00000004  r5 : c05158c4  r4 : c0578844
r3 : 000005ac  r2 : c05b0410  r1 : c7834000  r0 : 00000000
Flags: nZCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: a0004000  DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc78341b8)
Stack: (0xc7835ef0 to 0xc7836000)
5ee0:                                     c05158c4 c04fd468 00000002 
10009000
5f00: 10009fff 00000000 00000200 00000000 00000000 00000000 c05158c4 
c04fd348
5f20: c0578844 c04f819c c04d23dc c00087f8 00000003 00000003 c04d1b2c 
c06bd6a0
5f40: 00000000 c0578844 c05158c4 00000004 0000008b c05a562c c0515898 
c04f6378
5f60: c05a5620 c04f62a0 00000003 00000003 c04f6378 c00403e0 00000000 
00000000
5f80: c03cfee0 00000000 00000000 00000000 00000000 00000000 00000000 
c03cfeec
5fa0: 00000000 00000000 c03cfee0 c00093b0 00000000 00000000 00000000 
00000000
5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
00000000
5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00100000 
000a1000
[<c01fd194>] (__gpio_to_irq+0x1c/0x44) from [<c04fd468>] 
(navocap_baseboard_init+0xd8/0x2c8)
[<c04fd468>] (navocap_baseboard_init+0xd8/0x2c8) from [<c04f819c>] 
(customize_machine+0x20/0x30)
[<c04f819c>] (customize_machine+0x20/0x30) from [<c00087f8>] 
(do_one_initcall+0x2c/0x168)
[<c00087f8>] (do_one_initcall+0x2c/0x168) from [<c04f62a0>] 
(kernel_init_freeable+0xf4/0x1cc)
[<c04f62a0>] (kernel_init_freeable+0xf4/0x1cc) from [<c03cfeec>] 
(kernel_init+0xc/0x164)
[<c03cfeec>] (kernel_init+0xc/0x164) from [<c00093b0>] 
(ret_from_fork+0x14/0x24)
Code: e0433100 e1a0c000 e7920003 e24dd004 (e590302c)
---[ end trace 61bb09c25216d85b ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b


The problem is in the function "gpio_to_irq" in my board init functions 
(navocap_baseboard_init).

To know which lines the opps appears, I have followed this tutorial : 
https://wiki.ubuntu.com/Kernel/KernelDebuggingTricks

Thanks to it, I can notice that the opps appears when I called the 
"gpio_to_irq" function in :

ret = request_irq(gpio_to_irq(IMX_GPIO_NR(2,14)), detect_irq, 
IRQF_TRIGGER_FALLING, "imx-mmc-detect", data);


I have checked in other boards how to use this function and it is 
configured in the same way.
I did see where I have made a mistake. Maybe in my config file where I 
have missed a configuration option ? How to solve this opps problem ? It 
would be very great if someone could give me some helps / feedbacks on 
this problem.

Thank you in advance !

Best regards,


-- 
Mylène JOSSERAND
Navocap



More information about the Kernelnewbies mailing list