Re: [patch 2.6.24-rc3] usb peripheral controller driver oops avoidance

Greg KH <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Mon, Nov 19, 2007 at 10:53:17PM -0500, Alan Stern wrote:
> On Mon, 19 Nov 2007, David Brownell wrote:
> 
> > On Monday 19 November 2007, David Brownell wrote:
> > > OK, I'll take the dummy_hcd bit out -- but add a comment to
> > > highlight this unique behavior.
> > 
> > Currently expecting:
> > 
> > --- at91.orig/drivers/usb/gadget/dummy_hcd.c	2007-11-19 13:58:57.000000000 -0800
> > +++ at91/drivers/usb/gadget/dummy_hcd.c	2007-11-19 13:58:55.000000000 -0800
> > @@ -779,6 +779,13 @@ usb_gadget_register_driver (struct usb_g
> >  	if ((retval = driver->bind (&dum->gadget)) != 0)
> >  		goto err_bind_gadget;
> >  
> > +	/* NOTE:  most peripheral controller drivers won't bother
> > +	 * registering the gadget drivers, since doing that requires
> > +	 * that the driver be associated with a bus.  There's really
> > +	 * no existing bus that's appropriate for a gadget driver,
> > +	 * and little point in defining a "bus" that must never have
> > +	 * more than one device.
> > +	 */
> >  	driver->driver.bus = dum->gadget.dev.parent->bus;
> >  	if ((retval = driver_register (&driver->driver)) != 0)
> >  		goto err_register;
> 
> Now that I look back on it, it's not so clear that the scheme used by
> dummy_hcd is really correct.  It registers a driver structure on the
> platform bus but embeds it inside a usb_gadget_driver instead of a
> platform_driver.  This sounds like a bug waiting to happen.
> 
> Maybe it would be better to change dummy_hcd to make it work like the
> other device controller drivers.  There seems to be no advantage to
> registering the gadget driver in sysfs (and some disadvantage in that
> the Gadget API doesn't match up well with normal bus-oriented probe and
> remove methods).
> 
> Greg, do you agree with that last sentence?

No, all "drivers" should show up in sysfs somewhere, right?  Otherwise
userspace doesn't know anything about them...

I'm slowly working toward allowing multiple devices to bind to the same
'driver', so David's original objection should be taken care of soon.
All the kset/ktype rework was because of this...

thanks,

greg k-h

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.