All of lore.kernel.org
 help / color / mirror / Atom feed
* [GPIO] Crashed when not using
@ 2012-07-30  8:43 Poddar, Sourav
  2012-07-30  9:34 ` DebBarma, Tarun Kanti
  0 siblings, 1 reply; 13+ messages in thread
From: Poddar, Sourav @ 2012-07-30  8:43 UTC (permalink / raw)
  To: lo
  Cc: Santosh Shilimkar, Tarun Kanti DebBarma, Benoit Cousson,
	linux-kernel, Felipe Balbi

Hi All,

I tried using gpio as an interrupt line for my driver
(drivers/staging/iio/light/tsl2x7x_core.c) for omap5.
The interrupt line number was directly passed to the driver using
device tree. But what I observed
is the following crash..


[    1.599273] mousedev: PS/2 mouse device common for all mice
[    1.607513] i2c /dev entries driver
[    1.613739] Driver for 1-wire Dallas network protocol.
[    1.622650] usbcore: registered new interface driver usbhid
[    1.628540] usbhid: USB HID core driver
[    1.633728] Unhandled fault: imprecise external abort (0x1406) at 0x00000000
[    1.641113] Internal error: : 1406 [#1] SMP ARM
[    1.645874] Modules linked in:
[    1.649078] CPU: 0    Not tainted  (3.5.0-02045-g0b474d6-dirty #415)
[    1.655761] PC is at _set_gpio_triggering+0x44/0x264
[    1.660980] LR is at gpio_irq_type+0xb8/0x160
[    1.665527] pc : [<c02dbb68>]    lr : [<c02dc2dc>]    psr: 60000093
[    1.665527] sp : dc851df0  ip : c07a8f00  fp : 00000000
[    1.677581] r10: 00000081  r9 : 00000000  r8 : dc8ffc10
[    1.683074] r7 : 20000093  r6 : 00000000  r5 : 00000001  r4 : fa05b000
[    1.689910] r3 : dc8ffc10  r2 : 00000002  r1 : 00000002  r0 : 00000140
[    1.696746] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM
Segment kernel
[    1.704528] Control: 10c53c7d  Table: 8000406a  DAC: 00000017
[    1.710540] Process swapper/0 (pid: 1, stack limit = 0xdc8502f8)
[    1.716857] Stack: (0xdc851df0 to 0xdc852000)
[    1.721405] 1de0:                                     00000002
c0731280 dc8ffc6c 20000093
[    1.730010] 1e00: c02dc224 c0731280 dc8d4980 00000000 c07a8e50
00000141 00000002 c00a37b8
[    1.738586] 1e20: 00002002 c0731280 dc8d4980 00000141 c07312d4
c07312b4 40000013 c00a3d7c
[    1.747161] 1e40: 00000141 c06728c0 00000000 c0090578 c247f000
c00a2d5c c0412258 00000141
[    1.755737] 1e60: c0731280 c0537818 dc8d4980 c00a3fe4 c07bf6a0
00002002 c071bed8 c247f000
[    1.764312] 1e80: dc9df000 00000004 c07bf6a0 dc9df020 c247f3c0
c04ea344 c06728c0 c247f000
[    1.772888] 1ea0: 00000000 09090578 c07bf6a0 dc9df004 dc9df000
c04ea194 00000091 c071bed8
[    1.781494] 1ec0: c06f89f4 c03e13c0 c03e1314 dc9df020 c0d1afd8
dc9df054 c07bf60c c03272ac
[    1.790069] 1ee0: dc9df020 c07bf60c dc9df054 00000000 00000091
c03274c0 c07bf60c dc851f08
[    1.798645] 1f00: c032742c c0325b10 dc8f26a8 dc9ef790 00000000
c07bf60c c07bcea8 c243d6c0
[    1.807220] 1f20: 00000000 c0326240 c0672958 c02bce08 c07bf5e4
c07bf60c c03e12a0 00000000
[    1.815795] 1f40: 00000091 c071bed8 c06f89f4 c0327ab0 c07bf5e4
00000007 c07c8c40 00000000
[    1.824401] 1f60: 00000091 c03e1738 00000000 dc850000 00000007
c0008648 00000000 c112c9f0
[    1.832977] 1f80: c06a6d58 c06f89f4 00000001 60000013 c06694c8
00000000 00000006 00000006
[    1.841552] 1fa0: 60000013 c0700a20 00000007 c07c8c40 c06d020c
00000091 c071bed8 c0700a28
[    1.850128] 1fc0: 00000000 c06d0380 00000006 00000006 c06d020c
00000000 00000000 c06d028c
[    1.858703] 1fe0: c001548c 00000013 00000000 00000000 00000000
c001548c 3f3f3f3f 3f3f3f3f
[    1.867309] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
[<c02dc224>] (gpio_irq_type+0x0/0x160)
[    1.877075] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
[    1.884552] Code: e3120008 11816006 01c66001 e7846000 (e593c0fc)
[    1.890960] ------------[ cut here ]------------
[    1.895812] WARNING: at arch/arm/mach-omap2/omap_l3_noc.c:113
l3_interrupt_handler+0x184/0x1bc()
[    1.905029] L3 custom error: MASTER:MPU TARGET:L4 PER2
[    1.910430] Modules linked in:
[    1.913635] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
[<c00414c4>] (warn_slowpath_common+0x4c/0x64)
[    1.923492] [<c00414c4>] (warn_slowpath_common+0x4c/0x64) from
[<c0041570>] (warn_slowpath_fmt+0x30/0x40)
[    1.933563] [<c0041570>] (warn_slowpath_fmt+0x30/0x40) from
[<c0035de4>] (l3_interrupt_handler+0x184/0x1bc)
[    1.943786] [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc) from
[<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c)
[    1.954650] [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c) from
[<c00a2adc>] (handle_irq_event+0x3c/0x5c)
[    1.964965] [<c00a2adc>] (handle_irq_event+0x3c/0x5c) from
[<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c)
[    1.974822] [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c) from
[<c00a235c>] (generic_handle_irq+0x34/0x44)
[    1.984863] [<c00a235c>] (generic_handle_irq+0x34/0x44) from
[<c00153a0>] (handle_IRQ+0x4c/0xac)
[    1.994110] [<c00153a0>] (handle_IRQ+0x4c/0xac) from [<c0008480>]
(gic_handle_irq+0x2c/0x60)
[    2.002960] [<c0008480>] (gic_handle_irq+0x2c/0x60) from
[<c04f26e4>] (__irq_svc+0x44/0x60)
[    2.011718] Exception stack(0xdc851c48 to 0xdc851c90)
[    2.017028] 1c40:                   c07a87a0 00000000 dc851c80
00000000 c0743f80 dc851da8
[    2.025604] 1c60: 00000001 00000001 dc851cd7 00000000 c02dbb6a
c02dbb6c ffffffff dc851c90
[    2.034179] 1c80: c04f2440 c04f2444 60000113 ffffffff
[    2.039489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c04f2444>]
(_raw_spin_unlock_irq+0x28/0x2c)
[    2.048797] [<c04f2444>] (_raw_spin_unlock_irq+0x28/0x2c) from
[<c001871c>] (die+0xe0/0x324)
[    2.057647] [<c001871c>] (die+0xe0/0x324) from [<c0008444>]
(do_DataAbort+0x88/0x98)
[    2.065765] [<c0008444>] (do_DataAbort+0x88/0x98) from [<c04f2664>]
(__dabt_svc+0x44/0x80)
[    2.074462] Exception stack(0xdc851da8 to 0xdc851df0)
[    2.079742] 1da0:                   00000140 00000002 00000002
dc8ffc10 fa05b000 00000001
[    2.088317] 1dc0: 00000000 20000093 dc8ffc10 00000000 00000081
00000000 c07a8f00 dc851df0
[    2.096893] 1de0: c02dc2dc c02dbb68 60000093 ffffffff
[    2.102203] [<c04f2664>] (__dabt_svc+0x44/0x80) from [<c02dbb68>]
(_set_gpio_triggering+0x44/0x264)
[    2.111724] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
[<c02dc224>] (gpio_irq_type+0x0/0x160)
[    2.121490] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
[    2.128967] ---[ end trace 8b4b88305e6b2aff ]---
[    2.133911] ---[ end trace 8b4b88305e6b2b00 ]---
[    2.138763] Kernel panic - not syncing: Attempted to kill init!
exitcode=0x0000000b
[    2.138763]
[    2.148376] CPU1: stopping
[    2.151214] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
[<c0019c74>] (handle_IPI+0x130/0x15c)
[    2.160339] [<c0019c74>] (handle_IPI+0x130/0x15c) from [<c00084ac>]
(gic_handle_irq+0x58/0x60)
[    2.169372] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
[<c04f26e4>] (__irq_svc+0x44/0x60)
[    2.178131] Exception stack(0xdc869e10 to 0xdc869e58)
[    2.183410] 9e00:                                     00000000
00000000 00000002 60000113
[    2.191986] 9e20: 00000000 dc868000 c07970e4 00000000 00000000
00000001 00000002 00000000
[    2.200561] 9e40: 00000001 dc869e58 c00936f4 c0093704 60000113 ffffffff
[    2.207489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c0093704>]
(lock_acquire+0xac/0x104)
[    2.216156] [<c0093704>] (lock_acquire+0xac/0x104) from
[<c007a8bc>] (rebalance_domains+0x5c/0x1a8)
[    2.225646] [<c007a8bc>] (rebalance_domains+0x5c/0x1a8) from
[<c007ae84>] (run_rebalance_domains+0x44/0x14c)
[    2.235961] [<c007ae84>] (run_rebalance_domains+0x44/0x14c) from
[<c004a864>] (__do_softirq+0xb4/0x214)
[    2.245819] [<c004a864>] (__do_softirq+0xb4/0x214) from
[<c004aba0>] (irq_exit+0x90/0x98)
[    2.254394] [<c004aba0>] (irq_exit+0x90/0x98) from [<c0019c48>]
(handle_IPI+0x104/0x15c)
[    2.262878] [<c0019c48>] (handle_IPI+0x104/0x15c) from [<c00084ac>]
(gic_handle_irq+0x58/0x60)
[    2.271911] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
[<c04f26e4>] (__irq_svc+0x44/0x60)
[    2.280670] Exception stack(0xdc869f88 to 0xdc869fd0)
[    2.285949] 9f80:                   c07a87a0 c0022a40 00000000
00000000 dc868000 c07c8d08
[    2.294525] 9fa0: c04fe078 c0743d70 00000000 410fc0f0 c0743fa0
00000000 00000000 dc869fd0


The device tree data for acquiring the above GPIO interrupt line looks
like this.

+++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
14:11:08.931694001 +0530
@@ -42,7 +42,8 @@
        tsl2771@39 {
                compatible = "taos,tsl2771";
                reg = <0x39>;
+                interrupt-parent = <&gpio5>;
+                interrupts = <21>; /* gpio line 149 */
        };
 };

Note: using "gpio_request_one" in the driver solves the issue.
Is using this api in the driver required?
Any pointer on the above crash?

~Sourav

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
  2012-07-30  8:43 [GPIO] Crashed when not using Poddar, Sourav
@ 2012-07-30  9:34 ` DebBarma, Tarun Kanti
  2012-07-30 11:15   ` Poddar, Sourav
  0 siblings, 1 reply; 13+ messages in thread
From: DebBarma, Tarun Kanti @ 2012-07-30  9:34 UTC (permalink / raw)
  To: Poddar, Sourav
  Cc: lo, Santosh Shilimkar, Benoit Cousson, linux-kernel, Felipe Balbi

Sourav,

On Mon, Jul 30, 2012 at 2:13 PM, Poddar, Sourav <sourav.poddar@ti.com> wrote:
> Hi All,
>
> I tried using gpio as an interrupt line for my driver
> (drivers/staging/iio/light/tsl2x7x_core.c) for omap5.
> The interrupt line number was directly passed to the driver using
> device tree. But what I observed
> is the following crash..
>
>
> [    1.599273] mousedev: PS/2 mouse device common for all mice
> [    1.607513] i2c /dev entries driver
> [    1.613739] Driver for 1-wire Dallas network protocol.
> [    1.622650] usbcore: registered new interface driver usbhid
> [    1.628540] usbhid: USB HID core driver
> [    1.633728] Unhandled fault: imprecise external abort (0x1406) at 0x00000000
> [    1.641113] Internal error: : 1406 [#1] SMP ARM
> [    1.645874] Modules linked in:
> [    1.649078] CPU: 0    Not tainted  (3.5.0-02045-g0b474d6-dirty #415)
> [    1.655761] PC is at _set_gpio_triggering+0x44/0x264
> [    1.660980] LR is at gpio_irq_type+0xb8/0x160
> [    1.665527] pc : [<c02dbb68>]    lr : [<c02dc2dc>]    psr: 60000093
> [    1.665527] sp : dc851df0  ip : c07a8f00  fp : 00000000
> [    1.677581] r10: 00000081  r9 : 00000000  r8 : dc8ffc10
> [    1.683074] r7 : 20000093  r6 : 00000000  r5 : 00000001  r4 : fa05b000
> [    1.689910] r3 : dc8ffc10  r2 : 00000002  r1 : 00000002  r0 : 00000140
> [    1.696746] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM
> Segment kernel
> [    1.704528] Control: 10c53c7d  Table: 8000406a  DAC: 00000017
> [    1.710540] Process swapper/0 (pid: 1, stack limit = 0xdc8502f8)
> [    1.716857] Stack: (0xdc851df0 to 0xdc852000)
> [    1.721405] 1de0:                                     00000002
> c0731280 dc8ffc6c 20000093
> [    1.730010] 1e00: c02dc224 c0731280 dc8d4980 00000000 c07a8e50
> 00000141 00000002 c00a37b8
> [    1.738586] 1e20: 00002002 c0731280 dc8d4980 00000141 c07312d4
> c07312b4 40000013 c00a3d7c
> [    1.747161] 1e40: 00000141 c06728c0 00000000 c0090578 c247f000
> c00a2d5c c0412258 00000141
> [    1.755737] 1e60: c0731280 c0537818 dc8d4980 c00a3fe4 c07bf6a0
> 00002002 c071bed8 c247f000
> [    1.764312] 1e80: dc9df000 00000004 c07bf6a0 dc9df020 c247f3c0
> c04ea344 c06728c0 c247f000
> [    1.772888] 1ea0: 00000000 09090578 c07bf6a0 dc9df004 dc9df000
> c04ea194 00000091 c071bed8
> [    1.781494] 1ec0: c06f89f4 c03e13c0 c03e1314 dc9df020 c0d1afd8
> dc9df054 c07bf60c c03272ac
> [    1.790069] 1ee0: dc9df020 c07bf60c dc9df054 00000000 00000091
> c03274c0 c07bf60c dc851f08
> [    1.798645] 1f00: c032742c c0325b10 dc8f26a8 dc9ef790 00000000
> c07bf60c c07bcea8 c243d6c0
> [    1.807220] 1f20: 00000000 c0326240 c0672958 c02bce08 c07bf5e4
> c07bf60c c03e12a0 00000000
> [    1.815795] 1f40: 00000091 c071bed8 c06f89f4 c0327ab0 c07bf5e4
> 00000007 c07c8c40 00000000
> [    1.824401] 1f60: 00000091 c03e1738 00000000 dc850000 00000007
> c0008648 00000000 c112c9f0
> [    1.832977] 1f80: c06a6d58 c06f89f4 00000001 60000013 c06694c8
> 00000000 00000006 00000006
> [    1.841552] 1fa0: 60000013 c0700a20 00000007 c07c8c40 c06d020c
> 00000091 c071bed8 c0700a28
> [    1.850128] 1fc0: 00000000 c06d0380 00000006 00000006 c06d020c
> 00000000 00000000 c06d028c
> [    1.858703] 1fe0: c001548c 00000013 00000000 00000000 00000000
> c001548c 3f3f3f3f 3f3f3f3f
> [    1.867309] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
> [<c02dc224>] (gpio_irq_type+0x0/0x160)
> [    1.877075] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
> [    1.884552] Code: e3120008 11816006 01c66001 e7846000 (e593c0fc)
> [    1.890960] ------------[ cut here ]------------
> [    1.895812] WARNING: at arch/arm/mach-omap2/omap_l3_noc.c:113
> l3_interrupt_handler+0x184/0x1bc()
> [    1.905029] L3 custom error: MASTER:MPU TARGET:L4 PER2
> [    1.910430] Modules linked in:
> [    1.913635] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
> [<c00414c4>] (warn_slowpath_common+0x4c/0x64)
> [    1.923492] [<c00414c4>] (warn_slowpath_common+0x4c/0x64) from
> [<c0041570>] (warn_slowpath_fmt+0x30/0x40)
> [    1.933563] [<c0041570>] (warn_slowpath_fmt+0x30/0x40) from
> [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc)
> [    1.943786] [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc) from
> [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c)
> [    1.954650] [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c) from
> [<c00a2adc>] (handle_irq_event+0x3c/0x5c)
> [    1.964965] [<c00a2adc>] (handle_irq_event+0x3c/0x5c) from
> [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c)
> [    1.974822] [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c) from
> [<c00a235c>] (generic_handle_irq+0x34/0x44)
> [    1.984863] [<c00a235c>] (generic_handle_irq+0x34/0x44) from
> [<c00153a0>] (handle_IRQ+0x4c/0xac)
> [    1.994110] [<c00153a0>] (handle_IRQ+0x4c/0xac) from [<c0008480>]
> (gic_handle_irq+0x2c/0x60)
> [    2.002960] [<c0008480>] (gic_handle_irq+0x2c/0x60) from
> [<c04f26e4>] (__irq_svc+0x44/0x60)
> [    2.011718] Exception stack(0xdc851c48 to 0xdc851c90)
> [    2.017028] 1c40:                   c07a87a0 00000000 dc851c80
> 00000000 c0743f80 dc851da8
> [    2.025604] 1c60: 00000001 00000001 dc851cd7 00000000 c02dbb6a
> c02dbb6c ffffffff dc851c90
> [    2.034179] 1c80: c04f2440 c04f2444 60000113 ffffffff
> [    2.039489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c04f2444>]
> (_raw_spin_unlock_irq+0x28/0x2c)
> [    2.048797] [<c04f2444>] (_raw_spin_unlock_irq+0x28/0x2c) from
> [<c001871c>] (die+0xe0/0x324)
> [    2.057647] [<c001871c>] (die+0xe0/0x324) from [<c0008444>]
> (do_DataAbort+0x88/0x98)
> [    2.065765] [<c0008444>] (do_DataAbort+0x88/0x98) from [<c04f2664>]
> (__dabt_svc+0x44/0x80)
> [    2.074462] Exception stack(0xdc851da8 to 0xdc851df0)
> [    2.079742] 1da0:                   00000140 00000002 00000002
> dc8ffc10 fa05b000 00000001
> [    2.088317] 1dc0: 00000000 20000093 dc8ffc10 00000000 00000081
> 00000000 c07a8f00 dc851df0
> [    2.096893] 1de0: c02dc2dc c02dbb68 60000093 ffffffff
> [    2.102203] [<c04f2664>] (__dabt_svc+0x44/0x80) from [<c02dbb68>]
> (_set_gpio_triggering+0x44/0x264)
> [    2.111724] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
> [<c02dc224>] (gpio_irq_type+0x0/0x160)
> [    2.121490] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
> [    2.128967] ---[ end trace 8b4b88305e6b2aff ]---
> [    2.133911] ---[ end trace 8b4b88305e6b2b00 ]---
> [    2.138763] Kernel panic - not syncing: Attempted to kill init!
> exitcode=0x0000000b
> [    2.138763]
> [    2.148376] CPU1: stopping
> [    2.151214] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
> [<c0019c74>] (handle_IPI+0x130/0x15c)
> [    2.160339] [<c0019c74>] (handle_IPI+0x130/0x15c) from [<c00084ac>]
> (gic_handle_irq+0x58/0x60)
> [    2.169372] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
> [<c04f26e4>] (__irq_svc+0x44/0x60)
> [    2.178131] Exception stack(0xdc869e10 to 0xdc869e58)
> [    2.183410] 9e00:                                     00000000
> 00000000 00000002 60000113
> [    2.191986] 9e20: 00000000 dc868000 c07970e4 00000000 00000000
> 00000001 00000002 00000000
> [    2.200561] 9e40: 00000001 dc869e58 c00936f4 c0093704 60000113 ffffffff
> [    2.207489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c0093704>]
> (lock_acquire+0xac/0x104)
> [    2.216156] [<c0093704>] (lock_acquire+0xac/0x104) from
> [<c007a8bc>] (rebalance_domains+0x5c/0x1a8)
> [    2.225646] [<c007a8bc>] (rebalance_domains+0x5c/0x1a8) from
> [<c007ae84>] (run_rebalance_domains+0x44/0x14c)
> [    2.235961] [<c007ae84>] (run_rebalance_domains+0x44/0x14c) from
> [<c004a864>] (__do_softirq+0xb4/0x214)
> [    2.245819] [<c004a864>] (__do_softirq+0xb4/0x214) from
> [<c004aba0>] (irq_exit+0x90/0x98)
> [    2.254394] [<c004aba0>] (irq_exit+0x90/0x98) from [<c0019c48>]
> (handle_IPI+0x104/0x15c)
> [    2.262878] [<c0019c48>] (handle_IPI+0x104/0x15c) from [<c00084ac>]
> (gic_handle_irq+0x58/0x60)
> [    2.271911] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
> [<c04f26e4>] (__irq_svc+0x44/0x60)
> [    2.280670] Exception stack(0xdc869f88 to 0xdc869fd0)
> [    2.285949] 9f80:                   c07a87a0 c0022a40 00000000
> 00000000 dc868000 c07c8d08
> [    2.294525] 9fa0: c04fe078 c0743d70 00000000 410fc0f0 c0743fa0
> 00000000 00000000 dc869fd0
>
>
> The device tree data for acquiring the above GPIO interrupt line looks
> like this.
>
> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
> 14:11:08.931694001 +0530
> @@ -42,7 +42,8 @@
>         tsl2771@39 {
>                 compatible = "taos,tsl2771";
>                 reg = <0x39>;
> +                interrupt-parent = <&gpio5>;
> +                interrupts = <21>; /* gpio line 149 */
>         };
>  };
>
> Note: using "gpio_request_one" in the driver solves the issue.
> Is using this api in the driver required?
> Any pointer on the above crash?

Any user/client driver of GPIO is supposed to go through
gpio_request() API so that module clock
is enabled correctly. Overriding of APIs would put the power
management state machine in jeopardy.
--
Tarun

>
> ~Sourav

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
  2012-07-30  9:34 ` DebBarma, Tarun Kanti
@ 2012-07-30 11:15   ` Poddar, Sourav
  2012-07-30 20:36       ` Kevin Hilman
  0 siblings, 1 reply; 13+ messages in thread
From: Poddar, Sourav @ 2012-07-30 11:15 UTC (permalink / raw)
  To: DebBarma, Tarun Kanti
  Cc: lo, Santosh Shilimkar, Benoit Cousson, linux-kernel, Felipe Balbi

On Mon, Jul 30, 2012 at 3:04 PM, DebBarma, Tarun Kanti
<tarun.kanti@ti.com> wrote:
> Sourav,
>
> On Mon, Jul 30, 2012 at 2:13 PM, Poddar, Sourav <sourav.poddar@ti.com> wrote:
>> Hi All,
>>
>> I tried using gpio as an interrupt line for my driver
>> (drivers/staging/iio/light/tsl2x7x_core.c) for omap5.
>> The interrupt line number was directly passed to the driver using
>> device tree. But what I observed
>> is the following crash..
>>
>>
>> [    1.599273] mousedev: PS/2 mouse device common for all mice
>> [    1.607513] i2c /dev entries driver
>> [    1.613739] Driver for 1-wire Dallas network protocol.
>> [    1.622650] usbcore: registered new interface driver usbhid
>> [    1.628540] usbhid: USB HID core driver
>> [    1.633728] Unhandled fault: imprecise external abort (0x1406) at 0x00000000
>> [    1.641113] Internal error: : 1406 [#1] SMP ARM
>> [    1.645874] Modules linked in:
>> [    1.649078] CPU: 0    Not tainted  (3.5.0-02045-g0b474d6-dirty #415)
>> [    1.655761] PC is at _set_gpio_triggering+0x44/0x264
>> [    1.660980] LR is at gpio_irq_type+0xb8/0x160
>> [    1.665527] pc : [<c02dbb68>]    lr : [<c02dc2dc>]    psr: 60000093
>> [    1.665527] sp : dc851df0  ip : c07a8f00  fp : 00000000
>> [    1.677581] r10: 00000081  r9 : 00000000  r8 : dc8ffc10
>> [    1.683074] r7 : 20000093  r6 : 00000000  r5 : 00000001  r4 : fa05b000
>> [    1.689910] r3 : dc8ffc10  r2 : 00000002  r1 : 00000002  r0 : 00000140
>> [    1.696746] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM
>> Segment kernel
>> [    1.704528] Control: 10c53c7d  Table: 8000406a  DAC: 00000017
>> [    1.710540] Process swapper/0 (pid: 1, stack limit = 0xdc8502f8)
>> [    1.716857] Stack: (0xdc851df0 to 0xdc852000)
>> [    1.721405] 1de0:                                     00000002
>> c0731280 dc8ffc6c 20000093
>> [    1.730010] 1e00: c02dc224 c0731280 dc8d4980 00000000 c07a8e50
>> 00000141 00000002 c00a37b8
>> [    1.738586] 1e20: 00002002 c0731280 dc8d4980 00000141 c07312d4
>> c07312b4 40000013 c00a3d7c
>> [    1.747161] 1e40: 00000141 c06728c0 00000000 c0090578 c247f000
>> c00a2d5c c0412258 00000141
>> [    1.755737] 1e60: c0731280 c0537818 dc8d4980 c00a3fe4 c07bf6a0
>> 00002002 c071bed8 c247f000
>> [    1.764312] 1e80: dc9df000 00000004 c07bf6a0 dc9df020 c247f3c0
>> c04ea344 c06728c0 c247f000
>> [    1.772888] 1ea0: 00000000 09090578 c07bf6a0 dc9df004 dc9df000
>> c04ea194 00000091 c071bed8
>> [    1.781494] 1ec0: c06f89f4 c03e13c0 c03e1314 dc9df020 c0d1afd8
>> dc9df054 c07bf60c c03272ac
>> [    1.790069] 1ee0: dc9df020 c07bf60c dc9df054 00000000 00000091
>> c03274c0 c07bf60c dc851f08
>> [    1.798645] 1f00: c032742c c0325b10 dc8f26a8 dc9ef790 00000000
>> c07bf60c c07bcea8 c243d6c0
>> [    1.807220] 1f20: 00000000 c0326240 c0672958 c02bce08 c07bf5e4
>> c07bf60c c03e12a0 00000000
>> [    1.815795] 1f40: 00000091 c071bed8 c06f89f4 c0327ab0 c07bf5e4
>> 00000007 c07c8c40 00000000
>> [    1.824401] 1f60: 00000091 c03e1738 00000000 dc850000 00000007
>> c0008648 00000000 c112c9f0
>> [    1.832977] 1f80: c06a6d58 c06f89f4 00000001 60000013 c06694c8
>> 00000000 00000006 00000006
>> [    1.841552] 1fa0: 60000013 c0700a20 00000007 c07c8c40 c06d020c
>> 00000091 c071bed8 c0700a28
>> [    1.850128] 1fc0: 00000000 c06d0380 00000006 00000006 c06d020c
>> 00000000 00000000 c06d028c
>> [    1.858703] 1fe0: c001548c 00000013 00000000 00000000 00000000
>> c001548c 3f3f3f3f 3f3f3f3f
>> [    1.867309] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
>> [<c02dc224>] (gpio_irq_type+0x0/0x160)
>> [    1.877075] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
>> [    1.884552] Code: e3120008 11816006 01c66001 e7846000 (e593c0fc)
>> [    1.890960] ------------[ cut here ]------------
>> [    1.895812] WARNING: at arch/arm/mach-omap2/omap_l3_noc.c:113
>> l3_interrupt_handler+0x184/0x1bc()
>> [    1.905029] L3 custom error: MASTER:MPU TARGET:L4 PER2
>> [    1.910430] Modules linked in:
>> [    1.913635] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
>> [<c00414c4>] (warn_slowpath_common+0x4c/0x64)
>> [    1.923492] [<c00414c4>] (warn_slowpath_common+0x4c/0x64) from
>> [<c0041570>] (warn_slowpath_fmt+0x30/0x40)
>> [    1.933563] [<c0041570>] (warn_slowpath_fmt+0x30/0x40) from
>> [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc)
>> [    1.943786] [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc) from
>> [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c)
>> [    1.954650] [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c) from
>> [<c00a2adc>] (handle_irq_event+0x3c/0x5c)
>> [    1.964965] [<c00a2adc>] (handle_irq_event+0x3c/0x5c) from
>> [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c)
>> [    1.974822] [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c) from
>> [<c00a235c>] (generic_handle_irq+0x34/0x44)
>> [    1.984863] [<c00a235c>] (generic_handle_irq+0x34/0x44) from
>> [<c00153a0>] (handle_IRQ+0x4c/0xac)
>> [    1.994110] [<c00153a0>] (handle_IRQ+0x4c/0xac) from [<c0008480>]
>> (gic_handle_irq+0x2c/0x60)
>> [    2.002960] [<c0008480>] (gic_handle_irq+0x2c/0x60) from
>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>> [    2.011718] Exception stack(0xdc851c48 to 0xdc851c90)
>> [    2.017028] 1c40:                   c07a87a0 00000000 dc851c80
>> 00000000 c0743f80 dc851da8
>> [    2.025604] 1c60: 00000001 00000001 dc851cd7 00000000 c02dbb6a
>> c02dbb6c ffffffff dc851c90
>> [    2.034179] 1c80: c04f2440 c04f2444 60000113 ffffffff
>> [    2.039489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c04f2444>]
>> (_raw_spin_unlock_irq+0x28/0x2c)
>> [    2.048797] [<c04f2444>] (_raw_spin_unlock_irq+0x28/0x2c) from
>> [<c001871c>] (die+0xe0/0x324)
>> [    2.057647] [<c001871c>] (die+0xe0/0x324) from [<c0008444>]
>> (do_DataAbort+0x88/0x98)
>> [    2.065765] [<c0008444>] (do_DataAbort+0x88/0x98) from [<c04f2664>]
>> (__dabt_svc+0x44/0x80)
>> [    2.074462] Exception stack(0xdc851da8 to 0xdc851df0)
>> [    2.079742] 1da0:                   00000140 00000002 00000002
>> dc8ffc10 fa05b000 00000001
>> [    2.088317] 1dc0: 00000000 20000093 dc8ffc10 00000000 00000081
>> 00000000 c07a8f00 dc851df0
>> [    2.096893] 1de0: c02dc2dc c02dbb68 60000093 ffffffff
>> [    2.102203] [<c04f2664>] (__dabt_svc+0x44/0x80) from [<c02dbb68>]
>> (_set_gpio_triggering+0x44/0x264)
>> [    2.111724] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
>> [<c02dc224>] (gpio_irq_type+0x0/0x160)
>> [    2.121490] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
>> [    2.128967] ---[ end trace 8b4b88305e6b2aff ]---
>> [    2.133911] ---[ end trace 8b4b88305e6b2b00 ]---
>> [    2.138763] Kernel panic - not syncing: Attempted to kill init!
>> exitcode=0x0000000b
>> [    2.138763]
>> [    2.148376] CPU1: stopping
>> [    2.151214] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
>> [<c0019c74>] (handle_IPI+0x130/0x15c)
>> [    2.160339] [<c0019c74>] (handle_IPI+0x130/0x15c) from [<c00084ac>]
>> (gic_handle_irq+0x58/0x60)
>> [    2.169372] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>> [    2.178131] Exception stack(0xdc869e10 to 0xdc869e58)
>> [    2.183410] 9e00:                                     00000000
>> 00000000 00000002 60000113
>> [    2.191986] 9e20: 00000000 dc868000 c07970e4 00000000 00000000
>> 00000001 00000002 00000000
>> [    2.200561] 9e40: 00000001 dc869e58 c00936f4 c0093704 60000113 ffffffff
>> [    2.207489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c0093704>]
>> (lock_acquire+0xac/0x104)
>> [    2.216156] [<c0093704>] (lock_acquire+0xac/0x104) from
>> [<c007a8bc>] (rebalance_domains+0x5c/0x1a8)
>> [    2.225646] [<c007a8bc>] (rebalance_domains+0x5c/0x1a8) from
>> [<c007ae84>] (run_rebalance_domains+0x44/0x14c)
>> [    2.235961] [<c007ae84>] (run_rebalance_domains+0x44/0x14c) from
>> [<c004a864>] (__do_softirq+0xb4/0x214)
>> [    2.245819] [<c004a864>] (__do_softirq+0xb4/0x214) from
>> [<c004aba0>] (irq_exit+0x90/0x98)
>> [    2.254394] [<c004aba0>] (irq_exit+0x90/0x98) from [<c0019c48>]
>> (handle_IPI+0x104/0x15c)
>> [    2.262878] [<c0019c48>] (handle_IPI+0x104/0x15c) from [<c00084ac>]
>> (gic_handle_irq+0x58/0x60)
>> [    2.271911] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>> [    2.280670] Exception stack(0xdc869f88 to 0xdc869fd0)
>> [    2.285949] 9f80:                   c07a87a0 c0022a40 00000000
>> 00000000 dc868000 c07c8d08
>> [    2.294525] 9fa0: c04fe078 c0743d70 00000000 410fc0f0 c0743fa0
>> 00000000 00000000 dc869fd0
>>
>>
>> The device tree data for acquiring the above GPIO interrupt line looks
>> like this.
>>
>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
>> 14:11:08.931694001 +0530
>> @@ -42,7 +42,8 @@
>>         tsl2771@39 {
>>                 compatible = "taos,tsl2771";
>>                 reg = <0x39>;
>> +                interrupt-parent = <&gpio5>;
>> +                interrupts = <21>; /* gpio line 149 */
>>         };
>>  };
>>
>> Note: using "gpio_request_one" in the driver solves the issue.
>> Is using this api in the driver required?
>> Any pointer on the above crash?
>
Hi Tarun,
> Any user/client driver of GPIO is supposed to go through
> gpio_request() API so that module clock
> is enabled correctly. Overriding of APIs would put the power
> management state machine in jeopardy.
> --
I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the kernel
is crashing and the crash is no longer observed. So indeed, its about
enabling clocks.

One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
the use of
"gpio_request_one"??
> Tarun
>
>>
>> ~Sourav

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
  2012-07-30 11:15   ` Poddar, Sourav
@ 2012-07-30 20:36       ` Kevin Hilman
  0 siblings, 0 replies; 13+ messages in thread
From: Kevin Hilman @ 2012-07-30 20:36 UTC (permalink / raw)
  To: Poddar, Sourav
  Cc: DebBarma, Tarun Kanti, lo, Santosh Shilimkar, Benoit Cousson,
	linux-kernel, Felipe Balbi

"Poddar, Sourav" <sourav.poddar@ti.com> writes:

> On Mon, Jul 30, 2012 at 3:04 PM, DebBarma, Tarun Kanti
> <tarun.kanti@ti.com> wrote:
>> Sourav,
>>
>> On Mon, Jul 30, 2012 at 2:13 PM, Poddar, Sourav <sourav.poddar@ti.com> wrote:
>>> Hi All,
>>>
>>> I tried using gpio as an interrupt line for my driver
>>> (drivers/staging/iio/light/tsl2x7x_core.c) for omap5.
>>> The interrupt line number was directly passed to the driver using
>>> device tree. But what I observed
>>> is the following crash..
>>>
>>>
>>> [    1.599273] mousedev: PS/2 mouse device common for all mice
>>> [    1.607513] i2c /dev entries driver
>>> [    1.613739] Driver for 1-wire Dallas network protocol.
>>> [    1.622650] usbcore: registered new interface driver usbhid
>>> [    1.628540] usbhid: USB HID core driver
>>> [    1.633728] Unhandled fault: imprecise external abort (0x1406) at 0x00000000
>>> [    1.641113] Internal error: : 1406 [#1] SMP ARM
>>> [    1.645874] Modules linked in:
>>> [    1.649078] CPU: 0    Not tainted  (3.5.0-02045-g0b474d6-dirty #415)
>>> [    1.655761] PC is at _set_gpio_triggering+0x44/0x264
>>> [    1.660980] LR is at gpio_irq_type+0xb8/0x160
>>> [    1.665527] pc : [<c02dbb68>]    lr : [<c02dc2dc>]    psr: 60000093
>>> [    1.665527] sp : dc851df0  ip : c07a8f00  fp : 00000000
>>> [    1.677581] r10: 00000081  r9 : 00000000  r8 : dc8ffc10
>>> [    1.683074] r7 : 20000093  r6 : 00000000  r5 : 00000001  r4 : fa05b000
>>> [    1.689910] r3 : dc8ffc10  r2 : 00000002  r1 : 00000002  r0 : 00000140
>>> [    1.696746] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM
>>> Segment kernel
>>> [    1.704528] Control: 10c53c7d  Table: 8000406a  DAC: 00000017
>>> [    1.710540] Process swapper/0 (pid: 1, stack limit = 0xdc8502f8)
>>> [    1.716857] Stack: (0xdc851df0 to 0xdc852000)
>>> [    1.721405] 1de0:                                     00000002
>>> c0731280 dc8ffc6c 20000093
>>> [    1.730010] 1e00: c02dc224 c0731280 dc8d4980 00000000 c07a8e50
>>> 00000141 00000002 c00a37b8
>>> [    1.738586] 1e20: 00002002 c0731280 dc8d4980 00000141 c07312d4
>>> c07312b4 40000013 c00a3d7c
>>> [    1.747161] 1e40: 00000141 c06728c0 00000000 c0090578 c247f000
>>> c00a2d5c c0412258 00000141
>>> [    1.755737] 1e60: c0731280 c0537818 dc8d4980 c00a3fe4 c07bf6a0
>>> 00002002 c071bed8 c247f000
>>> [    1.764312] 1e80: dc9df000 00000004 c07bf6a0 dc9df020 c247f3c0
>>> c04ea344 c06728c0 c247f000
>>> [    1.772888] 1ea0: 00000000 09090578 c07bf6a0 dc9df004 dc9df000
>>> c04ea194 00000091 c071bed8
>>> [    1.781494] 1ec0: c06f89f4 c03e13c0 c03e1314 dc9df020 c0d1afd8
>>> dc9df054 c07bf60c c03272ac
>>> [    1.790069] 1ee0: dc9df020 c07bf60c dc9df054 00000000 00000091
>>> c03274c0 c07bf60c dc851f08
>>> [    1.798645] 1f00: c032742c c0325b10 dc8f26a8 dc9ef790 00000000
>>> c07bf60c c07bcea8 c243d6c0
>>> [    1.807220] 1f20: 00000000 c0326240 c0672958 c02bce08 c07bf5e4
>>> c07bf60c c03e12a0 00000000
>>> [    1.815795] 1f40: 00000091 c071bed8 c06f89f4 c0327ab0 c07bf5e4
>>> 00000007 c07c8c40 00000000
>>> [    1.824401] 1f60: 00000091 c03e1738 00000000 dc850000 00000007
>>> c0008648 00000000 c112c9f0
>>> [    1.832977] 1f80: c06a6d58 c06f89f4 00000001 60000013 c06694c8
>>> 00000000 00000006 00000006
>>> [    1.841552] 1fa0: 60000013 c0700a20 00000007 c07c8c40 c06d020c
>>> 00000091 c071bed8 c0700a28
>>> [    1.850128] 1fc0: 00000000 c06d0380 00000006 00000006 c06d020c
>>> 00000000 00000000 c06d028c
>>> [    1.858703] 1fe0: c001548c 00000013 00000000 00000000 00000000
>>> c001548c 3f3f3f3f 3f3f3f3f
>>> [    1.867309] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
>>> [<c02dc224>] (gpio_irq_type+0x0/0x160)
>>> [    1.877075] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
>>> [    1.884552] Code: e3120008 11816006 01c66001 e7846000 (e593c0fc)
>>> [    1.890960] ------------[ cut here ]------------
>>> [    1.895812] WARNING: at arch/arm/mach-omap2/omap_l3_noc.c:113
>>> l3_interrupt_handler+0x184/0x1bc()
>>> [    1.905029] L3 custom error: MASTER:MPU TARGET:L4 PER2
>>> [    1.910430] Modules linked in:
>>> [    1.913635] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
>>> [<c00414c4>] (warn_slowpath_common+0x4c/0x64)
>>> [    1.923492] [<c00414c4>] (warn_slowpath_common+0x4c/0x64) from
>>> [<c0041570>] (warn_slowpath_fmt+0x30/0x40)
>>> [    1.933563] [<c0041570>] (warn_slowpath_fmt+0x30/0x40) from
>>> [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc)
>>> [    1.943786] [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc) from
>>> [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c)
>>> [    1.954650] [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c) from
>>> [<c00a2adc>] (handle_irq_event+0x3c/0x5c)
>>> [    1.964965] [<c00a2adc>] (handle_irq_event+0x3c/0x5c) from
>>> [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c)
>>> [    1.974822] [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c) from
>>> [<c00a235c>] (generic_handle_irq+0x34/0x44)
>>> [    1.984863] [<c00a235c>] (generic_handle_irq+0x34/0x44) from
>>> [<c00153a0>] (handle_IRQ+0x4c/0xac)
>>> [    1.994110] [<c00153a0>] (handle_IRQ+0x4c/0xac) from [<c0008480>]
>>> (gic_handle_irq+0x2c/0x60)
>>> [    2.002960] [<c0008480>] (gic_handle_irq+0x2c/0x60) from
>>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>>> [    2.011718] Exception stack(0xdc851c48 to 0xdc851c90)
>>> [    2.017028] 1c40:                   c07a87a0 00000000 dc851c80
>>> 00000000 c0743f80 dc851da8
>>> [    2.025604] 1c60: 00000001 00000001 dc851cd7 00000000 c02dbb6a
>>> c02dbb6c ffffffff dc851c90
>>> [    2.034179] 1c80: c04f2440 c04f2444 60000113 ffffffff
>>> [    2.039489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c04f2444>]
>>> (_raw_spin_unlock_irq+0x28/0x2c)
>>> [    2.048797] [<c04f2444>] (_raw_spin_unlock_irq+0x28/0x2c) from
>>> [<c001871c>] (die+0xe0/0x324)
>>> [    2.057647] [<c001871c>] (die+0xe0/0x324) from [<c0008444>]
>>> (do_DataAbort+0x88/0x98)
>>> [    2.065765] [<c0008444>] (do_DataAbort+0x88/0x98) from [<c04f2664>]
>>> (__dabt_svc+0x44/0x80)
>>> [    2.074462] Exception stack(0xdc851da8 to 0xdc851df0)
>>> [    2.079742] 1da0:                   00000140 00000002 00000002
>>> dc8ffc10 fa05b000 00000001
>>> [    2.088317] 1dc0: 00000000 20000093 dc8ffc10 00000000 00000081
>>> 00000000 c07a8f00 dc851df0
>>> [    2.096893] 1de0: c02dc2dc c02dbb68 60000093 ffffffff
>>> [    2.102203] [<c04f2664>] (__dabt_svc+0x44/0x80) from [<c02dbb68>]
>>> (_set_gpio_triggering+0x44/0x264)
>>> [    2.111724] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
>>> [<c02dc224>] (gpio_irq_type+0x0/0x160)
>>> [    2.121490] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
>>> [    2.128967] ---[ end trace 8b4b88305e6b2aff ]---
>>> [    2.133911] ---[ end trace 8b4b88305e6b2b00 ]---
>>> [    2.138763] Kernel panic - not syncing: Attempted to kill init!
>>> exitcode=0x0000000b
>>> [    2.138763]
>>> [    2.148376] CPU1: stopping
>>> [    2.151214] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
>>> [<c0019c74>] (handle_IPI+0x130/0x15c)
>>> [    2.160339] [<c0019c74>] (handle_IPI+0x130/0x15c) from [<c00084ac>]
>>> (gic_handle_irq+0x58/0x60)
>>> [    2.169372] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
>>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>>> [    2.178131] Exception stack(0xdc869e10 to 0xdc869e58)
>>> [    2.183410] 9e00:                                     00000000
>>> 00000000 00000002 60000113
>>> [    2.191986] 9e20: 00000000 dc868000 c07970e4 00000000 00000000
>>> 00000001 00000002 00000000
>>> [    2.200561] 9e40: 00000001 dc869e58 c00936f4 c0093704 60000113 ffffffff
>>> [    2.207489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c0093704>]
>>> (lock_acquire+0xac/0x104)
>>> [    2.216156] [<c0093704>] (lock_acquire+0xac/0x104) from
>>> [<c007a8bc>] (rebalance_domains+0x5c/0x1a8)
>>> [    2.225646] [<c007a8bc>] (rebalance_domains+0x5c/0x1a8) from
>>> [<c007ae84>] (run_rebalance_domains+0x44/0x14c)
>>> [    2.235961] [<c007ae84>] (run_rebalance_domains+0x44/0x14c) from
>>> [<c004a864>] (__do_softirq+0xb4/0x214)
>>> [    2.245819] [<c004a864>] (__do_softirq+0xb4/0x214) from
>>> [<c004aba0>] (irq_exit+0x90/0x98)
>>> [    2.254394] [<c004aba0>] (irq_exit+0x90/0x98) from [<c0019c48>]
>>> (handle_IPI+0x104/0x15c)
>>> [    2.262878] [<c0019c48>] (handle_IPI+0x104/0x15c) from [<c00084ac>]
>>> (gic_handle_irq+0x58/0x60)
>>> [    2.271911] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
>>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>>> [    2.280670] Exception stack(0xdc869f88 to 0xdc869fd0)
>>> [    2.285949] 9f80:                   c07a87a0 c0022a40 00000000
>>> 00000000 dc868000 c07c8d08
>>> [    2.294525] 9fa0: c04fe078 c0743d70 00000000 410fc0f0 c0743fa0
>>> 00000000 00000000 dc869fd0
>>>
>>>
>>> The device tree data for acquiring the above GPIO interrupt line looks
>>> like this.
>>>
>>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
>>> 14:11:08.931694001 +0530
>>> @@ -42,7 +42,8 @@
>>>         tsl2771@39 {
>>>                 compatible = "taos,tsl2771";
>>>                 reg = <0x39>;
>>> +                interrupt-parent = <&gpio5>;
>>> +                interrupts = <21>; /* gpio line 149 */
>>>         };
>>>  };
>>>
>>> Note: using "gpio_request_one" in the driver solves the issue.
>>> Is using this api in the driver required?
>>> Any pointer on the above crash?
>>
> Hi Tarun,
>> Any user/client driver of GPIO is supposed to go through
>> gpio_request() API so that module clock
>> is enabled correctly. Overriding of APIs would put the power
>> management state machine in jeopardy.
>> --
> I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the kernel
> is crashing and the crash is no longer observed. So indeed, its about
> enabling clocks.
>
> One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
> the use of
> "gpio_request_one"??

No.

You must use the GPIO requiest/free APIs to tell the GPIO core that
the GPIO line is in use.

Why do you want to avoid using gpio_request/gpio_free?

Kevin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
@ 2012-07-30 20:36       ` Kevin Hilman
  0 siblings, 0 replies; 13+ messages in thread
From: Kevin Hilman @ 2012-07-30 20:36 UTC (permalink / raw)
  To: Poddar, Sourav
  Cc: DebBarma, Tarun Kanti, lo, Santosh Shilimkar, Benoit Cousson,
	linux-kernel, Felipe Balbi

"Poddar, Sourav" <sourav.poddar@ti.com> writes:

> On Mon, Jul 30, 2012 at 3:04 PM, DebBarma, Tarun Kanti
> <tarun.kanti@ti.com> wrote:
>> Sourav,
>>
>> On Mon, Jul 30, 2012 at 2:13 PM, Poddar, Sourav <sourav.poddar@ti.com> wrote:
>>> Hi All,
>>>
>>> I tried using gpio as an interrupt line for my driver
>>> (drivers/staging/iio/light/tsl2x7x_core.c) for omap5.
>>> The interrupt line number was directly passed to the driver using
>>> device tree. But what I observed
>>> is the following crash..
>>>
>>>
>>> [    1.599273] mousedev: PS/2 mouse device common for all mice
>>> [    1.607513] i2c /dev entries driver
>>> [    1.613739] Driver for 1-wire Dallas network protocol.
>>> [    1.622650] usbcore: registered new interface driver usbhid
>>> [    1.628540] usbhid: USB HID core driver
>>> [    1.633728] Unhandled fault: imprecise external abort (0x1406) at 0x00000000
>>> [    1.641113] Internal error: : 1406 [#1] SMP ARM
>>> [    1.645874] Modules linked in:
>>> [    1.649078] CPU: 0    Not tainted  (3.5.0-02045-g0b474d6-dirty #415)
>>> [    1.655761] PC is at _set_gpio_triggering+0x44/0x264
>>> [    1.660980] LR is at gpio_irq_type+0xb8/0x160
>>> [    1.665527] pc : [<c02dbb68>]    lr : [<c02dc2dc>]    psr: 60000093
>>> [    1.665527] sp : dc851df0  ip : c07a8f00  fp : 00000000
>>> [    1.677581] r10: 00000081  r9 : 00000000  r8 : dc8ffc10
>>> [    1.683074] r7 : 20000093  r6 : 00000000  r5 : 00000001  r4 : fa05b000
>>> [    1.689910] r3 : dc8ffc10  r2 : 00000002  r1 : 00000002  r0 : 00000140
>>> [    1.696746] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM
>>> Segment kernel
>>> [    1.704528] Control: 10c53c7d  Table: 8000406a  DAC: 00000017
>>> [    1.710540] Process swapper/0 (pid: 1, stack limit = 0xdc8502f8)
>>> [    1.716857] Stack: (0xdc851df0 to 0xdc852000)
>>> [    1.721405] 1de0:                                     00000002
>>> c0731280 dc8ffc6c 20000093
>>> [    1.730010] 1e00: c02dc224 c0731280 dc8d4980 00000000 c07a8e50
>>> 00000141 00000002 c00a37b8
>>> [    1.738586] 1e20: 00002002 c0731280 dc8d4980 00000141 c07312d4
>>> c07312b4 40000013 c00a3d7c
>>> [    1.747161] 1e40: 00000141 c06728c0 00000000 c0090578 c247f000
>>> c00a2d5c c0412258 00000141
>>> [    1.755737] 1e60: c0731280 c0537818 dc8d4980 c00a3fe4 c07bf6a0
>>> 00002002 c071bed8 c247f000
>>> [    1.764312] 1e80: dc9df000 00000004 c07bf6a0 dc9df020 c247f3c0
>>> c04ea344 c06728c0 c247f000
>>> [    1.772888] 1ea0: 00000000 09090578 c07bf6a0 dc9df004 dc9df000
>>> c04ea194 00000091 c071bed8
>>> [    1.781494] 1ec0: c06f89f4 c03e13c0 c03e1314 dc9df020 c0d1afd8
>>> dc9df054 c07bf60c c03272ac
>>> [    1.790069] 1ee0: dc9df020 c07bf60c dc9df054 00000000 00000091
>>> c03274c0 c07bf60c dc851f08
>>> [    1.798645] 1f00: c032742c c0325b10 dc8f26a8 dc9ef790 00000000
>>> c07bf60c c07bcea8 c243d6c0
>>> [    1.807220] 1f20: 00000000 c0326240 c0672958 c02bce08 c07bf5e4
>>> c07bf60c c03e12a0 00000000
>>> [    1.815795] 1f40: 00000091 c071bed8 c06f89f4 c0327ab0 c07bf5e4
>>> 00000007 c07c8c40 00000000
>>> [    1.824401] 1f60: 00000091 c03e1738 00000000 dc850000 00000007
>>> c0008648 00000000 c112c9f0
>>> [    1.832977] 1f80: c06a6d58 c06f89f4 00000001 60000013 c06694c8
>>> 00000000 00000006 00000006
>>> [    1.841552] 1fa0: 60000013 c0700a20 00000007 c07c8c40 c06d020c
>>> 00000091 c071bed8 c0700a28
>>> [    1.850128] 1fc0: 00000000 c06d0380 00000006 00000006 c06d020c
>>> 00000000 00000000 c06d028c
>>> [    1.858703] 1fe0: c001548c 00000013 00000000 00000000 00000000
>>> c001548c 3f3f3f3f 3f3f3f3f
>>> [    1.867309] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
>>> [<c02dc224>] (gpio_irq_type+0x0/0x160)
>>> [    1.877075] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
>>> [    1.884552] Code: e3120008 11816006 01c66001 e7846000 (e593c0fc)
>>> [    1.890960] ------------[ cut here ]------------
>>> [    1.895812] WARNING: at arch/arm/mach-omap2/omap_l3_noc.c:113
>>> l3_interrupt_handler+0x184/0x1bc()
>>> [    1.905029] L3 custom error: MASTER:MPU TARGET:L4 PER2
>>> [    1.910430] Modules linked in:
>>> [    1.913635] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
>>> [<c00414c4>] (warn_slowpath_common+0x4c/0x64)
>>> [    1.923492] [<c00414c4>] (warn_slowpath_common+0x4c/0x64) from
>>> [<c0041570>] (warn_slowpath_fmt+0x30/0x40)
>>> [    1.933563] [<c0041570>] (warn_slowpath_fmt+0x30/0x40) from
>>> [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc)
>>> [    1.943786] [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc) from
>>> [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c)
>>> [    1.954650] [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c) from
>>> [<c00a2adc>] (handle_irq_event+0x3c/0x5c)
>>> [    1.964965] [<c00a2adc>] (handle_irq_event+0x3c/0x5c) from
>>> [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c)
>>> [    1.974822] [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c) from
>>> [<c00a235c>] (generic_handle_irq+0x34/0x44)
>>> [    1.984863] [<c00a235c>] (generic_handle_irq+0x34/0x44) from
>>> [<c00153a0>] (handle_IRQ+0x4c/0xac)
>>> [    1.994110] [<c00153a0>] (handle_IRQ+0x4c/0xac) from [<c0008480>]
>>> (gic_handle_irq+0x2c/0x60)
>>> [    2.002960] [<c0008480>] (gic_handle_irq+0x2c/0x60) from
>>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>>> [    2.011718] Exception stack(0xdc851c48 to 0xdc851c90)
>>> [    2.017028] 1c40:                   c07a87a0 00000000 dc851c80
>>> 00000000 c0743f80 dc851da8
>>> [    2.025604] 1c60: 00000001 00000001 dc851cd7 00000000 c02dbb6a
>>> c02dbb6c ffffffff dc851c90
>>> [    2.034179] 1c80: c04f2440 c04f2444 60000113 ffffffff
>>> [    2.039489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c04f2444>]
>>> (_raw_spin_unlock_irq+0x28/0x2c)
>>> [    2.048797] [<c04f2444>] (_raw_spin_unlock_irq+0x28/0x2c) from
>>> [<c001871c>] (die+0xe0/0x324)
>>> [    2.057647] [<c001871c>] (die+0xe0/0x324) from [<c0008444>]
>>> (do_DataAbort+0x88/0x98)
>>> [    2.065765] [<c0008444>] (do_DataAbort+0x88/0x98) from [<c04f2664>]
>>> (__dabt_svc+0x44/0x80)
>>> [    2.074462] Exception stack(0xdc851da8 to 0xdc851df0)
>>> [    2.079742] 1da0:                   00000140 00000002 00000002
>>> dc8ffc10 fa05b000 00000001
>>> [    2.088317] 1dc0: 00000000 20000093 dc8ffc10 00000000 00000081
>>> 00000000 c07a8f00 dc851df0
>>> [    2.096893] 1de0: c02dc2dc c02dbb68 60000093 ffffffff
>>> [    2.102203] [<c04f2664>] (__dabt_svc+0x44/0x80) from [<c02dbb68>]
>>> (_set_gpio_triggering+0x44/0x264)
>>> [    2.111724] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
>>> [<c02dc224>] (gpio_irq_type+0x0/0x160)
>>> [    2.121490] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
>>> [    2.128967] ---[ end trace 8b4b88305e6b2aff ]---
>>> [    2.133911] ---[ end trace 8b4b88305e6b2b00 ]---
>>> [    2.138763] Kernel panic - not syncing: Attempted to kill init!
>>> exitcode=0x0000000b
>>> [    2.138763]
>>> [    2.148376] CPU1: stopping
>>> [    2.151214] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
>>> [<c0019c74>] (handle_IPI+0x130/0x15c)
>>> [    2.160339] [<c0019c74>] (handle_IPI+0x130/0x15c) from [<c00084ac>]
>>> (gic_handle_irq+0x58/0x60)
>>> [    2.169372] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
>>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>>> [    2.178131] Exception stack(0xdc869e10 to 0xdc869e58)
>>> [    2.183410] 9e00:                                     00000000
>>> 00000000 00000002 60000113
>>> [    2.191986] 9e20: 00000000 dc868000 c07970e4 00000000 00000000
>>> 00000001 00000002 00000000
>>> [    2.200561] 9e40: 00000001 dc869e58 c00936f4 c0093704 60000113 ffffffff
>>> [    2.207489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c0093704>]
>>> (lock_acquire+0xac/0x104)
>>> [    2.216156] [<c0093704>] (lock_acquire+0xac/0x104) from
>>> [<c007a8bc>] (rebalance_domains+0x5c/0x1a8)
>>> [    2.225646] [<c007a8bc>] (rebalance_domains+0x5c/0x1a8) from
>>> [<c007ae84>] (run_rebalance_domains+0x44/0x14c)
>>> [    2.235961] [<c007ae84>] (run_rebalance_domains+0x44/0x14c) from
>>> [<c004a864>] (__do_softirq+0xb4/0x214)
>>> [    2.245819] [<c004a864>] (__do_softirq+0xb4/0x214) from
>>> [<c004aba0>] (irq_exit+0x90/0x98)
>>> [    2.254394] [<c004aba0>] (irq_exit+0x90/0x98) from [<c0019c48>]
>>> (handle_IPI+0x104/0x15c)
>>> [    2.262878] [<c0019c48>] (handle_IPI+0x104/0x15c) from [<c00084ac>]
>>> (gic_handle_irq+0x58/0x60)
>>> [    2.271911] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
>>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>>> [    2.280670] Exception stack(0xdc869f88 to 0xdc869fd0)
>>> [    2.285949] 9f80:                   c07a87a0 c0022a40 00000000
>>> 00000000 dc868000 c07c8d08
>>> [    2.294525] 9fa0: c04fe078 c0743d70 00000000 410fc0f0 c0743fa0
>>> 00000000 00000000 dc869fd0
>>>
>>>
>>> The device tree data for acquiring the above GPIO interrupt line looks
>>> like this.
>>>
>>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
>>> 14:11:08.931694001 +0530
>>> @@ -42,7 +42,8 @@
>>>         tsl2771@39 {
>>>                 compatible = "taos,tsl2771";
>>>                 reg = <0x39>;
>>> +                interrupt-parent = <&gpio5>;
>>> +                interrupts = <21>; /* gpio line 149 */
>>>         };
>>>  };
>>>
>>> Note: using "gpio_request_one" in the driver solves the issue.
>>> Is using this api in the driver required?
>>> Any pointer on the above crash?
>>
> Hi Tarun,
>> Any user/client driver of GPIO is supposed to go through
>> gpio_request() API so that module clock
>> is enabled correctly. Overriding of APIs would put the power
>> management state machine in jeopardy.
>> --
> I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the kernel
> is crashing and the crash is no longer observed. So indeed, its about
> enabling clocks.
>
> One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
> the use of
> "gpio_request_one"??

No.

You must use the GPIO requiest/free APIs to tell the GPIO core that
the GPIO line is in use.

Why do you want to avoid using gpio_request/gpio_free?

Kevin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
  2012-07-30 20:36       ` Kevin Hilman
  (?)
@ 2012-07-30 22:37       ` Shilimkar, Santosh
  -1 siblings, 0 replies; 13+ messages in thread
From: Shilimkar, Santosh @ 2012-07-30 22:37 UTC (permalink / raw)
  To: Kevin Hilman, Grant Likely, Linus Walleij
  Cc: Poddar, Sourav, DebBarma, Tarun Kanti, lo, Benoit Cousson,
	linux-kernel, Felipe Balbi

On Mon, Jul 30, 2012 at 10:36 PM, Kevin Hilman <khilman@ti.com> wrote:
>
> "Poddar, Sourav" <sourav.poddar@ti.com> writes:
>
> > On Mon, Jul 30, 2012 at 3:04 PM, DebBarma, Tarun Kanti
> > <tarun.kanti@ti.com> wrote:
> >> Sourav,
> >>
> >> On Mon, Jul 30, 2012 at 2:13 PM, Poddar, Sourav <sourav.poddar@ti.com>
> >> wrote:
> >>> Hi All,
> >>>
> >>> I tried using gpio as an interrupt line for my driver
> >>> (drivers/staging/iio/light/tsl2x7x_core.c) for omap5.
> >>> The interrupt line number was directly passed to the driver using
> >>> device tree. But what I observed
> >>> is the following crash..
> >>>
> >>>
> >>> [    1.599273] mousedev: PS/2 mouse device common for all mice
> >>> [    1.607513] i2c /dev entries driver
> >>> [    1.613739] Driver for 1-wire Dallas network protocol.
> >>> [    1.622650] usbcore: registered new interface driver usbhid
> >>> [    1.628540] usbhid: USB HID core driver
> >>> [    1.633728] Unhandled fault: imprecise external abort (0x1406) at
> >>> 0x00000000
> >>> [    1.641113] Internal error: : 1406 [#1] SMP ARM
> >>> [    1.645874] Modules linked in:
> >>> [    1.649078] CPU: 0    Not tainted  (3.5.0-02045-g0b474d6-dirty
> >>> #415)
> >>> [    1.655761] PC is at _set_gpio_triggering+0x44/0x264
> >>> [    1.660980] LR is at gpio_irq_type+0xb8/0x160
> >>> [    1.665527] pc : [<c02dbb68>]    lr : [<c02dc2dc>]    psr: 60000093
> >>> [    1.665527] sp : dc851df0  ip : c07a8f00  fp : 00000000
> >>> [    1.677581] r10: 00000081  r9 : 00000000  r8 : dc8ffc10
> >>> [    1.683074] r7 : 20000093  r6 : 00000000  r5 : 00000001  r4 :
> >>> fa05b000
> >>> [    1.689910] r3 : dc8ffc10  r2 : 00000002  r1 : 00000002  r0 :
> >>> 00000140
> >>> [    1.696746] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM
> >>> Segment kernel
> >>> [    1.704528] Control: 10c53c7d  Table: 8000406a  DAC: 00000017
> >>> [    1.710540] Process swapper/0 (pid: 1, stack limit = 0xdc8502f8)
> >>> [    1.716857] Stack: (0xdc851df0 to 0xdc852000)
> >>> [    1.721405] 1de0:                                     00000002
> >>> c0731280 dc8ffc6c 20000093
> >>> [    1.730010] 1e00: c02dc224 c0731280 dc8d4980 00000000 c07a8e50
> >>> 00000141 00000002 c00a37b8
> >>> [    1.738586] 1e20: 00002002 c0731280 dc8d4980 00000141 c07312d4
> >>> c07312b4 40000013 c00a3d7c
> >>> [    1.747161] 1e40: 00000141 c06728c0 00000000 c0090578 c247f000
> >>> c00a2d5c c0412258 00000141
> >>> [    1.755737] 1e60: c0731280 c0537818 dc8d4980 c00a3fe4 c07bf6a0
> >>> 00002002 c071bed8 c247f000
> >>> [    1.764312] 1e80: dc9df000 00000004 c07bf6a0 dc9df020 c247f3c0
> >>> c04ea344 c06728c0 c247f000
> >>> [    1.772888] 1ea0: 00000000 09090578 c07bf6a0 dc9df004 dc9df000
> >>> c04ea194 00000091 c071bed8
> >>> [    1.781494] 1ec0: c06f89f4 c03e13c0 c03e1314 dc9df020 c0d1afd8
> >>> dc9df054 c07bf60c c03272ac
> >>> [    1.790069] 1ee0: dc9df020 c07bf60c dc9df054 00000000 00000091
> >>> c03274c0 c07bf60c dc851f08
> >>> [    1.798645] 1f00: c032742c c0325b10 dc8f26a8 dc9ef790 00000000
> >>> c07bf60c c07bcea8 c243d6c0
> >>> [    1.807220] 1f20: 00000000 c0326240 c0672958 c02bce08 c07bf5e4
> >>> c07bf60c c03e12a0 00000000
> >>> [    1.815795] 1f40: 00000091 c071bed8 c06f89f4 c0327ab0 c07bf5e4
> >>> 00000007 c07c8c40 00000000
> >>> [    1.824401] 1f60: 00000091 c03e1738 00000000 dc850000 00000007
> >>> c0008648 00000000 c112c9f0
> >>> [    1.832977] 1f80: c06a6d58 c06f89f4 00000001 60000013 c06694c8
> >>> 00000000 00000006 00000006
> >>> [    1.841552] 1fa0: 60000013 c0700a20 00000007 c07c8c40 c06d020c
> >>> 00000091 c071bed8 c0700a28
> >>> [    1.850128] 1fc0: 00000000 c06d0380 00000006 00000006 c06d020c
> >>> 00000000 00000000 c06d028c
> >>> [    1.858703] 1fe0: c001548c 00000013 00000000 00000000 00000000
> >>> c001548c 3f3f3f3f 3f3f3f3f
> >>> [    1.867309] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
> >>> [<c02dc224>] (gpio_irq_type+0x0/0x160)
> >>> [    1.877075] [<c02dc224>] (gpio_irq_type+0x0/0x160) from
> >>> [<00002002>] (0x2002)
> >>> [    1.884552] Code: e3120008 11816006 01c66001 e7846000 (e593c0fc)
> >>> [    1.890960] ------------[ cut here ]------------
> >>> [    1.895812] WARNING: at arch/arm/mach-omap2/omap_l3_noc.c:113
> >>> l3_interrupt_handler+0x184/0x1bc()
> >>> [    1.905029] L3 custom error: MASTER:MPU TARGET:L4 PER2
> >>> [    1.910430] Modules linked in:
> >>> [    1.913635] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
> >>> [<c00414c4>] (warn_slowpath_common+0x4c/0x64)
> >>> [    1.923492] [<c00414c4>] (warn_slowpath_common+0x4c/0x64) from
> >>> [<c0041570>] (warn_slowpath_fmt+0x30/0x40)
> >>> [    1.933563] [<c0041570>] (warn_slowpath_fmt+0x30/0x40) from
> >>> [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc)
> >>> [    1.943786] [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc) from
> >>> [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c)
> >>> [    1.954650] [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c) from
> >>> [<c00a2adc>] (handle_irq_event+0x3c/0x5c)
> >>> [    1.964965] [<c00a2adc>] (handle_irq_event+0x3c/0x5c) from
> >>> [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c)
> >>> [    1.974822] [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c) from
> >>> [<c00a235c>] (generic_handle_irq+0x34/0x44)
> >>> [    1.984863] [<c00a235c>] (generic_handle_irq+0x34/0x44) from
> >>> [<c00153a0>] (handle_IRQ+0x4c/0xac)
> >>> [    1.994110] [<c00153a0>] (handle_IRQ+0x4c/0xac) from [<c0008480>]
> >>> (gic_handle_irq+0x2c/0x60)
> >>> [    2.002960] [<c0008480>] (gic_handle_irq+0x2c/0x60) from
> >>> [<c04f26e4>] (__irq_svc+0x44/0x60)
> >>> [    2.011718] Exception stack(0xdc851c48 to 0xdc851c90)
> >>> [    2.017028] 1c40:                   c07a87a0 00000000 dc851c80
> >>> 00000000 c0743f80 dc851da8
> >>> [    2.025604] 1c60: 00000001 00000001 dc851cd7 00000000 c02dbb6a
> >>> c02dbb6c ffffffff dc851c90
> >>> [    2.034179] 1c80: c04f2440 c04f2444 60000113 ffffffff
> >>> [    2.039489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c04f2444>]
> >>> (_raw_spin_unlock_irq+0x28/0x2c)
> >>> [    2.048797] [<c04f2444>] (_raw_spin_unlock_irq+0x28/0x2c) from
> >>> [<c001871c>] (die+0xe0/0x324)
> >>> [    2.057647] [<c001871c>] (die+0xe0/0x324) from [<c0008444>]
> >>> (do_DataAbort+0x88/0x98)
> >>> [    2.065765] [<c0008444>] (do_DataAbort+0x88/0x98) from [<c04f2664>]
> >>> (__dabt_svc+0x44/0x80)
> >>> [    2.074462] Exception stack(0xdc851da8 to 0xdc851df0)
> >>> [    2.079742] 1da0:                   00000140 00000002 00000002
> >>> dc8ffc10 fa05b000 00000001
> >>> [    2.088317] 1dc0: 00000000 20000093 dc8ffc10 00000000 00000081
> >>> 00000000 c07a8f00 dc851df0
> >>> [    2.096893] 1de0: c02dc2dc c02dbb68 60000093 ffffffff
> >>> [    2.102203] [<c04f2664>] (__dabt_svc+0x44/0x80) from [<c02dbb68>]
> >>> (_set_gpio_triggering+0x44/0x264)
> >>> [    2.111724] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
> >>> [<c02dc224>] (gpio_irq_type+0x0/0x160)
> >>> [    2.121490] [<c02dc224>] (gpio_irq_type+0x0/0x160) from
> >>> [<00002002>] (0x2002)
> >>> [    2.128967] ---[ end trace 8b4b88305e6b2aff ]---
> >>> [    2.133911] ---[ end trace 8b4b88305e6b2b00 ]---
> >>> [    2.138763] Kernel panic - not syncing: Attempted to kill init!
> >>> exitcode=0x0000000b
> >>> [    2.138763]
> >>> [    2.148376] CPU1: stopping
> >>> [    2.151214] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
> >>> [<c0019c74>] (handle_IPI+0x130/0x15c)
> >>> [    2.160339] [<c0019c74>] (handle_IPI+0x130/0x15c) from [<c00084ac>]
> >>> (gic_handle_irq+0x58/0x60)
> >>> [    2.169372] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
> >>> [<c04f26e4>] (__irq_svc+0x44/0x60)
> >>> [    2.178131] Exception stack(0xdc869e10 to 0xdc869e58)
> >>> [    2.183410] 9e00:                                     00000000
> >>> 00000000 00000002 60000113
> >>> [    2.191986] 9e20: 00000000 dc868000 c07970e4 00000000 00000000
> >>> 00000001 00000002 00000000
> >>> [    2.200561] 9e40: 00000001 dc869e58 c00936f4 c0093704 60000113
> >>> ffffffff
> >>> [    2.207489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c0093704>]
> >>> (lock_acquire+0xac/0x104)
> >>> [    2.216156] [<c0093704>] (lock_acquire+0xac/0x104) from
> >>> [<c007a8bc>] (rebalance_domains+0x5c/0x1a8)
> >>> [    2.225646] [<c007a8bc>] (rebalance_domains+0x5c/0x1a8) from
> >>> [<c007ae84>] (run_rebalance_domains+0x44/0x14c)
> >>> [    2.235961] [<c007ae84>] (run_rebalance_domains+0x44/0x14c) from
> >>> [<c004a864>] (__do_softirq+0xb4/0x214)
> >>> [    2.245819] [<c004a864>] (__do_softirq+0xb4/0x214) from
> >>> [<c004aba0>] (irq_exit+0x90/0x98)
> >>> [    2.254394] [<c004aba0>] (irq_exit+0x90/0x98) from [<c0019c48>]
> >>> (handle_IPI+0x104/0x15c)
> >>> [    2.262878] [<c0019c48>] (handle_IPI+0x104/0x15c) from [<c00084ac>]
> >>> (gic_handle_irq+0x58/0x60)
> >>> [    2.271911] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
> >>> [<c04f26e4>] (__irq_svc+0x44/0x60)
> >>> [    2.280670] Exception stack(0xdc869f88 to 0xdc869fd0)
> >>> [    2.285949] 9f80:                   c07a87a0 c0022a40 00000000
> >>> 00000000 dc868000 c07c8d08
> >>> [    2.294525] 9fa0: c04fe078 c0743d70 00000000 410fc0f0 c0743fa0
> >>> 00000000 00000000 dc869fd0
> >>>
> >>>
> >>> The device tree data for acquiring the above GPIO interrupt line looks
> >>> like this.
> >>>
> >>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
> >>> 14:11:08.931694001 +0530
> >>> @@ -42,7 +42,8 @@
> >>>         tsl2771@39 {
> >>>                 compatible = "taos,tsl2771";
> >>>                 reg = <0x39>;
> >>> +                interrupt-parent = <&gpio5>;
> >>> +                interrupts = <21>; /* gpio line 149 */
> >>>         };
> >>>  };
> >>>
> >>> Note: using "gpio_request_one" in the driver solves the issue.
> >>> Is using this api in the driver required?
> >>> Any pointer on the above crash?
> >>
> > Hi Tarun,
> >> Any user/client driver of GPIO is supposed to go through
> >> gpio_request() API so that module clock
> >> is enabled correctly. Overriding of APIs would put the power
> >> management state machine in jeopardy.
> >> --
> > I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the
> > kernel
> > is crashing and the crash is no longer observed. So indeed, its about
> > enabling clocks.
> >
> > One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
> > the use of
> > "gpio_request_one"??
>
> No.
>
> You must use the GPIO requiest/free APIs to tell the GPIO core that
> the GPIO line is in use.
>
> Why do you want to avoid using gpio_request/gpio_free?
>
Indeed.
Off list Felipe mentioned that the assumption was the DT based GPIO
IRQ registration should result in automatic GPIO request which clearly
not supported today.

May be Linus/Grant knows if something like that was suppose to be
supported.

Regards
Santosh

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
  2012-07-30 20:36       ` Kevin Hilman
  (?)
  (?)
@ 2012-07-31  4:53       ` Poddar, Sourav
  2012-07-31  6:52         ` Felipe Balbi
  -1 siblings, 1 reply; 13+ messages in thread
From: Poddar, Sourav @ 2012-07-31  4:53 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: DebBarma, Tarun Kanti, lo, Santosh Shilimkar, Benoit Cousson,
	linux-kernel, Felipe Balbi

Hi Kevin,

On Tue, Jul 31, 2012 at 2:06 AM, Kevin Hilman <khilman@ti.com> wrote:
> "Poddar, Sourav" <sourav.poddar@ti.com> writes:
>
>> On Mon, Jul 30, 2012 at 3:04 PM, DebBarma, Tarun Kanti
>> <tarun.kanti@ti.com> wrote:
>>> Sourav,
>>>
>>> On Mon, Jul 30, 2012 at 2:13 PM, Poddar, Sourav <sourav.poddar@ti.com> wrote:
>>>> Hi All,
>>>>
>>>> I tried using gpio as an interrupt line for my driver
>>>> (drivers/staging/iio/light/tsl2x7x_core.c) for omap5.
>>>> The interrupt line number was directly passed to the driver using
>>>> device tree. But what I observed
>>>> is the following crash..
>>>>
>>>>
>>>> [    1.599273] mousedev: PS/2 mouse device common for all mice
>>>> [    1.607513] i2c /dev entries driver
>>>> [    1.613739] Driver for 1-wire Dallas network protocol.
>>>> [    1.622650] usbcore: registered new interface driver usbhid
>>>> [    1.628540] usbhid: USB HID core driver
>>>> [    1.633728] Unhandled fault: imprecise external abort (0x1406) at 0x00000000
>>>> [    1.641113] Internal error: : 1406 [#1] SMP ARM
>>>> [    1.645874] Modules linked in:
>>>> [    1.649078] CPU: 0    Not tainted  (3.5.0-02045-g0b474d6-dirty #415)
>>>> [    1.655761] PC is at _set_gpio_triggering+0x44/0x264
>>>> [    1.660980] LR is at gpio_irq_type+0xb8/0x160
>>>> [    1.665527] pc : [<c02dbb68>]    lr : [<c02dc2dc>]    psr: 60000093
>>>> [    1.665527] sp : dc851df0  ip : c07a8f00  fp : 00000000
>>>> [    1.677581] r10: 00000081  r9 : 00000000  r8 : dc8ffc10
>>>> [    1.683074] r7 : 20000093  r6 : 00000000  r5 : 00000001  r4 : fa05b000
>>>> [    1.689910] r3 : dc8ffc10  r2 : 00000002  r1 : 00000002  r0 : 00000140
>>>> [    1.696746] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM
>>>> Segment kernel
>>>> [    1.704528] Control: 10c53c7d  Table: 8000406a  DAC: 00000017
>>>> [    1.710540] Process swapper/0 (pid: 1, stack limit = 0xdc8502f8)
>>>> [    1.716857] Stack: (0xdc851df0 to 0xdc852000)
>>>> [    1.721405] 1de0:                                     00000002
>>>> c0731280 dc8ffc6c 20000093
>>>> [    1.730010] 1e00: c02dc224 c0731280 dc8d4980 00000000 c07a8e50
>>>> 00000141 00000002 c00a37b8
>>>> [    1.738586] 1e20: 00002002 c0731280 dc8d4980 00000141 c07312d4
>>>> c07312b4 40000013 c00a3d7c
>>>> [    1.747161] 1e40: 00000141 c06728c0 00000000 c0090578 c247f000
>>>> c00a2d5c c0412258 00000141
>>>> [    1.755737] 1e60: c0731280 c0537818 dc8d4980 c00a3fe4 c07bf6a0
>>>> 00002002 c071bed8 c247f000
>>>> [    1.764312] 1e80: dc9df000 00000004 c07bf6a0 dc9df020 c247f3c0
>>>> c04ea344 c06728c0 c247f000
>>>> [    1.772888] 1ea0: 00000000 09090578 c07bf6a0 dc9df004 dc9df000
>>>> c04ea194 00000091 c071bed8
>>>> [    1.781494] 1ec0: c06f89f4 c03e13c0 c03e1314 dc9df020 c0d1afd8
>>>> dc9df054 c07bf60c c03272ac
>>>> [    1.790069] 1ee0: dc9df020 c07bf60c dc9df054 00000000 00000091
>>>> c03274c0 c07bf60c dc851f08
>>>> [    1.798645] 1f00: c032742c c0325b10 dc8f26a8 dc9ef790 00000000
>>>> c07bf60c c07bcea8 c243d6c0
>>>> [    1.807220] 1f20: 00000000 c0326240 c0672958 c02bce08 c07bf5e4
>>>> c07bf60c c03e12a0 00000000
>>>> [    1.815795] 1f40: 00000091 c071bed8 c06f89f4 c0327ab0 c07bf5e4
>>>> 00000007 c07c8c40 00000000
>>>> [    1.824401] 1f60: 00000091 c03e1738 00000000 dc850000 00000007
>>>> c0008648 00000000 c112c9f0
>>>> [    1.832977] 1f80: c06a6d58 c06f89f4 00000001 60000013 c06694c8
>>>> 00000000 00000006 00000006
>>>> [    1.841552] 1fa0: 60000013 c0700a20 00000007 c07c8c40 c06d020c
>>>> 00000091 c071bed8 c0700a28
>>>> [    1.850128] 1fc0: 00000000 c06d0380 00000006 00000006 c06d020c
>>>> 00000000 00000000 c06d028c
>>>> [    1.858703] 1fe0: c001548c 00000013 00000000 00000000 00000000
>>>> c001548c 3f3f3f3f 3f3f3f3f
>>>> [    1.867309] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
>>>> [<c02dc224>] (gpio_irq_type+0x0/0x160)
>>>> [    1.877075] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
>>>> [    1.884552] Code: e3120008 11816006 01c66001 e7846000 (e593c0fc)
>>>> [    1.890960] ------------[ cut here ]------------
>>>> [    1.895812] WARNING: at arch/arm/mach-omap2/omap_l3_noc.c:113
>>>> l3_interrupt_handler+0x184/0x1bc()
>>>> [    1.905029] L3 custom error: MASTER:MPU TARGET:L4 PER2
>>>> [    1.910430] Modules linked in:
>>>> [    1.913635] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
>>>> [<c00414c4>] (warn_slowpath_common+0x4c/0x64)
>>>> [    1.923492] [<c00414c4>] (warn_slowpath_common+0x4c/0x64) from
>>>> [<c0041570>] (warn_slowpath_fmt+0x30/0x40)
>>>> [    1.933563] [<c0041570>] (warn_slowpath_fmt+0x30/0x40) from
>>>> [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc)
>>>> [    1.943786] [<c0035de4>] (l3_interrupt_handler+0x184/0x1bc) from
>>>> [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c)
>>>> [    1.954650] [<c00a28b8>] (handle_irq_event_percpu+0x64/0x24c) from
>>>> [<c00a2adc>] (handle_irq_event+0x3c/0x5c)
>>>> [    1.964965] [<c00a2adc>] (handle_irq_event+0x3c/0x5c) from
>>>> [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c)
>>>> [    1.974822] [<c00a56a8>] (handle_fasteoi_irq+0x98/0x13c) from
>>>> [<c00a235c>] (generic_handle_irq+0x34/0x44)
>>>> [    1.984863] [<c00a235c>] (generic_handle_irq+0x34/0x44) from
>>>> [<c00153a0>] (handle_IRQ+0x4c/0xac)
>>>> [    1.994110] [<c00153a0>] (handle_IRQ+0x4c/0xac) from [<c0008480>]
>>>> (gic_handle_irq+0x2c/0x60)
>>>> [    2.002960] [<c0008480>] (gic_handle_irq+0x2c/0x60) from
>>>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>>>> [    2.011718] Exception stack(0xdc851c48 to 0xdc851c90)
>>>> [    2.017028] 1c40:                   c07a87a0 00000000 dc851c80
>>>> 00000000 c0743f80 dc851da8
>>>> [    2.025604] 1c60: 00000001 00000001 dc851cd7 00000000 c02dbb6a
>>>> c02dbb6c ffffffff dc851c90
>>>> [    2.034179] 1c80: c04f2440 c04f2444 60000113 ffffffff
>>>> [    2.039489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c04f2444>]
>>>> (_raw_spin_unlock_irq+0x28/0x2c)
>>>> [    2.048797] [<c04f2444>] (_raw_spin_unlock_irq+0x28/0x2c) from
>>>> [<c001871c>] (die+0xe0/0x324)
>>>> [    2.057647] [<c001871c>] (die+0xe0/0x324) from [<c0008444>]
>>>> (do_DataAbort+0x88/0x98)
>>>> [    2.065765] [<c0008444>] (do_DataAbort+0x88/0x98) from [<c04f2664>]
>>>> (__dabt_svc+0x44/0x80)
>>>> [    2.074462] Exception stack(0xdc851da8 to 0xdc851df0)
>>>> [    2.079742] 1da0:                   00000140 00000002 00000002
>>>> dc8ffc10 fa05b000 00000001
>>>> [    2.088317] 1dc0: 00000000 20000093 dc8ffc10 00000000 00000081
>>>> 00000000 c07a8f00 dc851df0
>>>> [    2.096893] 1de0: c02dc2dc c02dbb68 60000093 ffffffff
>>>> [    2.102203] [<c04f2664>] (__dabt_svc+0x44/0x80) from [<c02dbb68>]
>>>> (_set_gpio_triggering+0x44/0x264)
>>>> [    2.111724] [<c02dbb68>] (_set_gpio_triggering+0x44/0x264) from
>>>> [<c02dc224>] (gpio_irq_type+0x0/0x160)
>>>> [    2.121490] [<c02dc224>] (gpio_irq_type+0x0/0x160) from [<00002002>] (0x2002)
>>>> [    2.128967] ---[ end trace 8b4b88305e6b2aff ]---
>>>> [    2.133911] ---[ end trace 8b4b88305e6b2b00 ]---
>>>> [    2.138763] Kernel panic - not syncing: Attempted to kill init!
>>>> exitcode=0x0000000b
>>>> [    2.138763]
>>>> [    2.148376] CPU1: stopping
>>>> [    2.151214] [<c001bd5c>] (unwind_backtrace+0x0/0xf4) from
>>>> [<c0019c74>] (handle_IPI+0x130/0x15c)
>>>> [    2.160339] [<c0019c74>] (handle_IPI+0x130/0x15c) from [<c00084ac>]
>>>> (gic_handle_irq+0x58/0x60)
>>>> [    2.169372] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
>>>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>>>> [    2.178131] Exception stack(0xdc869e10 to 0xdc869e58)
>>>> [    2.183410] 9e00:                                     00000000
>>>> 00000000 00000002 60000113
>>>> [    2.191986] 9e20: 00000000 dc868000 c07970e4 00000000 00000000
>>>> 00000001 00000002 00000000
>>>> [    2.200561] 9e40: 00000001 dc869e58 c00936f4 c0093704 60000113 ffffffff
>>>> [    2.207489] [<c04f26e4>] (__irq_svc+0x44/0x60) from [<c0093704>]
>>>> (lock_acquire+0xac/0x104)
>>>> [    2.216156] [<c0093704>] (lock_acquire+0xac/0x104) from
>>>> [<c007a8bc>] (rebalance_domains+0x5c/0x1a8)
>>>> [    2.225646] [<c007a8bc>] (rebalance_domains+0x5c/0x1a8) from
>>>> [<c007ae84>] (run_rebalance_domains+0x44/0x14c)
>>>> [    2.235961] [<c007ae84>] (run_rebalance_domains+0x44/0x14c) from
>>>> [<c004a864>] (__do_softirq+0xb4/0x214)
>>>> [    2.245819] [<c004a864>] (__do_softirq+0xb4/0x214) from
>>>> [<c004aba0>] (irq_exit+0x90/0x98)
>>>> [    2.254394] [<c004aba0>] (irq_exit+0x90/0x98) from [<c0019c48>]
>>>> (handle_IPI+0x104/0x15c)
>>>> [    2.262878] [<c0019c48>] (handle_IPI+0x104/0x15c) from [<c00084ac>]
>>>> (gic_handle_irq+0x58/0x60)
>>>> [    2.271911] [<c00084ac>] (gic_handle_irq+0x58/0x60) from
>>>> [<c04f26e4>] (__irq_svc+0x44/0x60)
>>>> [    2.280670] Exception stack(0xdc869f88 to 0xdc869fd0)
>>>> [    2.285949] 9f80:                   c07a87a0 c0022a40 00000000
>>>> 00000000 dc868000 c07c8d08
>>>> [    2.294525] 9fa0: c04fe078 c0743d70 00000000 410fc0f0 c0743fa0
>>>> 00000000 00000000 dc869fd0
>>>>
>>>>
>>>> The device tree data for acquiring the above GPIO interrupt line looks
>>>> like this.
>>>>
>>>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
>>>> 14:11:08.931694001 +0530
>>>> @@ -42,7 +42,8 @@
>>>>         tsl2771@39 {
>>>>                 compatible = "taos,tsl2771";
>>>>                 reg = <0x39>;
>>>> +                interrupt-parent = <&gpio5>;
>>>> +                interrupts = <21>; /* gpio line 149 */
>>>>         };
>>>>  };
>>>>
>>>> Note: using "gpio_request_one" in the driver solves the issue.
>>>> Is using this api in the driver required?
>>>> Any pointer on the above crash?
>>>
>> Hi Tarun,
>>> Any user/client driver of GPIO is supposed to go through
>>> gpio_request() API so that module clock
>>> is enabled correctly. Overriding of APIs would put the power
>>> management state machine in jeopardy.
>>> --
>> I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the kernel
>> is crashing and the crash is no longer observed. So indeed, its about
>> enabling clocks.
>>
>> One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
>> the use of
>> "gpio_request_one"??
>
> No.
>
> You must use the GPIO requiest/free APIs to tell the GPIO core that
> the GPIO line is in use.
>
Thanks for this confirmation.
> Why do you want to avoid using gpio_request/gpio_free?
>
I was assuming that DT based gpio IRQ registration will automatically
take care of
the above APIs. But since that is not the case(as mentioned by
santosh),  we need to use the
gpio_request/free apis.

> Kevin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
  2012-07-30 20:36       ` Kevin Hilman
                         ` (2 preceding siblings ...)
  (?)
@ 2012-07-31  6:43       ` Felipe Balbi
  -1 siblings, 0 replies; 13+ messages in thread
From: Felipe Balbi @ 2012-07-31  6:43 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Poddar, Sourav, DebBarma, Tarun Kanti, lo, Santosh Shilimkar,
	Benoit Cousson, linux-kernel, Felipe Balbi

[-- Attachment #1: Type: text/plain, Size: 2017 bytes --]

Hi,

On Mon, Jul 30, 2012 at 01:36:47PM -0700, Kevin Hilman wrote:

<little trimming>

> >>> The device tree data for acquiring the above GPIO interrupt line looks
> >>> like this.
> >>>
> >>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
> >>> 14:11:08.931694001 +0530
> >>> @@ -42,7 +42,8 @@
> >>>         tsl2771@39 {
> >>>                 compatible = "taos,tsl2771";
> >>>                 reg = <0x39>;
> >>> +                interrupt-parent = <&gpio5>;
> >>> +                interrupts = <21>; /* gpio line 149 */
> >>>         };
> >>>  };
> >>>
> >>> Note: using "gpio_request_one" in the driver solves the issue.
> >>> Is using this api in the driver required?
> >>> Any pointer on the above crash?
> >>
> > Hi Tarun,
> >> Any user/client driver of GPIO is supposed to go through
> >> gpio_request() API so that module clock
> >> is enabled correctly. Overriding of APIs would put the power
> >> management state machine in jeopardy.
> >> --
> > I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the kernel
> > is crashing and the crash is no longer observed. So indeed, its about
> > enabling clocks.
> >
> > One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
> > the use of
> > "gpio_request_one"??
> 
> No.
> 
> You must use the GPIO requiest/free APIs to tell the GPIO core that
> the GPIO line is in use.
> 
> Why do you want to avoid using gpio_request/gpio_free?

Then how do we differentiate from a driver perspective if e.g.
client->irq (for I2C client drivers) refers to a pin on a GPIO
controller or a real interrupt when running with DT ?

Having something like:

#interrupt-parent = &<gpio5>;
interrupts = <21>;

would already give me the correct IRQ number from the driver, now how do
we differentiate the interrupt parents ? There's no way to do that from
a driver perspective, so DT core has to either do it, or provide means
for drivers to detect it themselves.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
  2012-07-31  4:53       ` Poddar, Sourav
@ 2012-07-31  6:52         ` Felipe Balbi
  2012-07-31 12:32           ` Shilimkar, Santosh
  0 siblings, 1 reply; 13+ messages in thread
From: Felipe Balbi @ 2012-07-31  6:52 UTC (permalink / raw)
  To: Poddar, Sourav
  Cc: Kevin Hilman, DebBarma, Tarun Kanti, lo, Santosh Shilimkar,
	Benoit Cousson, linux-kernel, Felipe Balbi

[-- Attachment #1: Type: text/plain, Size: 3020 bytes --]

Hi,

On Tue, Jul 31, 2012 at 10:23:16AM +0530, Poddar, Sourav wrote:
> >>>> The device tree data for acquiring the above GPIO interrupt line looks
> >>>> like this.
> >>>>
> >>>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
> >>>> 14:11:08.931694001 +0530
> >>>> @@ -42,7 +42,8 @@
> >>>>         tsl2771@39 {
> >>>>                 compatible = "taos,tsl2771";
> >>>>                 reg = <0x39>;
> >>>> +                interrupt-parent = <&gpio5>;
> >>>> +                interrupts = <21>; /* gpio line 149 */
> >>>>         };
> >>>>  };
> >>>>
> >>>> Note: using "gpio_request_one" in the driver solves the issue.
> >>>> Is using this api in the driver required?
> >>>> Any pointer on the above crash?
> >>>
> >> Hi Tarun,
> >>> Any user/client driver of GPIO is supposed to go through
> >>> gpio_request() API so that module clock
> >>> is enabled correctly. Overriding of APIs would put the power
> >>> management state machine in jeopardy.
> >>> --
> >> I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the kernel
> >> is crashing and the crash is no longer observed. So indeed, its about
> >> enabling clocks.
> >>
> >> One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
> >> the use of
> >> "gpio_request_one"??
> >
> > No.
> >
> > You must use the GPIO requiest/free APIs to tell the GPIO core that
> > the GPIO line is in use.
> >
> Thanks for this confirmation.
> > Why do you want to avoid using gpio_request/gpio_free?
> >
> I was assuming that DT based gpio IRQ registration will automatically
> take care of
> the above APIs. But since that is not the case(as mentioned by
> santosh),  we need to use the
> gpio_request/free apis.

Hang on for a while, let's try to get to the bottom of this debate first
;-)

We have a canonical way of passing IRQ numbers to drivers through DT and
that is the "interrupts" attribute. It shouldn't matter if that IRQ pin
is connected to a real IRQ line or through a GPIO controller. In both
cases we should use the "interrupts" attribute.

If DT core doesn't allocate the GPIO for us then how does this work:

(omap4-sdp.dts)

127 &mcspi1 {
128         eth@0 {
129                 compatible = "ks8851";
130                 spi-max-frequency = <24000000>;
131                 reg = <0>;
132                 interrupt-parent = <&gpio2>;
133                 interrupts = <2>; /* gpio line 34 */
134                 vdd-supply = <&vdd_eth>;
135         };
136 };


There's no gpio request on the driver:

$ git grep -e gpio_request drivers/net/ethernet/micrel/ks8851.c
$

Since Benoit was the one who added that to the dts file (commit
e7c64db9), I assume he tested his patch before posting, so again I ask -
How does that work and why doesn't this work for Sourav's tsl2771
controller ?

This is either a regression on drivers/of, or commit e7c64db9 is also
broken...

Benoit, do you know how should this work ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
  2012-07-31 12:32           ` Shilimkar, Santosh
@ 2012-07-31 12:32             ` Felipe Balbi
  2012-07-31 12:56             ` Poddar, Sourav
  1 sibling, 0 replies; 13+ messages in thread
From: Felipe Balbi @ 2012-07-31 12:32 UTC (permalink / raw)
  To: Shilimkar, Santosh
  Cc: balbi, Poddar, Sourav, Kevin Hilman, DebBarma, Tarun Kanti, lo,
	Benoit Cousson, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4442 bytes --]

Hi,

On Tue, Jul 31, 2012 at 02:32:43PM +0200, Shilimkar, Santosh wrote:
> On Tue, Jul 31, 2012 at 8:52 AM, Felipe Balbi <balbi@ti.com> wrote:
> >
> > Hi,
> >
> > On Tue, Jul 31, 2012 at 10:23:16AM +0530, Poddar, Sourav wrote:
> > > >>>> The device tree data for acquiring the above GPIO interrupt line
> > > >>>> looks
> > > >>>> like this.
> > > >>>>
> > > >>>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
> > > >>>> 14:11:08.931694001 +0530
> > > >>>> @@ -42,7 +42,8 @@
> > > >>>>         tsl2771@39 {
> > > >>>>                 compatible = "taos,tsl2771";
> > > >>>>                 reg = <0x39>;
> > > >>>> +                interrupt-parent = <&gpio5>;
> > > >>>> +                interrupts = <21>; /* gpio line 149 */
> > > >>>>         };
> > > >>>>  };
> > > >>>>
> > > >>>> Note: using "gpio_request_one" in the driver solves the issue.
> > > >>>> Is using this api in the driver required?
> > > >>>> Any pointer on the above crash?
> > > >>>
> > > >> Hi Tarun,
> > > >>> Any user/client driver of GPIO is supposed to go through
> > > >>> gpio_request() API so that module clock
> > > >>> is enabled correctly. Overriding of APIs would put the power
> > > >>> management state machine in jeopardy.
> > > >>> --
> > > >> I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the
> > > >> kernel
> > > >> is crashing and the crash is no longer observed. So indeed, its about
> > > >> enabling clocks.
> > > >>
> > > >> One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
> > > >> the use of
> > > >> "gpio_request_one"??
> > > >
> > > > No.
> > > >
> > > > You must use the GPIO requiest/free APIs to tell the GPIO core that
> > > > the GPIO line is in use.
> > > >
> > > Thanks for this confirmation.
> > > > Why do you want to avoid using gpio_request/gpio_free?
> > > >
> > > I was assuming that DT based gpio IRQ registration will automatically
> > > take care of
> > > the above APIs. But since that is not the case(as mentioned by
> > > santosh),  we need to use the
> > > gpio_request/free apis.
> >
> > Hang on for a while, let's try to get to the bottom of this debate first
> > ;-)
> >
> > We have a canonical way of passing IRQ numbers to drivers through DT and
> > that is the "interrupts" attribute. It shouldn't matter if that IRQ pin
> > is connected to a real IRQ line or through a GPIO controller. In both
> > cases we should use the "interrupts" attribute.
> >
> > If DT core doesn't allocate the GPIO for us then how does this work:
> >
> > (omap4-sdp.dts)
> >
> > 127 &mcspi1 {
> > 128         eth@0 {
> > 129                 compatible = "ks8851";
> > 130                 spi-max-frequency = <24000000>;
> > 131                 reg = <0>;
> > 132                 interrupt-parent = <&gpio2>;
> > 133                 interrupts = <2>; /* gpio line 34 */
> > 134                 vdd-supply = <&vdd_eth>;
> > 135         };
> > 136 };
> >
> >
> > There's no gpio request on the driver:
> >
> > $ git grep -e gpio_request drivers/net/ethernet/micrel/ks8851.c
> > $
> >
> > Since Benoit was the one who added that to the dts file (commit
> > e7c64db9), I assume he tested his patch before posting, so again I ask -
> > How does that work and why doesn't this work for Sourav's tsl2771
> > controller ?
> >
> > This is either a regression on drivers/of, or commit e7c64db9 is also
> > broken...
> >
> > Benoit, do you know how should this work ?
> >
> I had a discussion with Benoit on this. In fact there is a way to actually
> trigger the GPIO request.
> 
> > 132                 interrupt-parent = <&gpio2>;
> > 133                 interrupts = <2>; /* gpio line 34 */
> 
> As above you can see, GPIO2 bank and 2nd line.
> And then it will make use of gpio_irq chip properties
> to probe the GPIO line.
> 
> Saurabh can try this out for his use case.

Isn't this exactly what Sourav has ?

> > > >>>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
> > > >>>> 14:11:08.931694001 +0530
> > > >>>> @@ -42,7 +42,8 @@
> > > >>>>         tsl2771@39 {
> > > >>>>                 compatible = "taos,tsl2771";
> > > >>>>                 reg = <0x39>;
> > > >>>> +                interrupt-parent = <&gpio5>;
> > > >>>> +                interrupts = <21>; /* gpio line 149 */
> > > >>>>         };
> > > >>>>  };

???

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
  2012-07-31  6:52         ` Felipe Balbi
@ 2012-07-31 12:32           ` Shilimkar, Santosh
  2012-07-31 12:32             ` Felipe Balbi
  2012-07-31 12:56             ` Poddar, Sourav
  0 siblings, 2 replies; 13+ messages in thread
From: Shilimkar, Santosh @ 2012-07-31 12:32 UTC (permalink / raw)
  To: balbi
  Cc: Poddar, Sourav, Kevin Hilman, DebBarma, Tarun Kanti, lo,
	Benoit Cousson, linux-kernel

On Tue, Jul 31, 2012 at 8:52 AM, Felipe Balbi <balbi@ti.com> wrote:
>
> Hi,
>
> On Tue, Jul 31, 2012 at 10:23:16AM +0530, Poddar, Sourav wrote:
> > >>>> The device tree data for acquiring the above GPIO interrupt line
> > >>>> looks
> > >>>> like this.
> > >>>>
> > >>>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
> > >>>> 14:11:08.931694001 +0530
> > >>>> @@ -42,7 +42,8 @@
> > >>>>         tsl2771@39 {
> > >>>>                 compatible = "taos,tsl2771";
> > >>>>                 reg = <0x39>;
> > >>>> +                interrupt-parent = <&gpio5>;
> > >>>> +                interrupts = <21>; /* gpio line 149 */
> > >>>>         };
> > >>>>  };
> > >>>>
> > >>>> Note: using "gpio_request_one" in the driver solves the issue.
> > >>>> Is using this api in the driver required?
> > >>>> Any pointer on the above crash?
> > >>>
> > >> Hi Tarun,
> > >>> Any user/client driver of GPIO is supposed to go through
> > >>> gpio_request() API so that module clock
> > >>> is enabled correctly. Overriding of APIs would put the power
> > >>> management state machine in jeopardy.
> > >>> --
> > >> I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the
> > >> kernel
> > >> is crashing and the crash is no longer observed. So indeed, its about
> > >> enabling clocks.
> > >>
> > >> One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
> > >> the use of
> > >> "gpio_request_one"??
> > >
> > > No.
> > >
> > > You must use the GPIO requiest/free APIs to tell the GPIO core that
> > > the GPIO line is in use.
> > >
> > Thanks for this confirmation.
> > > Why do you want to avoid using gpio_request/gpio_free?
> > >
> > I was assuming that DT based gpio IRQ registration will automatically
> > take care of
> > the above APIs. But since that is not the case(as mentioned by
> > santosh),  we need to use the
> > gpio_request/free apis.
>
> Hang on for a while, let's try to get to the bottom of this debate first
> ;-)
>
> We have a canonical way of passing IRQ numbers to drivers through DT and
> that is the "interrupts" attribute. It shouldn't matter if that IRQ pin
> is connected to a real IRQ line or through a GPIO controller. In both
> cases we should use the "interrupts" attribute.
>
> If DT core doesn't allocate the GPIO for us then how does this work:
>
> (omap4-sdp.dts)
>
> 127 &mcspi1 {
> 128         eth@0 {
> 129                 compatible = "ks8851";
> 130                 spi-max-frequency = <24000000>;
> 131                 reg = <0>;
> 132                 interrupt-parent = <&gpio2>;
> 133                 interrupts = <2>; /* gpio line 34 */
> 134                 vdd-supply = <&vdd_eth>;
> 135         };
> 136 };
>
>
> There's no gpio request on the driver:
>
> $ git grep -e gpio_request drivers/net/ethernet/micrel/ks8851.c
> $
>
> Since Benoit was the one who added that to the dts file (commit
> e7c64db9), I assume he tested his patch before posting, so again I ask -
> How does that work and why doesn't this work for Sourav's tsl2771
> controller ?
>
> This is either a regression on drivers/of, or commit e7c64db9 is also
> broken...
>
> Benoit, do you know how should this work ?
>
I had a discussion with Benoit on this. In fact there is a way to actually
trigger the GPIO request.

> 132                 interrupt-parent = <&gpio2>;
> 133                 interrupts = <2>; /* gpio line 34 */

As above you can see, GPIO2 bank and 2nd line.
And then it will make use of gpio_irq chip properties
to probe the GPIO line.

Saurabh can try this out for his use case.

Regards
Santosh

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
  2012-07-31 12:32           ` Shilimkar, Santosh
  2012-07-31 12:32             ` Felipe Balbi
@ 2012-07-31 12:56             ` Poddar, Sourav
  2012-08-06  5:46               ` Shilimkar, Santosh
  1 sibling, 1 reply; 13+ messages in thread
From: Poddar, Sourav @ 2012-07-31 12:56 UTC (permalink / raw)
  To: Shilimkar, Santosh
  Cc: balbi, Kevin Hilman, DebBarma, Tarun Kanti, lo, Benoit Cousson,
	linux-kernel

Hi Santosh,

On Tue, Jul 31, 2012 at 6:02 PM, Shilimkar, Santosh
<santosh.shilimkar@ti.com> wrote:
> On Tue, Jul 31, 2012 at 8:52 AM, Felipe Balbi <balbi@ti.com> wrote:
>>
>> Hi,
>>
>> On Tue, Jul 31, 2012 at 10:23:16AM +0530, Poddar, Sourav wrote:
>> > >>>> The device tree data for acquiring the above GPIO interrupt line
>> > >>>> looks
>> > >>>> like this.
>> > >>>>
>> > >>>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
>> > >>>> 14:11:08.931694001 +0530
>> > >>>> @@ -42,7 +42,8 @@
>> > >>>>         tsl2771@39 {
>> > >>>>                 compatible = "taos,tsl2771";
>> > >>>>                 reg = <0x39>;
>> > >>>> +                interrupt-parent = <&gpio5>;
>> > >>>> +                interrupts = <21>; /* gpio line 149 */
>> > >>>>         };
>> > >>>>  };
>> > >>>>
>> > >>>> Note: using "gpio_request_one" in the driver solves the issue.
>> > >>>> Is using this api in the driver required?
>> > >>>> Any pointer on the above crash?
>> > >>>
>> > >> Hi Tarun,
>> > >>> Any user/client driver of GPIO is supposed to go through
>> > >>> gpio_request() API so that module clock
>> > >>> is enabled correctly. Overriding of APIs would put the power
>> > >>> management state machine in jeopardy.
>> > >>> --
>> > >> I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the
>> > >> kernel
>> > >> is crashing and the crash is no longer observed. So indeed, its about
>> > >> enabling clocks.
>> > >>
>> > >> One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
>> > >> the use of
>> > >> "gpio_request_one"??
>> > >
>> > > No.
>> > >
>> > > You must use the GPIO requiest/free APIs to tell the GPIO core that
>> > > the GPIO line is in use.
>> > >
>> > Thanks for this confirmation.
>> > > Why do you want to avoid using gpio_request/gpio_free?
>> > >
>> > I was assuming that DT based gpio IRQ registration will automatically
>> > take care of
>> > the above APIs. But since that is not the case(as mentioned by
>> > santosh),  we need to use the
>> > gpio_request/free apis.
>>
>> Hang on for a while, let's try to get to the bottom of this debate first
>> ;-)
>>
>> We have a canonical way of passing IRQ numbers to drivers through DT and
>> that is the "interrupts" attribute. It shouldn't matter if that IRQ pin
>> is connected to a real IRQ line or through a GPIO controller. In both
>> cases we should use the "interrupts" attribute.
>>
>> If DT core doesn't allocate the GPIO for us then how does this work:
>>
>> (omap4-sdp.dts)
>>
>> 127 &mcspi1 {
>> 128         eth@0 {
>> 129                 compatible = "ks8851";
>> 130                 spi-max-frequency = <24000000>;
>> 131                 reg = <0>;
>> 132                 interrupt-parent = <&gpio2>;
>> 133                 interrupts = <2>; /* gpio line 34 */
>> 134                 vdd-supply = <&vdd_eth>;
>> 135         };
>> 136 };
>>
>>
>> There's no gpio request on the driver:
>>
>> $ git grep -e gpio_request drivers/net/ethernet/micrel/ks8851.c
>> $
>>
>> Since Benoit was the one who added that to the dts file (commit
>> e7c64db9), I assume he tested his patch before posting, so again I ask -
>> How does that work and why doesn't this work for Sourav's tsl2771
>> controller ?
>>
>> This is either a regression on drivers/of, or commit e7c64db9 is also
>> broken...
>>
>> Benoit, do you know how should this work ?
>>
> I had a discussion with Benoit on this. In fact there is a way to actually
> trigger the GPIO request.
>
>> 132                 interrupt-parent = <&gpio2>;
>> 133                 interrupts = <2>; /* gpio line 34 */
>
> As above you can see, GPIO2 bank and 2nd line.
> And then it will make use of gpio_irq chip properties
> to probe the GPIO line.
>
> Saurabh can try this out for his use case.
>
I am using the above properties only and seeing the issue.
~Sourav
> Regards
> Santosh

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [GPIO] Crashed when not using
  2012-07-31 12:56             ` Poddar, Sourav
@ 2012-08-06  5:46               ` Shilimkar, Santosh
  0 siblings, 0 replies; 13+ messages in thread
From: Shilimkar, Santosh @ 2012-08-06  5:46 UTC (permalink / raw)
  To: Poddar, Sourav
  Cc: balbi, Kevin Hilman, DebBarma, Tarun Kanti, lo, Benoit Cousson,
	linux-kernel

On Tue, Jul 31, 2012 at 6:26 PM, Poddar, Sourav <sourav.poddar@ti.com> wrote:
> Hi Santosh,
>
> On Tue, Jul 31, 2012 at 6:02 PM, Shilimkar, Santosh
> <santosh.shilimkar@ti.com> wrote:
>> On Tue, Jul 31, 2012 at 8:52 AM, Felipe Balbi <balbi@ti.com> wrote:
>>>
>>> Hi,
>>>
>>> On Tue, Jul 31, 2012 at 10:23:16AM +0530, Poddar, Sourav wrote:
>>> > >>>> The device tree data for acquiring the above GPIO interrupt line
>>> > >>>> looks
>>> > >>>> like this.
>>> > >>>>
>>> > >>>> +++ linux-omap-storage/arch/arm/boot/dts/omap5-evm.dts  2012-07-30
>>> > >>>> 14:11:08.931694001 +0530
>>> > >>>> @@ -42,7 +42,8 @@
>>> > >>>>         tsl2771@39 {
>>> > >>>>                 compatible = "taos,tsl2771";
>>> > >>>>                 reg = <0x39>;
>>> > >>>> +                interrupt-parent = <&gpio5>;
>>> > >>>> +                interrupts = <21>; /* gpio line 149 */
>>> > >>>>         };
>>> > >>>>  };
>>> > >>>>
>>> > >>>> Note: using "gpio_request_one" in the driver solves the issue.
>>> > >>>> Is using this api in the driver required?
>>> > >>>> Any pointer on the above crash?
>>> > >>>
>>> > >> Hi Tarun,
>>> > >>> Any user/client driver of GPIO is supposed to go through
>>> > >>> gpio_request() API so that module clock
>>> > >>> is enabled correctly. Overriding of APIs would put the power
>>> > >>> management state machine in jeopardy.
>>> > >>> --
>>> > >> I tried putting "pm_runtime_get_sync" in gpio_irq_type api where the
>>> > >> kernel
>>> > >> is crashing and the crash is no longer observed. So indeed, its about
>>> > >> enabling clocks.
>>> > >>
>>> > >> One doubt: Can't we put runtime apis in "gpio_irq_type" and eliminate
>>> > >> the use of
>>> > >> "gpio_request_one"??
>>> > >
>>> > > No.
>>> > >
>>> > > You must use the GPIO requiest/free APIs to tell the GPIO core that
>>> > > the GPIO line is in use.
>>> > >
>>> > Thanks for this confirmation.
>>> > > Why do you want to avoid using gpio_request/gpio_free?
>>> > >
>>> > I was assuming that DT based gpio IRQ registration will automatically
>>> > take care of
>>> > the above APIs. But since that is not the case(as mentioned by
>>> > santosh),  we need to use the
>>> > gpio_request/free apis.
>>>
>>> Hang on for a while, let's try to get to the bottom of this debate first
>>> ;-)
>>>
>>> We have a canonical way of passing IRQ numbers to drivers through DT and
>>> that is the "interrupts" attribute. It shouldn't matter if that IRQ pin
>>> is connected to a real IRQ line or through a GPIO controller. In both
>>> cases we should use the "interrupts" attribute.
>>>
>>> If DT core doesn't allocate the GPIO for us then how does this work:
>>>
>>> (omap4-sdp.dts)
>>>
>>> 127 &mcspi1 {
>>> 128         eth@0 {
>>> 129                 compatible = "ks8851";
>>> 130                 spi-max-frequency = <24000000>;
>>> 131                 reg = <0>;
>>> 132                 interrupt-parent = <&gpio2>;
>>> 133                 interrupts = <2>; /* gpio line 34 */
>>> 134                 vdd-supply = <&vdd_eth>;
>>> 135         };
>>> 136 };
>>>
>>>
>>> There's no gpio request on the driver:
>>>
>>> $ git grep -e gpio_request drivers/net/ethernet/micrel/ks8851.c
>>> $
>>>
>>> Since Benoit was the one who added that to the dts file (commit
>>> e7c64db9), I assume he tested his patch before posting, so again I ask -
>>> How does that work and why doesn't this work for Sourav's tsl2771
>>> controller ?
>>>
>>> This is either a regression on drivers/of, or commit e7c64db9 is also
>>> broken...
>>>
>>> Benoit, do you know how should this work ?
>>>
>> I had a discussion with Benoit on this. In fact there is a way to actually
>> trigger the GPIO request.
>>
>>> 132                 interrupt-parent = <&gpio2>;
>>> 133                 interrupts = <2>; /* gpio line 34 */
>>
>> As above you can see, GPIO2 bank and 2nd line.
>> And then it will make use of gpio_irq chip properties
>> to probe the GPIO line.
>>
>> Saurabh can try this out for his use case.
>>
> I am using the above properties only and seeing the issue.
>
There seeems to be an issue with the GPIO DT probing. The Ethernet
works because there is another GPIO line from BANK2 is probed and since
BANK2 shares the clock, you won't see any issue.

We are looking at fixing the issue. Will keep the thread posted.

Regards
Santosh

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-08-06  5:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30  8:43 [GPIO] Crashed when not using Poddar, Sourav
2012-07-30  9:34 ` DebBarma, Tarun Kanti
2012-07-30 11:15   ` Poddar, Sourav
2012-07-30 20:36     ` Kevin Hilman
2012-07-30 20:36       ` Kevin Hilman
2012-07-30 22:37       ` Shilimkar, Santosh
2012-07-31  4:53       ` Poddar, Sourav
2012-07-31  6:52         ` Felipe Balbi
2012-07-31 12:32           ` Shilimkar, Santosh
2012-07-31 12:32             ` Felipe Balbi
2012-07-31 12:56             ` Poddar, Sourav
2012-08-06  5:46               ` Shilimkar, Santosh
2012-07-31  6:43       ` Felipe Balbi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.