<p dir="ltr"><br>
El 27/03/2013 18:16, "Mylene Josserand" <<a href="mailto:Mylene.Josserand@navocap.com">Mylene.Josserand@navocap.com</a>> va escriure:<br>
><br>
> Hi everyone,<br>
><br>
><br>
> I have a problem with gpio functions.<br>
> My kernel version is 3.8.2 and my SoC is a imX27 on a "home-made" board.<br>
><br>
> First, when I boot, I had only the "Starting kernel..." message.<br>
> So I rebuild my kernel with CONFIG_DEBUG_KERNEL, CONFIG_DEBUG_LL and<br>
> CONFIG_EARLY_PRINTK. I have also add the line<br>
> "earlyprintk=console,UART0,115200" on the bootargs of my Barebox.<br>
><br>
> With that, I can see more messages :<br>
><br>
> [...]<br>
> Unable to handle kernel NULL pointer dereference at virtual address 0000002c<br>
> pgd = c0004000<br>
> [0000002c] *pgd=00000000<br>
> Internal error: Oops: 5 [#1] PREEMPT ARM<br>
> Modules linked in:<br>
> CPU: 0 Not tainted (3.8.2+ #4)<br>
> PC is at __gpio_to_irq+0x1c/0x44<br>
> LR is at navocap_baseboard_init+0xd8/0x2c8<br>
> pc : [<c01fd194>] lr : [<c04fd468>] psr: 60000053<br>
> sp : c7835ef0 ip : 00000079 fp : c05a5628<br>
> r10: c04f817c r9 : 00000000 r8 : c05a562c<br>
> r7 : c7834000 r6 : 00000004 r5 : c05158c4 r4 : c0578844<br>
> r3 : 000005ac r2 : c05b0410 r1 : c7834000 r0 : 00000000<br>
> Flags: nZCv IRQs on FIQs off Mode SVC_32 ISA ARM Segment kernel<br>
> Control: 0005317f Table: a0004000 DAC: 00000017<br>
> Process swapper (pid: 1, stack limit = 0xc78341b8)<br>
> Stack: (0xc7835ef0 to 0xc7836000)<br>
> 5ee0: c05158c4 c04fd468 00000002<br>
> 10009000<br>
> 5f00: 10009fff 00000000 00000200 00000000 00000000 00000000 c05158c4<br>
> c04fd348<br>
> 5f20: c0578844 c04f819c c04d23dc c00087f8 00000003 00000003 c04d1b2c<br>
> c06bd6a0<br>
> 5f40: 00000000 c0578844 c05158c4 00000004 0000008b c05a562c c0515898<br>
> c04f6378<br>
> 5f60: c05a5620 c04f62a0 00000003 00000003 c04f6378 c00403e0 00000000<br>
> 00000000<br>
> 5f80: c03cfee0 00000000 00000000 00000000 00000000 00000000 00000000<br>
> c03cfeec<br>
> 5fa0: 00000000 00000000 c03cfee0 c00093b0 00000000 00000000 00000000<br>
> 00000000<br>
> 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000<br>
> 00000000<br>
> 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00100000<br>
> 000a1000<br>
> [<c01fd194>] (__gpio_to_irq+0x1c/0x44) from [<c04fd468>]<br>
> (navocap_baseboard_init+0xd8/0x2c8)<br>
> [<c04fd468>] (navocap_baseboard_init+0xd8/0x2c8) from [<c04f819c>]<br>
> (customize_machine+0x20/0x30)<br>
> [<c04f819c>] (customize_machine+0x20/0x30) from [<c00087f8>]<br>
> (do_one_initcall+0x2c/0x168)<br>
> [<c00087f8>] (do_one_initcall+0x2c/0x168) from [<c04f62a0>]<br>
> (kernel_init_freeable+0xf4/0x1cc)<br>
> [<c04f62a0>] (kernel_init_freeable+0xf4/0x1cc) from [<c03cfeec>]<br>
> (kernel_init+0xc/0x164)<br>
> [<c03cfeec>] (kernel_init+0xc/0x164) from [<c00093b0>]<br>
> (ret_from_fork+0x14/0x24)<br>
> Code: e0433100 e1a0c000 e7920003 e24dd004 (e590302c)<br>
> ---[ end trace 61bb09c25216d85b ]---<br>
> Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b<br>
><br>
><br>
> The problem is in the function "gpio_to_irq" in my board init functions<br>
> (navocap_baseboard_init).<br>
><br>
> To know which lines the opps appears, I have followed this tutorial :<br>
> <a href="https://wiki.ubuntu.com/Kernel/KernelDebuggingTricks">https://wiki.ubuntu.com/Kernel/KernelDebuggingTricks</a><br>
><br>
> Thanks to it, I can notice that the opps appears when I called the<br>
> "gpio_to_irq" function in :<br>
><br>
> ret = request_irq(gpio_to_irq(IMX_GPIO_NR(2,14)), detect_irq,<br>
> IRQF_TRIGGER_FALLING, "imx-mmc-detect", data);</p>
<p dir="ltr">Make sure your arguments are not NULL (IMX_GPIO_NR, detect_irq and data).</p>
<p dir="ltr">Some extra printk's before calling request_irq should do.</p>
<p dir="ltr">><br>
><br>
> I have checked in other boards how to use this function and it is<br>
> configured in the same way.<br>
> I did see where I have made a mistake. Maybe in my config file where I<br>
> have missed a configuration option ? How to solve this opps problem ? It<br>
> would be very great if someone could give me some helps / feedbacks on<br>
> this problem.<br>
><br>
> Thank you in advance !<br>
><br>
> Best regards,<br>
><br>
><br>
> --<br>
> Mylène JOSSERAND<br>
> Navocap<br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</p>