Hello! I'm using linux 2.6.31.6 on a Freescale i.MX27 (arm9) platform. For communication purposes the device uses the g_serial gadget to connect to a pc (running Windows XP, but with Linux on the other side the same problem occurs). I just patched u_serial.c with the patch found in http://marc.info/?l=linux-usb&m=126405382220848&w=2 There still exists another "BUG: scheduling while atomic" problem in the inter-operation between u_serial.c and fsl_udc_core.c. See the log below... The problem occurs just in rare conditions where dma_pool_alloc will call schedule_timeout whil beeing in an atomic situation. This might happen when the /dev/ttyGS0 device is opened. gs_open is atomic That's the call chain dma_pool_alloc is called from fsl_build_dtd(), called from fsl_req_to_dtd(), called from fsl_ep_queue(), called from gs_start_rx, called from gs_start_io(), called from gs_open() This bug can easily reproduced by connecting the board with a windows or linux host, opening the device on the host side and hold it open on the host side. On the board side just use this simple shell script to constantly open and close the device. This is needed as the bug is only triggered in the rare conditions where dma_pool_alloc has to sleep. Test script: #!/bin/sh while [ 1 ] ; do echo "Hello world" > /dev/ttyGS0 done This bug seems to be specific to the i.MX UDC driver in combination with g_serial. Can anyone give me a hint how to fix this bug? Sorry, I'm neither an expert in the gadget drivers nor in the UDC driver itself but will do my very best to fix this bug. I'm a little bit in a hurry as our customers just make some trouble :) I'm not shure if this is a bug in g_serial or in the udc driver. I would assume the udc driver should not schedule while calling fsl_ep_queue, right? Best regards, Ole Reinhardt Here is the log: BUG: scheduling while atomic: test.sh/1016/0x00000002 Modules linked in: g_serial [last unloaded: g_serial] [<c003e39c>] (unwind_backtrace+0x0/0xe8) from [<c03425f8>] (schedule +0x368/0x43) [<c03425f8>] (schedule+0x368/0x43c) from [<c0342dc8>] (schedule_timeout +0x118/0) [<c0342dc8>] (schedule_timeout+0x118/0x1a4) from [<c00be26c>] (dma_pool_alloc+0) [<c00be26c>] (dma_pool_alloc+0x1f4/0x2c4) from [<c025b770>] (fsl_req_to_dtd+0x3) [<c025b770>] (fsl_req_to_dtd+0x38/0x154) from [<c025be3c>] (fsl_ep_queue +0x13c/) [<c025be3c>] (fsl_ep_queue+0x13c/0x224) from [<bf01a458>] (gs_start_rx +0x98/0xf) [<bf01a458>] (gs_start_rx+0x98/0xf0 [g_serial]) from [<bf01b18c>] (gs_start_io+) [<bf01b18c>] (gs_start_io+0x74/0xbc [g_serial]) from [<bf01b8b4>] (gs_open+0x14) [<bf01b8b4>] (gs_open+0x140/0x2cc [g_serial]) from [<c01e17a8>] (tty_open+0x1ec) [<c01e17a8>] (tty_open+0x1ec/0x464) from [<c00c6728>] (chrdev_open +0x11c/0x214) [<c00c6728>] (chrdev_open+0x11c/0x214) from [<c00c10fc>] (__dentry_open +0xfc/0x) [<c00c10fc>] (__dentry_open+0xfc/0x2a8) from [<c00c227c>] (nameidata_to_filp+0x) [<c00c227c>] (nameidata_to_filp+0x58/0x60) from [<c00cf1e0>] (do_filp_open+0x1d) [<c00cf1e0>] (do_filp_open+0x1d0/0x844) from [<c00c0f4c>] (do_sys_open +0x5c/0xe) [<c00c0f4c>] (do_sys_open+0x5c/0xe4) from [<c0039960>] (ret_fast_syscall +0x0/0x) -- Thermotemp GmbH, Embedded-IT Embedded Hard-/ Software and Open Source Development, Integration and Consulting http://www.embedded-it.de Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen - tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97 Hauptsitz - Hademarscher Weg 7 - 13503 Berlin Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002 Geschäftsführer: Jörg Friedrichs, Ole Reinhardt Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html