linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG REPORT] usb: dwc3: "failed to enable ep0out" when enabling mass storage mode
@ 2019-05-13 22:25 evan
  2019-05-14  8:18 ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: evan @ 2019-05-13 22:25 UTC (permalink / raw)
  To: felipe.balbi; +Cc: linux-usb, rob

[-- Attachment #1: Type: text/plain, Size: 2121 bytes --]

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 #2: dwc3-trace-20190513.txz --]
[-- Type: application/x-xz, Size: 5372 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-14 23:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-13 22:25 [BUG REPORT] usb: dwc3: "failed to enable ep0out" when enabling mass storage mode evan
2019-05-14  8:18 ` Felipe Balbi
2019-05-14 23:07   ` evan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).