> First of all, at91_udc activates the pullup in ..._register_driver(), so
> even if I don't load any gadget module, the host starts enumeration.

I don't follow.  If you (successfully) register a gadget driver
and don't usb_gadget_disconnect() in the gadget driver bind()
method, it's *required* to be ready to enumerate.  What's the
problem here?  There's no "load" operation, so maybe you're
wrongly thinking that register() isn't the last step before
the host may enumerate...


> Obviously no device will be detected.

No, not "obviously".  You registered the gadget driver and didn't
disable the pullup in bind(), so it's required to be ready to
respond to the host ... and thus be detected/enumerated.

This is why for example gadgetfs probes a fake gadget driver that
fails bind() in order to get the controller driver name ("at91_udc")
to export to userspace ... but won't register the real driver until
userspace has not just opened /dev/gadget/at91_udc, but has also
configured it (descriptors etc).



>               I've looked at other drivers and
> omap_udc for example checks if there's a driver loaded before enabling
> the pullup on VBUS change. The same could be done with at91_udc. I'd be
> happy to provide a patch, after I'll have tested it thoroughly, but I'd
> like to know first if such change won't break some expected behaviour.

Please explain the problem you're seeing ...  once you register the
gadget driver (there's no notion of "loaded"), software control over
the pullup is active, and will default to "peripheral responds to host".
Last I checked, that was also true of omap_udc, though the details are
clearly different.


> The second problem is related with the previous one and gadgetfs. 
> handle_setup() in at91_udc.c calls udc->driver->setup() without checking
> if udc->driver is not NULL.

What's the mechanism whereby there's no gadget driver registered
(NULL) and yet the controller driver is allowing enumeration?
Such bugs should be gone now, though maybe some hardware config
options are at fault.

If this problem still appears with the current (2.6.18-rc6+) code,
please submit a patch against that version.  There were bugfixes
to that code earlier in the 2.6.18 series.

- Dave


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to