Re: [PATCH] USB:serial: fix deadlock caused by reseting device in .close

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

 



On Sat, 11 Apr 2009, Ming Lei wrote:

> Alan, I don't know why you does unbind a driver before resetting
> the device if the driver has not .pre_reset and .post_reset.
> Would  you mind giving a explanation?

If a driver doesn't have those methods then there's no way to tell it
when a device has been reset.  Since the driver won't work properly if
the device has been reset without its knowledge, the only alternative
is to unbind the driver.

In the case of garmin_gps, the best solution is to avoid resetting the 
device during garmin_close().  Instead, reset it as soon as the driver 
realizes it needs to be reset.  Or if that's not possible, at least 
avoid resetting the device until after serial->disc_mutex has been 
dropped.

There's also another bug: process_resetdev_request() doesn't call
usb_lock_device_for_reset() before calling usb_reset_device() (see the 
kerneldoc for usb_reset_device()).

Alan Stern

--
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