Re: [help] kernel oops in function gpio_to_irq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,


Just to update you that I have found my problem !
The problem was, in fact, the "gpio_request" function which was every 
time failing and so the "gpio_to_irq" and "request_irq" functions.

After some research and a reading of the gpio documentation (in case I 
would have missed something), I noticed a difference between my code and 
the other IMX27 boards : "imx27_soc_init();" !!!! A very very important 
function that I have forgotten !

And now, all is okay with "gpio_request" and so on ! So happy ! :D
And thank you again, Matthias, for your help / advice :)


Best regards,

-- 
Mylène JOSSERAND
Navocap


Le 02/04/2013 11:45, Mylene Josserand a écrit :
> Hi Matthias,
>
>
> Le 30/03/2013 14:09, Matthias Brugger a écrit :
>>
>> El 27/03/2013 18:16, "Mylene Josserand"<Mylene.Josserand@xxxxxxxxxxx
>> <mailto:Mylene.Josserand@xxxxxxxxxxx>>  va escriure:
>>   >
>>   >  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);
>>
>> Make sure your arguments are not NULL (IMX_GPIO_NR, detect_irq and data).
>>
>> Some extra printk's before calling request_irq should do.
>
>
> Thank you very much for your help !
> I will try that.
>
>>
>>   >
>>   >
>>   >  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
>>   >
>>   >  _______________________________________________
>>   >  Kernelnewbies mailing list
>>   >  Kernelnewbies@xxxxxxxxxxxxxxxxx<mailto:Kernelnewbies@xxxxxxxxxxxxxxxxx>
>>   >  http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
> Best regards,
>

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies





[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux