Google
  Web www.spinics.net

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

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


On Mon, 19 Nov 2007, David Brownell wrote:

> From: Patrik Sevallius <patrik.sevallius@xxxxxxxx>
> 
> I'm having problem with oopses when rebooting, if I modprobe g_serial
> and rmmod g_serial and do a reboot I get an oops in device_shutdown().
> The reason seems to be that usb_gadget_unregister_driver() doesn't do
> enough cleanup.  With this at91_udc patch I don't get the oops.
> 
> Signed-off-by: Patrik Sevallius <patrik.sevallius@xxxxxxxx>
> [ Same bug was in some other peripheral controller drivers; fixed. ]
> Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>

> --- at91.orig/drivers/usb/gadget/dummy_hcd.c	2007-11-19 12:33:33.000000000 -0800
> +++ at91/drivers/usb/gadget/dummy_hcd.c	2007-11-19 12:36:05.000000000 -0800
> @@ -830,6 +830,7 @@ usb_gadget_unregister_driver (struct usb
>  	spin_unlock_irqrestore (&dum->lock, flags);
>  
>  	driver->unbind (&dum->gadget);
> +	dum->gadget.dev.driver = NULL;
>  	dum->driver = NULL;
>  
>  	device_release_driver (&dum->gadget.dev);

Arghh, no!  Setting dum->gadget.dev.driver to NULL will break the call 
to device_release_driver() just below.

net2280 and dummy_hcd are different from the other device controllers 
in that they register the gadget driver with the driver core.  Hence 
they don't need this extra action when unregistering a gadget driver.

Alan Stern


-------------------------------------------------------------------------
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/
_______________________________________________
linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

[Home]     [Video for Linux]     [Photo]     [Yosemite Forum]     [Yosemite Photos]    [Video Projectors]     [PDAs]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [Free Dating]

  Powered by Linux