基于Linux的ARM与FPGA SPI驱动,中断函数调用spidev_sync_read(),出现错误
BUG: scheduling while atomic: spidev_test/1034/0x00010003
Modules linked in: spidev fpga
Pid: 1034, comm: spidev_test
CPU: 0 Tainted: G W (2.6.35.3-571-gcca29a0 #131)
PC is at __setup_irq+0x258/0x378
LR is at mxs_gpio_unmask_irq+0x38/0x40
pc : [] lr : [] psr: 60000013
sp : c7efbd68 ip : c7efbd40 fp : c7efbd94
r10: c7e6b400 r9 : 00000000 r8 : c03fa89c
r7 : 60000013 r6 : 000000bb r5 : c7e6be40 r4 : c03fa87c
r3 : 00000000 r2 : 00000000 r1 : f0018010 r0 : 00000000
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 0005317f Table: 47f14000 DAC: 00000015
[] (show_regs+0x0/0x50) from [] (__schedule_bug+0x4c/0x60)
r5:c7efa000 r4:c7efbd20
[] (__schedule_bug+0x0/0x60) from [] (schedule+0x78/0x36c)
r5:c7efa000 r4:c7cc1cc0
[] (schedule+0x0/0x36c) from [] (schedule_timeout+0x20/0x1f4
)
[] (schedule_timeout+0x0/0x1f4) from [] (wait_for_common+0x1
04/0x1d4)
r6:c7efbc04 r5:7fffffff r4:c7efa000
[] (wait_for_common+0x0/0x1d4) from [] (wait_for_completion+
0x18/0x1c)
[] (wait_for_completion+0x0/0x1c) from [] (spidev_sync+0xc8/
0xe4 [spidev])
[] (spidev_sync+0x0/0xe4 [spidev]) from [] (fpga_irq+0x68/0x
8c [spidev])
r6:c7e6b400 r5:c7efbc30 r4:00000001
[] (fpga_irq+0x0/0x8c [spidev]) from [] (handle_IRQ_event+0x
2c/0xfc)
r8:00000001 r7:000000bb r6:00000000 r5:00000000 r4:c7e6be40
[] (handle_IRQ_event+0x0/0xfc) from [] (handle_level_irq+0xd
c/0x188)
r7:c03f956c r6:c7e6be40 r5:000000bb r4:c03fa87c
[] (handle_level_irq+0x0/0x188) from [] (mxs_gpio_irq_handle
r+0x6c/0xa0)
r7:c03f956c r6:0000007e r5:000000bb r4:00000001
[] (mxs_gpio_irq_handler+0x0/0xa0) from [] (asm_do_IRQ+0x74/
0x94)
r7:00000002 r6:000000bb r5:00000000 r4:0000007e
[] (asm_do_IRQ+0x0/0x94) from [] (__irq_svc+0x44/0x8c)
Exception stack(0xc7efbd20 to 0xc7efbd68)
bd20: 00000000 f0018010 00000000 00000000 c03fa87c c7e6be40 000000bb 60000013
bd40: c03fa89c 00000000 c7e6b400 c7efbd94 c7efbd40 c7efbd68 c003b944 c007c710
bd60: 60000013 ffffffff
r5:f0000000 r4:ffffffff
[] (__setup_irq+0x0/0x378) from [] (request_threaded_irq+0xb
c/0x104)
[] (request_threaded_irq+0x0/0x104) from [] (spidev_open+0x1
0c/0x150 [spidev])
[] (spidev_open+0x0/0x150 [spidev]) from [] (chrdev_open+0x1
e8/0x208)
r6:c7e6b8c0 r5:c7f2c280 r4:c7a7b128
[] (chrdev_open+0x0/0x208) from [] (__dentry_open+0x19c/0x2b
8)
r8:c00bf1b4 r7:c7a7b128 r6:c7a7ac00 r5:c7cdbb00 r4:c7f2c280
[] (__dentry_open+0x0/0x2b8) from [] (nameidata_to_filp+0x48
/0x60)
[] (nameidata_to_filp+0x0/0x60) from [] (do_last+0x4a8/0x604
)
r4:c7efbed0
[] (do_last+0x0/0x604) from [] (do_filp_open+0x188/0x4f0)
[] (do_filp_open+0x0/0x4f0) from [] (do_sys_open+0x64/0xec)
[] (do_sys_open+0x0/0xec) from [] (sys_open+0x24/0x28)
[] (sys_open+0x0/0x28) from [] (ret_fast_syscall+0x0/0x2c)
------解决思路----------------------
中断处理函数好像有问题
------解决思路----------------------
你怎么确定是spidev_sync_read()出了问题?
你的spidev_test是怎么调用驱动模块的?
------解决思路----------------------
你的中断是怎么触发的?
能介绍一下你的中断系统和spidev_test之间的关系么?
------解决思路----------------------
你这直接上这么一段崩溃信息都不知道你这代码逻辑,直接上代码请?