Hello all, I'm using an ARM board with USB OTG to emulate a USB keyboard. The keyboard emulation part seems to work fine. However I'm seeing lots of BUG: scheduling while atomic dumps in dmesg. Snippets from dmesg are at the end of this message. I tried to fix it as per the attached patch, and the BUG messages did go away. Your thoughts please? Thanks! $ uname -a Linux vmx25 3.3.0-rc6 #1 Thu Mar 8 12:52:12 EET 2012 armv5tejl GNU/Linux >>> dmesg snippets start here BUG: scheduling while atomic: swapper/0/0x40010000 Modules linked in: g_hid fsl_usb2_udc pwm_beeper pwm arc4 ath9k_htc firmware_class mac80211 ath9k_common1 [...] Pid: 0, comm: swapper CPU: 0 Not tainted (3.3.0-rc6 #1) [...] Backtrace: [...] [<c029df50>] (_cond_resched+0x0/0x48) from [<c006fd58>] (dma_pool_alloc+0x24/0x1dc) [<c006fd34>] (dma_pool_alloc+0x0/0x1dc) from [<bf11ab60>] (fsl_req_to_dtd+0x48/0x15c [fsl_usb2_udc]) [<bf11ab18>] (fsl_req_to_dtd+0x0/0x15c [fsl_usb2_udc]) from [<bf11bbac>] (ep0_prime_status+0x120/0x16c [) [<bf11ba8c>] (ep0_prime_status+0x0/0x16c [fsl_usb2_udc]) from [<bf11c3a4>] (fsl_udc_irq+0x73c/0xa3c [fsl) [<bf11bc68>] (fsl_udc_irq+0x0/0xa3c [fsl_usb2_udc]) from [<c004898c>] (handle_irq_event_percpu+0x38/0x19) [<c0048954>] (handle_irq_event_percpu+0x0/0x194) from [<c0048b18>] (handle_irq_event+0x30/0x40) [...] >>> dmesg snippets end here. -- Iulian Dogariu http://www.iuliandogariu.com/ GPG: 0xB364B5AE
Index: linux-3.3-rc6/drivers/usb/gadget/fsl_udc_core.c =================================================================== --- linux-3.3-rc6.orig/drivers/usb/gadget/fsl_udc_core.c 2012-03-08 14:03:27.000000000 +0200 +++ linux-3.3-rc6/drivers/usb/gadget/fsl_udc_core.c 2012-03-08 14:20:38.000000000 +0200 @@ -777,7 +777,7 @@ *length = min(req->req.length - req->req.actual, (unsigned)EP_MAX_LENGTH_TRANSFER); - dtd = dma_pool_alloc(udc_controller->td_pool, GFP_KERNEL, dma); + dtd = dma_pool_alloc(udc_controller->td_pool, GFP_ATOMIC, dma); if (dtd == NULL) return dtd;