Hi, "Howey, Dylan" <Dylan.Howey@xxxxxxxxxxxxx> writes: > Felipe, > > It's also happening in v4.14-rc7. Please make sure to also Cc: linux-usb@xxxxxxxxxxxxxxx and send plain-text emails, also avoid top-posting :-) > [ 59.716702] ------------[ cut here ]------------ > [ 59.721365] WARNING: CPU: 0 PID: 966 at drivers/usb/dwc3/gadget.c:2610 dwc3_stop_active_transfer.constprop.4+0xe8/0xec > [ 59.732038] Modules linked in: matrix_keypad > [ 59.736311] CPU: 0 PID: 966 Comm: irq/90-dwc3 Tainted: G W 4.14.0-rc7 #3 > [ 59.744124] Hardware name: Generic AM43 (Flattened Device Tree) > [ 59.750029] Backtrace: > [ 59.752494] [<c010b7e0>] (dump_backtrace) from [<c010bab4>] (show_stack+0x18/0x1c) > [ 59.760051] r7:00000009 r6:00000000 r5:c0889bd0 r4:00000000 > [ 59.765707] [<c010ba9c>] (show_stack) from [<c06a1e14>] (dump_stack+0x24/0x28) > [ 59.772926] [<c06a1df0>] (dump_stack) from [<c0128290>] (__warn+0xe8/0x100) > [ 59.779877] [<c01281a8>] (__warn) from [<c0128360>] (warn_slowpath_null+0x28/0x30) > [ 59.787433] r9:00000000 r8:a00e0093 r7:00000002 r6:00000003 r5:ee8b7810 r4:ee8bbf00 > [ 59.795166] [<c0128338>] (warn_slowpath_null) from [<c04c1c24>] (dwc3_stop_active_transfer.constprop.4+0xe8/0xec) > [ 59.805413] [<c04c1b3c>] (dwc3_stop_active_transfer.constprop.4) from [<c04c3264>] (__dwc3_gadget_ep_disable+0x24/0x110) > [ 59.816259] r6:ee8b7810 r5:ee8bbf34 r4:ee8bbf00 > [ 59.820871] [<c04c3240>] (__dwc3_gadget_ep_disable) from [<c04c371c>] (dwc3_gadget_ep_disable+0x30/0xac) > [ 59.830332] r7:00000002 r6:ee987638 r5:00000001 r4:200e0093 > [ 59.835993] [<c04c36ec>] (dwc3_gadget_ep_disable) from [<c04e3800>] (usb_ep_disable+0x30/0x3c) > [ 59.844585] r5:00000001 r4:ee8bbf00 > [ 59.848158] [<c04e37d0>] (usb_ep_disable) from [<c04eaa84>] (ffs_func_eps_disable+0x50/0x78) > [ 59.856576] r5:00000001 r4:ef0cfc80 > [ 59.860145] [<c04eaa34>] (ffs_func_eps_disable) from [<c04eab84>] (ffs_func_set_alt+0x90/0x290) > [ 59.868827] r9:5533194a r8:55332309 r7:ee98b254 r6:ffffffff r5:200e0093 r4:ee1f5e64 > [ 59.876556] [<c04eaaf4>] (ffs_func_set_alt) from [<c04ead9c>] (ffs_func_disable+0x18/0x1c) > [ 59.884805] r10:ee9f3d14 r9:5533194a r8:55332309 r7:ee98b254 r6:00000000 r5:200e0093 > [ 59.892615] r4:ee1f5e64 > [ 59.895145] [<c04ead84>] (ffs_func_disable) from [<c04dd44c>] (composite_disconnect+0x4c/0x94) okay, so you're using ffs. I see you're implementing your own HID gadget on top of FFS. Could it be you have a bug there? Why not use the in-tree HID function? Can you capture dwc3 logs? More details here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/driver-api/usb/dwc3.rst#n113 > [ 59.903742] [<c04dd400>] (composite_disconnect) from [<c04e30e4>] (usb_gadget_udc_reset+0x18/0x3c) > [ 59.912683] r7:55332509 r6:ee8b7810 r5:00000004 r4:ee8b7978 > [ 59.918334] [<c04e30cc>] (usb_gadget_udc_reset) from [<c04c15b8>] (dwc3_gadget_reset_interrupt+0x60/0x128) > [ 59.927966] r5:00000004 r4:ee8ba9d0 > [ 59.931535] [<c04c1558>] (dwc3_gadget_reset_interrupt) from [<c04c2c34>] (dwc3_thread_interrupt+0x3ac/0x830) > [ 59.941342] r7:55332509 r6:ee8b7810 r5:00000004 r4:ee8ba9d0 > [ 59.947002] [<c04c2888>] (dwc3_thread_interrupt) from [<c0156dcc>] (irq_thread_fn+0x24/0x5c) > [ 59.955424] r10:ee9f3d14 r9:c0a44a71 r8:c0156da8 r7:ef20f200 r6:00000001 r5:ef20f200 > [ 59.963234] r4:ee1fcec0 > [ 59.965764] [<c0156da8>] (irq_thread_fn) from [<c0157044>] (irq_thread+0x11c/0x19c) > [ 59.973404] r7:ef20f200 r6:00000001 r5:ee9a4000 r4:ee1fcec0 > [ 59.979067] [<c0156f28>] (irq_thread) from [<c0141dd4>] (kthread+0x128/0x158) > [ 59.986190] r9:ee1fce18 r8:c0156f28 r7:ee1fcec0 r6:ee1fce80 r5:00000000 r4:ee1fce00 > [ 59.993922] [<c0141cac>] (kthread) from [<c0107b70>] (ret_from_fork+0x14/0x24) > [ 60.001129] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0141cac > [ 60.008941] r4:ee1fce80 r3:ee9a4000 > [ 60.012505] ---[ end trace 5159dae85b75ffe4 ]--- > ________________________________ > From: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx> > Sent: Monday, October 30, 2017 3:59 AM > To: Howey, Dylan > Cc: Roger Quadros > Subject: Re: DWC3 Gadget backtrace > > > Hi, > > "Howey, Dylan" <Dylan.Howey@xxxxxxxxxxxxx> writes: >> Hello, >> >> I'm on an AM437x platform and I'm using FunctionFS to create a HID >> gadget. The device enumerates correctly when I plug it into a Linux >> host. If I unplug the cord and then plug it in again, I get a >> backtrace from dwc3, and the device fails to enumerate. >> >> I'm on ti-linux-4.9.y, but I see the same issue with 4.9.40 from >> kernel.org. >> >> Is this a known issue, and is there a workaround or a fix available? > > sorry, you need to ask help from TI. Either that, or test current > mainline (v4.14-rc7) and let me know if the same problem is there. > > BTW, latest v4.9 stable is v4.9.58, not v4.9.40. > > > Adding Roger Quadros here who works for TI and can, perhaps, point you > in the right direction. > > Best > >> [ 30.746934] ------------[ cut here ]------------ >> [ 30.751587] WARNING: CPU: 0 PID: 947 at drivers/usb/dwc3/gadget.c:2303 dwc3_stop_active_transfer.constprop.5+0xd4/0xd8 >> [ 30.762259] Modules linked in: matrix_keypad >> [ 30.766539] CPU: 0 PID: 947 Comm: irq/90-dwc3 Not tainted 4.9.40-02118-gde0a93a #4 >> [ 30.774092] Hardware name: Generic AM43 (Flattened Device Tree) >> [ 30.779996] Backtrace: >> [ 30.782465] [<c010b34c>] (dump_backtrace) from [<c010b5fc>] (show_stack+0x18/0x1c) >> [ 30.790020] r7:00000009 r6:00000000 r5:c0899298 r4:00000000 >> [ 30.795679] [<c010b5e4>] (show_stack) from [<c0347218>] (dump_stack+0x24/0x28) >> [ 30.802903] [<c03471f4>] (dump_stack) from [<c012a8cc>] (__warn+0xe8/0x100) >> [ 30.809857] [<c012a7e4>] (__warn) from [<c012a99c>] (warn_slowpath_null+0x28/0x30) >> [ 30.817413] r9:55332309 r8:a0000093 r7:00000000 r6:ee82a010 r5:00000003 r4:ee82c900 >> [ 30.825147] [<c012a974>] (warn_slowpath_null) from [<c04b3ff0>] (dwc3_stop_active_transfer.constprop.5+0xd4/0xd8) >> [ 30.835393] [<c04b3f1c>] (dwc3_stop_active_transfer.constprop.5) from [<c04b47a0>] (dwc3_remove_requests+0x1c/0x98) >> [ 30.845805] r6:ee82a010 r5:ee82c934 r4:ee82c900 >> [ 30.850415] [<c04b4784>] (dwc3_remove_requests) from [<c04b566c>] (__dwc3_gadget_ep_disable+0x38/0xdc) >> [ 30.859700] r5:ee9b13f8 r4:ee82c900 >> [ 30.863271] [<c04b5634>] (__dwc3_gadget_ep_disable) from [<c04b5740>] (dwc3_gadget_ep_disable+0x30/0xac) >> [ 30.872731] r7:00000000 r6:00000002 r5:ee9b13f8 r4:20000093 >> [ 30.878387] [<c04b5710>] (dwc3_gadget_ep_disable) from [<c04d648c>] (usb_ep_disable+0x30/0x3c) >> [ 30.886979] r5:ee9b13f8 r4:ee82c900 >> [ 30.890557] [<c04d645c>] (usb_ep_disable) from [<c04dd928>] (ffs_func_eps_disable+0x40/0x64) >> [ 30.898975] r5:ee9b13f8 r4:ee7c8280 >> [ 30.902547] [<c04dd8e8>] (ffs_func_eps_disable) from [<c04dda28>] (ffs_func_set_alt+0x90/0x288) >> [ 30.911229] r9:55332309 r8:55332509 r7:ee018e54 r6:00000000 r5:ffffffff r4:ee0271a4 >> [ 30.918960] [<c04dd998>] (ffs_func_set_alt) from [<c04ddc38>] (ffs_func_disable+0x18/0x1c) >> [ 30.927211] r10:55331839 r9:55332309 r8:55332509 r7:ee018e54 r6:00000000 r5:20000093 >> [ 30.935021] r4:ee0271a4 >> [ 30.937562] [<c04ddc20>] (ffs_func_disable) from [<c04d03e8>] (composite_disconnect+0x4c/0x94) >> [ 30.946160] [<c04d039c>] (composite_disconnect) from [<c04d5dc4>] (usb_gadget_udc_reset+0x18/0x3c) >> [ 30.955101] r7:ee82cd80 r6:ee82a010 r5:00000004 r4:ee82a160 >> [ 30.960752] [<c04d5dac>] (usb_gadget_udc_reset) from [<c04b487c>] (dwc3_gadget_reset_interrupt+0x60/0x1d0) >> [ 30.970383] r5:00000004 r4:ee8251d0 >> [ 30.973953] [<c04b481c>] (dwc3_gadget_reset_interrupt) from [<c04b4c0c>] (dwc3_thread_interrupt+0x220/0xaa8) >> [ 30.983759] r7:ee82cd80 r6:ee82a010 r5:00000004 r4:ee8251d0 >> [ 30.989421] [<c04b49ec>] (dwc3_thread_interrupt) from [<c0157ed0>] (irq_thread_fn+0x24/0x5c) >> [ 30.997843] r10:00000000 r9:c0b15fe4 r8:c0157eac r7:ee82cd80 r6:00000001 r5:ee82cd80 >> [ 31.005654] r4:ee00be40 >> [ 31.008185] [<c0157eac>] (irq_thread_fn) from [<c0158148>] (irq_thread+0x11c/0x19c) >> [ 31.015825] r7:ee82cd80 r6:00000001 r5:ee4b4000 r4:ee00be40 >> [ 31.021478] [<c015802c>] (irq_thread) from [<c01441b4>] (kthread+0xfc/0x114) >> [ 31.028514] r9:00000000 r8:00000000 r7:c015802c r6:ee00be40 r5:ee00be00 r4:00000000 >> [ 31.036246] [<c01440b8>] (kthread) from [<c0107918>] (ret_from_fork+0x14/0x3c) >> [ 31.043452] r7:00000000 r6:00000000 r5:c01440b8 r4:ee00be00 >> [ 31.049096] ---[ end trace 612f02bb50d0379b ]--- > > -- > balbi -- balbi
Attachment:
signature.asc
Description: PGP signature