Title: RE: [linux-usb-devel] More than one gadget card in a machine?

Hi Dave,

> -----Original Message-----
>
>
> And while you're mucking around in there, maybe you can find and fix
> that problem that crept in a while back which allows only one binding
> of a gadget driver to the chip ... it's no longer possible to rmmod
> one gadget driver and then modprobe an updated version (or a different
> version altogether).  I think the story is that one of those patches
> removed some essential chip reset; like maybe it enters a suspended
> state after the 'rmmod', but the 'modprobe' doesn't take it out of
> that state.
>

Dang, I owed you a patch about that.  Searching back, I recall that the situation was suspending a port from the host (and the gadget placing the NET2280 into low-power mode), then unloading the gadget driver.  Since the chip was suspended, the register write to disable the pull-ups never did anything to the USB state machine. 

In general, however, there should be no problems when simply plugging in, 'rmmod'ing g_foo, 'modprobe'ing g_bar.  It worked for me on a couple different hosts just now with a vanilla 2.6.9 net2280.c.

Regarding suspends: I think a while back I mentioned some cases where the device had trouble re-enumerating on a power-cycled host.  We've been investigating this here, but in the meantime I'd recommend that we not power down the net2280 if possible, as that will avoid this issue (it seems to involve weirdness happening on the wires during the last gasps of breath as a host powers down)  This also eliminates the "suspend->rmmod->modprobe->nothing" issue above.  If PLX comes up with a better fix I'll pass that along.

So, for your consideration, I have here a patch that creates a module parameter "enable_suspend".

When set to 1, the net2280, for better or worse, will enter low-power mode when the USB host requests it.  This is fine except in rare situations involving a power-cycling host or rmmoding the gadget while connected to a suspended port. 

When set to 0 (the default), the driver will report suspend requests to the upper-edge gadget, but will not place the NET2280 into low-power mode, working fine in all situations except bus-powered devices (for which a PCI+Linux-based NET2280 generally doesn't make much sense anyway)

It also (finally...) updates NetChip references to refer to PLX.

Thoughts?

Regards,
Alex

 

Attachment: net2280.c.050202.patch
Description: Binary data

Reply via email to