gadget: should usb_ep_enable() clear EP STALL?

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

 



Hi,

I'm testing dwc3 with g_zero and noticed that errors
seem to stick even after SET_CONFIGURATION/SET_INTERFACE.

In f_sourcesink.c, check_read_data() calls usb_ep_set_halt()
if the data does not match the expected values, and
sourcesink_set_alt() indirectly calls usb_ep_disable()
and usb_ep_enable().

Now, include/linux/usb/gadget.h comments for usb_ep_enable()
are not 100% clear wrt STALL, except "making it usable"
sounds like it should clear it.  However, usb_ep_set_halt()
comments states:

 * Note that while an endpoint CLEAR_FEATURE will be invisible to the
 * gadget driver, a SET_INTERFACE will not be.  To reset endpoints for the
 * current altsetting, see usb_ep_clear_halt().  When switching altsettings,
 * it's simplest to use usb_ep_enable() or usb_ep_disable() for the endpoints.

That suggests to me that sourcesink_set_alt() is correct to
simply call usb_ep_enable(), i.e. no explicit usb_ep_clear_halt()
is needed?  If so it would mean dwc3 ep_enable() is buggy.


Thanks,
Johannes
--
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