主题 : 请教一个USB驱动中引发的DMA中断问题 复制链接 | 浏览器收藏 | 打印
lgs
级别: 新手上路
UID: 38690
精华: 0
发帖: 21
金钱: 105 两
威望: 21 点
综合积分: 42 分
注册时间: 2011-02-28
最后登录: 2011-03-30
楼主  发表于: 2011-03-09 09:32

 请教一个USB驱动中引发的DMA中断问题

    目前在写一个USB驱动来做些数据流的工作,从USB设备读取数据用的是async的方法,看起来工作还算正常。

    但是因为async中使用了DMA来传输数据,在usb_free_coherent释放DMA时会触发底层的一个WARN_ON,貌似是中断没开。因为每次都会dump出很多打印,影响速度进而使数据流丢失很多。

    对kernel中的DMA和中断不是很熟悉,了解的大牛请指点一下怎么解决这个问题,谢谢!

    打印如下:

复制代码
  1. [root@FriendlyARM lgs]# ./test.out t
  2. ------------[ cut here ]------------
  3. WARNING: at arch/arm/mm/dma-mapping.c:399 dma_free_coherent+0x2c/0x1b4()
  4. Modules linked in: lgsusb [last unloaded: lgsusb]
  5. [<c016d464>] (unwind_backtrace+0x0/0xe4) from [<c0184a5c>] (warn_slowpath_common+0x4c/0x64)
  6. [<c0184a5c>] (warn_slowpath_common+0x4c/0x64) from [<c0184a8c>] (warn_slowpath_null+0x18/0x1c)
  7. [<c0184a8c>] (warn_slowpath_null+0x18/0x1c) from [<c016dc20>] (dma_free_coherent+0x2c/0x1b4)
  8. [<c016dc20>] (dma_free_coherent+0x2c/0x1b4) from [<bf0368f0>] (lgs_read_bulk_callback+0x9c/0xc4 [lgsusb])
  9. [<bf0368f0>] (lgs_read_bulk_callback+0x9c/0xc4 [lgsusb]) from [<c033da44>] (usb_hcd_giveback_urb+0x70/0xb8)
  10. [<c033da44>] (usb_hcd_giveback_urb+0x70/0xb8) from [<c034a4f8>] (finish_urb+0x7c/0xb8)
  11. [<c034a4f8>] (finish_urb+0x7c/0xb8) from [<c034df08>] (ohci_irq+0x314/0x4e4)
  12. [<c034df08>] (ohci_irq+0x314/0x4e4) from [<c033d720>] (usb_hcd_irq+0x38/0x88)
  13. [<c033d720>] (usb_hcd_irq+0x38/0x88) from [<c01ad944>] (handle_IRQ_event+0x24/0xe0)
  14. [<c01ad944>] (handle_IRQ_event+0x24/0xe0) from [<c01af118>] (handle_level_irq+0xb0/0x12c)
  15. [<c01af118>] (handle_level_irq+0xb0/0x12c) from [<c0167070>] (asm_do_IRQ+0x70/0x94)
  16. [<c0167070>] (asm_do_IRQ+0x70/0x94) from [<c0167c44>] (__irq_usr+0x44/0xa0)
  17. Exception stack(0xcd617fb0 to 0xcd617ff8)
  18. 7fa0:                                     00000000 00012070 00008000 00000000
  19. 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 4010d000 beab4cf4
  20. 7fe0: 00000000 beab4cd8 00008d44 00008d44 00000010 ffffffff
  21. ---[ end trace e4680eada2fbf3df ]---
[ 此帖被lgs在2011-03-09 10:09重新编辑 ]
lgs
级别: 新手上路
UID: 38690
精华: 0
发帖: 21
金钱: 105 两
威望: 21 点
综合积分: 42 分
注册时间: 2011-02-28
最后登录: 2011-03-30
1楼  发表于: 2011-03-10 03:21
零回复?不是吧...