hi. i'm trying to implement in using ECSPI5 for external device.
but if the xxx_irq is called , kernel is dead as folling message
/* --------------------------------this is irq code */
static irqreturn_t xxx_irq(int irq, void *dev_id)
{
unsigned long flag;
spin_lock_irqsave(&irq_lock,flag);
tasklet_schedule(&s_DemodExIntTasklet);
spin_unlock_irqrestore(&irq_lock,flag);
return IRQ_HANDLED;
}
static void demod_tasklet(unsigned long data)
{
printk("demod_takslet\n");
Mutex_Lock(pDEV->m_pLockISR);
/* this is customer function "XXX_ISR"
Mutex_Unlock(pDEV->m_pLockISR);
}
----------------------------------
fci8050_irq
demod_takslet
BUG: scheduling while atomic: swapper/0/0x00000104
Modules linked in: fcidrv
Pid: 0, comm: swapper
CPU: 0 Not tainted (3.0.35-06433-g8e02e5d-dirty #90)
PC is at default_idle+0x24/0x28
LR is at arch_idle+0xbc/0xf4
pc : [<c004d468>] lr : [<c005c264>] psr: 400f0013
sp : c08d5fb0 ip : 00000000 fp : 00000000
r10: 00000000 r9 : 412fc09a r8 : 1000406a
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = d18b0000
[00000000] *pgd=00000000
Internal error: Oops: 80000005 [#1] PREEMPT SMP
Modules linked in: fcidrv
CPU: 1 Not tainted (3.0.35-06433-g8e02e5d-dirty #90)
PC is at 0x0
LR is at enqueue_task+0x64/0x70
pc : [<00000000>] lr : [<c007cfc4>] psr: 400e0093
sp : d1577e68 ip : 00000000 fp : d1577e7c
r10: 00000000 r9 : 800e0013 r8 : 00000000
r7 : c08f18d4 r6 : c12fe320 r5 : 00000001 r4 : c08f14c0
r3 : 00000000 r2 : 00000001 r1 : c08f14c0 r0 : c12fe320
Flags: nZcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c53c7d Table: 218b004a DAC: 00000015
LR: 0xc007cf44:
cf44 05803488 e1a00004 ebffffba e5943008 e2433001 e5843008 e8bd8818 e92d4878
cf64 e28db014 e1a04001 e1a06000 e1a05002 ebffff9b e3a01f72 e18420d1 e1920003
cf84 1a000008 e5942004 e59f3034 e5920014 e59f2030 e7922100 e0833002 e2833e4a
cfa4 e1c320d0 e18420f1 e5943030 e1a00006 e1a01004 e1a02005 e5933004 e12fff33
cfc4 e8bd8878 c0045320 c08ea7d0 e92d4818 e1a04000 e5913000 e28db00c e3130002
cfe4 0a000004 e591300c e3130901 05903488 02433001 05803488 e1a00004 ebffffd6
d004 e5943008 e2833001 e5843008 e8bd8818 e92d4830 e1a04000 e28db00c e1a05001
d024 e10f3000 e3130080 0a00000b e1500001 0a000003 3a000004 e1a00001 eb17b434
SP: 0xd1577de8:
7de8 d1577eaf d1577e34 d1577e58 d41ad600 00000000 c0359e08 00000000 00000003
7e08 00000000 0000040f 00000005 c12fe320 c08f18d4 c004c4d4 c12fe320 c08f14c0
7e28 00000001 00000000 c08f14c0 00000001 c12fe320 c08f18d4 00000000 800e0013
7e48 00000000 d1577e7c 00000000 d1577e68 c007cfc4 00000000 400e0093 ffffffff
7e68 ffffffda c12fe320 c12fe320 c08ea7d0 d1577e8c c007d004 00000001 c08f14c0
7e88 d1577ec4 c0089a54 d4827aa4 00000001 c0045320 c0045320 d4827aa4 d1419380
7ea8 d1419384 00000000 00000027 c004ca84 d1576000 00000000 6723d038 c0668e58
7ec8 00000037 d4827aa0 0002acb0 bf000418 00000037 bf000798 d469e290 760bfe8c
FP: 0xd1577dfc:
7dfc c0359e08 00000000 00000003 00000000 0000040f 00000005 c12fe320 c08f18d4
7e1c c004c4d4 c12fe320 c08f14c0 00000001 00000000 c08f14c0 00000001 c12fe320
7e3c c08f18d4 00000000 800e0013 00000000 d1577e7c 00000000 d1577e68 c007cfc4
7e5c 00000000 400e0093 ffffffff ffffffda c12fe320 c12fe320 c08ea7d0 d1577e8c
7e7c c007d004 00000001 c08f14c0 d1577ec4 c0089a54 d4827aa4 00000001 c0045320
7e9c c0045320 d4827aa4 d1419380 d1419384 00000000 00000027 c004ca84 d1576000
7ebc 00000000 6723d038 c0668e58 00000037 d4827aa0 0002acb0 bf000418 00000037
7edc bf000798 d469e290 760bfe8c d1844360 bf000258 6723d038 760bfe8c 00000000
R0: 0xc12fe2a0:
e2a0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
e2c0 00000054 00000000 00000000 00000000 00000000 00000000 00000000 00000000
e2e0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
e300 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
e320 00000001 00000000 00000002 0001184b 00008c26 00004613 00002313 000011c1
e340 ffffa114 00000000 00000000 00000000 00000000 00000000 0001184b 00000000
e360 00000d93 00000000 0002c5d2 00000000 0001184b 00000000 00000001 00000000
e380 7ba277ba 00000002 5f656b4a 00000021 5f656b4a 00000021 d4779660 d4779660
R1: 0xc08f1440:
1440 c035bd64 c066af10 c035bd74 c066af18 c035bd80 c066af20 c035bdd0 c066af2c
1460 c035be20 c066af38 c04b7f10 c066af44 c04b7f90 c066af4c c04b7fd8 c066af54
1480 c04b82f8 c066af5c c04b8378 c066af64 c04b83c0 c066af6c c04ee2f0 c066af74
14a0 c04ee458 c066af7c c04ee478 c066af84 c0641190 c066af8c 00000001 00000000
14c0 00000002 c08d4000 00000002 00200000 00000000 00000000 00000001 00000000
14e0 00000078 00000078 00000078 00000000 c066c724 00000000 00000400 00400000
1500 00000000 00000000 00000000 c08f150c c08f150c 00000000 00000000 00000000
1520 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
R4: 0xc08f1440:
1440 c035bd64 c066af10 c035bd74 c066af18 c035bd80 c066af20 c035bdd0 c066af2c
1460 c035be20 c066af38 c04b7f10 c066af44 c04b7f90 c066af4c c04b7fd8 c066af54
1480 c04b82f8 c066af5c c04b8378 c066af64 c04b83c0 c066af6c c04ee2f0 c066af74
14a0 c04ee458 c066af7c c04ee478 c066af84 c0641190 c066af8c 00000001 00000000
14c0 00000002 c08d4000 00000002 00200000 00000000 00000000 00000001 00000000
14e0 00000078 00000078 00000078 00000000 c066c724 00000000 00000400 00400000
1500 00000000 00000000 00000000 c08f150c c08f150c 00000000 00000000 00000000
1520 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
R6: 0xc12fe2a0:
e2a0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
e2c0 00000054 00000000 00000000 00000000 00000000 00000000 00000000 00000000
e2e0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
e300 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
e320 00000001 00000000 00000002 0001184b 00008c26 00004613 00002313 000011c1
e340 ffffa114 00000000 00000000 00000000 00000000 00000000 0001184b 00000000
e360 00000d93 00000000 0002c5d2 00000000 0001184b 00000000 00000001 00000000
e380 7ba277ba 00000002 5f656b4a 00000021 5f656b4a 00000021 d4779660 d4779660
R7: 0xc08f1854:
1854 00000000 00000000 00000000 00000000 00000000 00000000 c090ef28 c090e720
1874 c090a324 c08f1988 c08f1bc0 00000000 00000000 00000000 00000000 00000000
1894 00000000 c08f1898 c08f1898 00000000 00000000 00000000 00000000 00000000
18b4 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
18d4 00000001 00000000 c08f18dc c08f18dc 00000000 00000000 00000000 00000000
18f4 00000000 00000000 00000000 00000000 00000000 c0986bc4 00000000 00000000
1914 00000000 00000000 00000000 00000000 00000000 00000000 00000001 00000000
1934 00000000 c08f1938 c08f1938 00000000 c08f1944 c08f1944 00000000 00000000
Process bplayeractivity (pid: 3285, stack limit = 0xd15762f0)
Stack: (0xd1577e68 to 0xd1578000)
7e60: ffffffda c12fe320 c12fe320 c08ea7d0 d1577e8c c007d004
7e80: 00000001 c08f14c0 d1577ec4 c0089a54 d4827aa4 00000001 c0045320 c0045320
7ea0: d4827aa4 d1419380 d1419384 00000000 00000027 c004ca84 d1576000 00000000
7ec0: 6723d038 c0668e58 00000037 d4827aa0 0002acb0 bf000418 00000037 bf000798
7ee0: d469e290 760bfe8c d1844360 bf000258 6723d038 760bfe8c 00000000 0002acb0
7f00: d1576000 c013ff94 760bfa04 00000001 6986bbef 00000004 760bfa64 00000030
7f20: d1577f20 00000000 00000000 00000000 2affa991 0000000d 2afee641 0000000d
7f40: c00b0ce0 c13154f8 d1577f88 00000003 760bfa0c 00000000 00000003 d1576000
7f60: d49b0f00 d1844360 760bfe8c 0000000d 00000027 c004ca84 d1576000 00000000
7f80: 6723d038 c0140498 00000000 00000001 6986bbef 6986bbef 59bb9260 5a212f90
7fa0: 00000036 c004c900 6986bbef 59bb9260 00000027 0000000d 760bfe8c 760bfe78
7fc0: 6986bbef 59bb9260 5a212f90 00000036 67492fe0 75fc0000 760bff00 6723d038
7fe0: 696fd609 760bfe68 40196ab7 40186324 200e0010 00000027 80028000 01600020
[<c007cfc4>] (enqueue_task+0x64/0x70) from [<c007d004>] (activate_task+0x34/0x44)
[<c007d004>] (activate_task+0x34/0x44) from [<c0089a54>] (try_to_wake_up+0x228/0x35c)
[<c0089a54>] (try_to_wake_up+0x228/0x35c) from [<c0668e58>] (__mutex_unlock_slowpath+0x34/0x40)
[<c0668e58>] (__mutex_unlock_slowpath+0x34/0x40) from [<bf000418>] (Mutex_Unlock+0x8/0x10 [fcidrv])
[<bf000418>] (Mutex_Unlock+0x8/0x10 [fcidrv]) from [<bf000798>] (TDMB_FC8050_DEV_RF_SET_FREQ+0x58/0x90 [fcidrv])
[<bf000798>] (TDMB_FC8050_DEV_RF_SET_FREQ+0x58/0x90 [fcidrv]) from [<bf000258>] (lfdd_ioctl+0xc0/0x218 [fcidrv])
[<bf000258>] (lfdd_ioctl+0xc0/0x218 [fcidrv]) from [<c013ff94>] (do_vfs_ioctl+0x80/0x54c)
[<c013ff94>] (do_vfs_ioctl+0x80/0x54c) from [<c0140498>] (sys_ioctl+0x38/0x5c)
[<c0140498>] (sys_ioctl+0x38/0x5c) from [<c004c900>] (ret_fast_syscall+0x0/0x30)
Code: bad PC value
---[ end trace 2d68650665fcffc6 ]---
Kernel panic - not syncing: Fatal exception
[<c0053fc4>] (unwind_backtrace+0x0/0x138) from [<c0663090>] (panic+0x74/0x194)
[<c0663090>] (panic+0x74/0x194) from [<c0050454>] (die+0x218/0x284)
[<c0050454>] (die+0x218/0x284) from [<c066250c>] (__do_kernel_fault.part.3+0x54/0x74)
[<c066250c>] (__do_kernel_fault.part.3+0x54/0x74) from [<c0057d70>] (do_page_fault+0x2cc/0x334)
[<c0057d70>] (do_page_fault+0x2cc/0x334) from [<c00464ac>] (do_PrefetchAbort+0x34/0x9c)
[<c00464ac>] (do_PrefetchAbort+0x34/0x9c) from [<c004c4d4>] (__pabt_svc+0x74/0xc0)
Exception stack(0xd1577e20 to 0xd1577e68)
7e20: c12fe320 c08f14c0 00000001 00000000 c08f14c0 00000001 c12fe320 c08f18d4
7e40: 00000000 800e0013 00000000 d1577e7c 00000000 d1577e68 c007cfc4 00000000
7e60: 400e0093 ffffffff
[<c004c4d4>] (__pabt_svc+0x74/0xc0) from [<c007cfc4>] (enqueue_task+0x64/0x70)
[<c007cfc4>] (enqueue_task+0x64/0x70) from [<c007d004>] (activate_task+0x34/0x44)
[<c007d004>] (activate_task+0x34/0x44) from [<c0089a54>] (try_to_wake_up+0x228/0x35c)
[<c0089a54>] (try_to_wake_up+0x228/0x35c) from [<c0668e58>] (__mutex_unlock_slowpath+0x34/0x40)
[<c0668e58>] (__mutex_unlock_slowpath+0x34/0x40) from [<bf000418>] (Mutex_Unlock+0x8/0x10 [fcidrv])
[<bf000418>] (Mutex_Unlock+0x8/0x10 [fcidrv]) from [<bf000798>] (TDMB_FC8050_DEV_RF_SET_FREQ+0x58/0x90 [fcidrv])
[<bf000798>] (TDMB_FC8050_DEV_RF_SET_FREQ+0x58/0x90 [fcidrv]) from [<bf000258>] (lfdd_ioctl+0xc0/0x218 [fcidrv])
[<bf000258>] (lfdd_ioctl+0xc0/0x218 [fcidrv]) from [<c013ff94>] (do_vfs_ioctl+0x80/0x54c)
[<c013ff94>] (do_vfs_ioctl+0x80/0x54c) from [<c0140498>] (sys_ioctl+0x38/0x5c)
[<c0140498>] (sys_ioctl+0x38/0x5c) from [<c004c900>] (ret_fast_syscall+0x0/0x30)
CPU3: stopping
[<c0053fc4>] (unwind_backtrace+0x0/0x138) from [<c00463a8>] (do_IPI+0x1d4/0x208)
[<c00463a8>] (do_IPI+0x1d4/0x208) from [<c004c34c>] (__irq_svc+0x4c/0xe8)
Exception stack(0xd409bf90 to 0xd409bfd8)
bf80: c09745a8 200f0093 00000001 00000000
bfa0: d409a000 c096c024 c066cdb4 c08f26d4 1000406a 412fc09a 00000000 00000000
bfc0: 00000000 d409bfd8 c005c264 c004d468 400f0013 ffffffff
[<c004c34c>] (__irq_svc+0x4c/0xe8) from [<c004d468>] (default_idle+0x24/0x28)
[<c004d468>] (default_idle+0x24/0x28) from [<c004d778>] (cpu_idle+0xc8/0x108)
[<c004d778>] (cpu_idle+0xc8/0x108) from [<1065ea94>] (0x1065ea94)
CPU2: stopping
[<c0053fc4>] (unwind_backtrace+0x0/0x138) from [<c00463a8>] (do_IPI+0x1d4/0x208)
[<c00463a8>] (do_IPI+0x1d4/0x208) from [<c004c34c>] (__irq_svc+0x4c/0xe8)
Exception stack(0xd4071f90 to 0xd4071fd8)
1f80: c09745a8 60070093 00000001 00000000
1fa0: d4070000 c096c024 c066cdb4 c08f26d4 1000406a 412fc09a 00000000 00000000
1fc0: 00000000 d4071fd8 c005c264 c004d468 40070013 ffffffff
[<c004c34c>] (__irq_svc+0x4c/0xe8) from [<c004d468>] (default_idle+0x24/0x28)
[<c004d468>] (default_idle+0x24/0x28) from [<c004d778>] (cpu_idle+0xc8/0x108)
[<c004d778>] (cpu_idle+0xc8/0x108) from [<1065ea94>] (0x1065ea94)
CPU0: stopping
[<c0053fc4>] (unwind_backtrace+0x0/0x138) from [<c00463a8>] (do_IPI+0x1d4/0x208)
[<c00463a8>] (do_IPI+0x1d4/0x208) from [<c004c34c>] (__irq_svc+0x4c/0xe8)
Exception stack(0xc08d5c70 to 0xc08d5cb8)
5c60: c096e80c 600f0193 c090811c c090811c
5c80: c096e813 c096e83f c09080bc c096e758 0000002f c096e758 00000000 600f0113
5ca0: 00000000 c08d5cb8 c008f544 c008f658 600f0113 ffffffff
[<c004c34c>] (__irq_svc+0x4c/0xe8) from [<c008f658>] (vprintk+0x328/0x4ac)
[<c008f658>] (vprintk+0x328/0x4ac) from [<c06631cc>] (printk+0x1c/0x2c)
[<c06631cc>] (printk+0x1c/0x2c) from [<c004d8d8>] (__show_regs+0xac/0x368)
[<c004d8d8>] (__show_regs+0xac/0x368) from [<c004dbd4>] (show_regs+0x40/0x48)
[<c004dbd4>] (show_regs+0x40/0x48) from [<c0667cec>] (__schedule+0x828/0x960)
[<c0667cec>] (__schedule+0x828/0x960) from [<c0668fac>] (__mutex_lock_slowpath+0x128/0x1bc)
[<c0668fac>] (__mutex_lock_slowpath+0x128/0x1bc) from [<c0669078>] (mutex_lock+0x38/0x3c)
[<c0669078>] (mutex_lock+0x38/0x3c) from [<bf000408>] (Mutex_Lock+0x8/0x10 [fcidrv])
[<bf000408>] (Mutex_Lock+0x8/0x10 [fcidrv]) from [<bf000aa4>] (TDMB_FC8050_DEV_ISR+0x1c/0x40 [fcidrv])
[<bf000aa4>] (TDMB_FC8050_DEV_ISR+0x1c/0x40 [fcidrv]) from [<c0094a68>] (tasklet_action+0x120/0x1d8)
[<c0094a68>] (tasklet_action+0x120/0x1d8) from [<c0095024>] (__do_softirq+0xc8/0x25c)
[<c0095024>] (__do_softirq+0xc8/0x25c) from [<c009566c>] (irq_exit+0x98/0xa0)
[<c009566c>] (irq_exit+0x98/0xa0) from [<c004d1b4>] (handle_IRQ+0x50/0xac)
[<c004d1b4>] (handle_IRQ+0x50/0xac) from [<c004c34c>] (__irq_svc+0x4c/0xe8)
[<c004c34c>] (__irq_svc+0x4c/0xe8) from [<c004d468>] (default_idle+0x24/0x28)
[<c004d468>] (default_idle+0x24/0x28) from [<c004d778>] (cpu_idle+0xc8/0x108)
[<c004d778>] (cpu_idle+0xc8/0x108) from [<c00088bc>] (start_kernel+0x29c/0x2ec)
[<c00088bc>] (start_kernel+0x29c/0x2ec) from [<10008040>] (0x10008040)
linux version 3.0.35-06433-g8e02e5d-dirty
Can anybody tell me how to fix this error?
Best Regards,
jack
Hi Jack,
i think making a lock in a irq handler isn't a good idea.
BR Stefan
Yes, That is right.
The issus is solved by chaning request_irq to request_threaded_irq .
Thank you your reply