目前在写一个USB驱动来做些数据流的工作,从USB设备读取数据用的是async的方法,看起来工作还算正常。
但是因为async中使用了DMA来传输数据,在usb_free_coherent释放DMA时会触发底层的一个WARN_ON,貌似是中断没开。因为每次都会dump出很多打印,影响速度进而使数据流丢失很多。
对kernel中的DMA和中断不是很熟悉,了解的大牛请指点一下怎么解决这个问题,谢谢!
打印如下:
复制代码- [root@FriendlyARM lgs]# ./test.out t
- ------------[ cut here ]------------
- WARNING: at arch/arm/mm/dma-mapping.c:399 dma_free_coherent+0x2c/0x1b4()
- Modules linked in: lgsusb [last unloaded: lgsusb]
- [<c016d464>] (unwind_backtrace+0x0/0xe4) from [<c0184a5c>] (warn_slowpath_common+0x4c/0x64)
- [<c0184a5c>] (warn_slowpath_common+0x4c/0x64) from [<c0184a8c>] (warn_slowpath_null+0x18/0x1c)
- [<c0184a8c>] (warn_slowpath_null+0x18/0x1c) from [<c016dc20>] (dma_free_coherent+0x2c/0x1b4)
- [<c016dc20>] (dma_free_coherent+0x2c/0x1b4) from [<bf0368f0>] (lgs_read_bulk_callback+0x9c/0xc4 [lgsusb])
- [<bf0368f0>] (lgs_read_bulk_callback+0x9c/0xc4 [lgsusb]) from [<c033da44>] (usb_hcd_giveback_urb+0x70/0xb8)
- [<c033da44>] (usb_hcd_giveback_urb+0x70/0xb8) from [<c034a4f8>] (finish_urb+0x7c/0xb8)
- [<c034a4f8>] (finish_urb+0x7c/0xb8) from [<c034df08>] (ohci_irq+0x314/0x4e4)
- [<c034df08>] (ohci_irq+0x314/0x4e4) from [<c033d720>] (usb_hcd_irq+0x38/0x88)
- [<c033d720>] (usb_hcd_irq+0x38/0x88) from [<c01ad944>] (handle_IRQ_event+0x24/0xe0)
- [<c01ad944>] (handle_IRQ_event+0x24/0xe0) from [<c01af118>] (handle_level_irq+0xb0/0x12c)
- [<c01af118>] (handle_level_irq+0xb0/0x12c) from [<c0167070>] (asm_do_IRQ+0x70/0x94)
- [<c0167070>] (asm_do_IRQ+0x70/0x94) from [<c0167c44>] (__irq_usr+0x44/0xa0)
- Exception stack(0xcd617fb0 to 0xcd617ff8)
- 7fa0: 00000000 00012070 00008000 00000000
- 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 4010d000 beab4cf4
- 7fe0: 00000000 beab4cd8 00008d44 00008d44 00000010 ffffffff
- ---[ end trace e4680eada2fbf3df ]---
|
[ 此帖被lgs在2011-03-09 10:09重新编辑 ]