Re: [PATCH] usb-serial: fix crash when sub-driver updates firmware

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

 



On Wed, 2009-05-27 at 11:25 -0400, Alan Stern wrote:
> This patch (as1244) fixes a crash in usb-serial that occurs when a
> sub-driver returns a positive value from its attach method, indicating
> that new firmware was loaded and the device will disconnect and
> reconnect.  The usb-serial core then skips the step of registering the
> port devices; when the disconnect occurs, the attempt to unregister
> the ports fails dramatically.

Greg, dramatically means Oops btw :-)

It could be some changes in the device layer that made it choke on
those device_del calls to a NULLed out struct device while it may
not have before. I think the bug started in 2.6.29. I jumped straight
from .28 to .30-rc on the machine that I use the keyspan on when I
noticed it, then quickly try a .29 built I had around and off the top of
my mind, it happened there too.

Cheers,
Ben.

> This problem shows up with Keyspan devices and it might affect others
> as well.
> 
> When the attach method returns a positive value, the patch sets
> num_ports to 0.  This tells usb_serial_disconnect() not to try
> unregistering any of the ports; instead they are cleaned up by
> destroy_serial().
> 
> Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> Tested-by: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
> 
> ---
> 
> It looks like this problem has existed ever since the serial bus was
> introduced.  I don't know nobody complained about it until now.  It 
> isn't related to the other usb-serial changes made recently.
> 
> Alan Stern
> 
> 
> Index: usb-2.6/drivers/usb/serial/usb-serial.c
> ===================================================================
> --- usb-2.6.orig/drivers/usb/serial/usb-serial.c
> +++ usb-2.6/drivers/usb/serial/usb-serial.c
> @@ -974,6 +974,7 @@ int usb_serial_probe(struct usb_interfac
>  		if (retval > 0) {
>  			/* quietly accept this device, but don't bind to a
>  			   serial port as it's about to disappear */
> +			serial->num_ports = 0;
>  			goto exit;
>  		}
>  	}

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux