hardware driver <-> gadget driver interaction (dwc otg, round 2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello people,

Meanwhile I've moved a bit further and now I have another. The listing below shows basically that dma_alloc_coherent() was called from irq context which is not a good thing to do IIRC. Here this happens because gadget driver (specifically, g_serial's composite_setup() function in this case) is called from irq context by dwc driver and then requests EP change which subsequently results in dma_alloc_coherent as implemented in dwc driver. (g_file_storage does not show this problem for some reason) So, supposedly something have to be moved out of irq context (scheduled). Now this is a bit too compicated for me to start from scratch, so question is, is there something I could use as a known-good reference example?

Thank you.
Nikolai


[   45.960000] BUG: scheduling while atomic: swapper/0/0x40010000
[   45.960000] Modules linked in: g_serial dwc_otg usbcore
[   45.960000]
[   45.960000] Pid: 0, comm:              swapper
[   45.960000] CPU: 0    Not tainted  (2.6.34-aml-z1 #24)
[   45.960000] PC is at default_idle+0x2c/0x30
[   45.960000] LR is at default_idle+0x28/0x30
[   45.960000] pc : [<80024a78>]    lr : [<80024a74>]    psr: 60000013
[   45.960000] sp : 803cbf90  ip : 803cbfa0  fp : 803cbf9c
[   45.960000] r10: 0000001f  r9 : 411fc091  r8 : 8001d28c
[   45.960000] r7 : 803cedd0  r6 : 803cedd8  r5 : 803f2264  r4 : 803ca000
[   45.960000] r3 : 00000000  r2 : 803cbf90  r1 : 803ca010  r0 : 803ca000
[ 45.960000] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
[   45.960000] Control: 10c53c7d  Table: 9ff24059  DAC: 00000017
[ 45.960000] [<800250f8>] (show_regs+0x0/0x50) from [<80038108>] (__schedule_bug+0x54/0x60)
[   45.960000]  r4:803cbf48 r3:60000193
[ 45.960000] [<800380b4>] (__schedule_bug+0x0/0x60) from [<802ea610>] (schedule+0x3d8/0x4a8)
[   45.960000]  r4:803d15f8 r3:40010000
[ 45.960000] [<802ea238>] (schedule+0x0/0x4a8) from [<8003a178>] (__cond_resched+0x28/0x38) [ 45.960000] [<8003a150>] (__cond_resched+0x0/0x38) from [<802ea7f0>] (_cond_resched+0x3c/0x44)
[   45.960000]  r4:80427748 r3:803ca000
[ 45.960000] [<802ea7b4>] (_cond_resched+0x0/0x44) from [<8008bd84>] (__alloc_pages_nodemask+0x118/0x5a8) [ 45.960000] [<8008bc6c>] (__alloc_pages_nodemask+0x0/0x5a8) from [<80029a48>] (__dma_alloc+0x90/0x32c) [ 45.960000] [<800299b8>] (__dma_alloc+0x0/0x32c) from [<80029d78>] (dma_alloc_coherent+0x60/0x68) [ 45.960000] [<80029d18>] (dma_alloc_coherent+0x0/0x68) from [<7f04c600>] (dwc_otg_ep_alloc_desc_chain+0x20/0x24 [dwc_otg])
[   45.960000]  r7:7f062df0 r6:9fc14000 r5:9fd444d0 r4:9fc14194
[ 45.960000] [<7f04c5e0>] (dwc_otg_ep_alloc_desc_chain+0x0/0x24 [dwc_otg]) from [<7f04d154>] (dwc_otg_pcd_ep_enable+0x12c/0x3ac [dwc_otg]) [ 45.960000] [<7f04d028>] (dwc_otg_pcd_ep_enable+0x0/0x3ac [dwc_otg]) from [<7f07f324>] (acm_set_alt+0x54/0x148 [g_serial])
[   45.960000]  r8:9fe282c0 r7:9fd444a8 r6:9fc14000 r5:9fe28440 r4:9fd4ad80
[ 45.960000] [<7f07f2d0>] (acm_set_alt+0x0/0x148 [g_serial]) from [<7f080950>] (composite_setup+0xd48/0xe8c [g_serial])
[   45.960000]  r5:9fe28440 r4:9fd4ad80
[ 45.960000] [<7f07fc08>] (composite_setup+0x0/0xe8c [g_serial]) from [<7f04f1c8>] (handle_ep0+0x828/0x17c8 [dwc_otg]) [ 45.960000] [<7f04e9a0>] (handle_ep0+0x0/0x17c8 [dwc_otg]) from [<7f05267c>] (dwc_otg_pcd_handle_out_ep_intr+0x24c/0x68c [dwc_otg]) [ 45.960000] [<7f052430>] (dwc_otg_pcd_handle_out_ep_intr+0x0/0x68c [dwc_otg]) from [<7f052bd0>] (dwc_otg_pcd_handle_intr+0x114/0x288 [dwc_otg]) [ 45.960000] [<7f052abc>] (dwc_otg_pcd_handle_intr+0x0/0x288 [dwc_otg]) from [<7f04ce28>] (dwc_otg_pcd_irq+0x14/0x20 [dwc_otg])
[   45.960000]  r8:8001d28c r7:0000001e r6:00000000 r5:00000000 r4:9fe28380
[   45.960000] r3:00000001
[ 45.960000] [<7f04ce14>] (dwc_otg_pcd_irq+0x0/0x20 [dwc_otg]) from [<80074ab4>] (handle_IRQ_event+0x58/0x120) [ 45.960000] [<80074a5c>] (handle_IRQ_event+0x0/0x120) from [<80076814>] (handle_level_irq+0x7c/0x10c)
--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux