On Tue, 17 Feb 2015 15:58:30 -0500 (EST), Alan Stern wrote:
> On Tue, 17 Feb 2015, Jakub Kicinski wrote:
> > Hi,
> >
> > I have a usb network device where part of functionality is implemented
> > in firmware. To communicate with the firmware I need to submit bulk
> > URBs to one of the EPs. Unfortunately when device is being unbound or
> > the driver is removed from the kernel EPs are disabled before
> > .disconnect() is called and I cannot tell the firmware to bring the
> > device down. As a result the device sometimes locks up on rebind.
> >
> > I suspect this is not an uncommon problem. I tried usb_reset_device()
> > and it seems to help but not with all sorts of hangs. I don't have any
> > documentation of the device - only a half-broken vendor driver which
> > doesn't deal with this case.
> >
> > Is there a way to submit bulk URBs from .disconnect() callback?
> > Are there any best practices on how to deal with such hardware?
>
> The way to do this is to set the .soft_unbind member of the usb_driver
> structure to 1. That will prevent the endpoints from being disabled
> when the disconnect routine is called during unbinding.
Thanks a lot!
Looks like I should also set disable_hub_initiated_lpm to one, all USB
network devices do it after commit e1f12eb6 ("USB: Disable
hub-initiated LPM for comms devices.")...
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html