Hi Felipe, I'm picking up a bug my coworker Rob touched on in this thread: https://marc.info/?l=linux-usb&m=155349928622570&w=2 We occasionally see the following dmesg when enabling mass storage mode: dwc3 dwc3.1.auto: failed to enable ep0out To reproduce after a clean boot: Enable mass storage mode Disable mass storage mode Enable mass storage mode I don't need to plug any devices, just switch modes. The error does not happen every boot. If I don't get the error on that second enable, then as far as I can tell I won't get the error at all during that boot. I've attached the trace and regdump. When capturing these I was running a 4.9.115 kernel and using the g_mass_storage driver for simplicity. Here is the shell session: root@gnarbox-2:~# echo device > /sys/class/usb_role/intel_xhci_usb_sw-role-switch/role && modprobe g_mass_storage file=/dev/nvme0n1p7 iSerialNumber=90405 [ 118.627628] Mass Storage Function, version: 2009/09/11 [ 118.633426] LUN: removable file: (no medium) [ 118.638283] LUN: file: /dev/nvme0n1p7 [ 118.642397] Number of LUNs=1 [ 118.646080] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11 [ 118.653902] g_mass_storage gadget: g_mass_storage ready root@gnarbox-2:~# modprobe -r g_mass_storage && echo host > /sys/class/usb_role/intel_xhci_usb_sw-role-switch/role root@gnarbox-2:~# echo device > /sys/class/usb_role/intel_xhci_usb_sw-role-switch/role && modprobe g_mass_storage file=/dev/nvme0n1p7 iSerialNumber=90405 [ 123.416789] Mass Storage Function, version: 2009/09/11 [ 123.422546] LUN: removable file: (no medium) [ 123.427386] LUN: file: /dev/nvme0n1p7 [ 123.431531] Number of LUNs=1 [ 123.435278] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11 [ 123.443168] g_mass_storage gadget: g_mass_storage ready [ 123.451998] dwc3 dwc3.1.auto: failed to enable ep0out root@gnarbox-2:~# I still get the error when using the gadget configfs instead of g_mass_storage. I still get the error on kernel 5.0.5. Do you have any idea what's happening here? What steps can I take to help debug this? Thanks, Evan
Attachment:
dwc3-trace-20190513.txz
Description: application/xz