Re: [RFC][PATCH] USB: fix usb_remove_store

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

 



2010/5/14 Greg KH <greg@xxxxxxxxx>:
> On Fri, May 14, 2010 at 09:44:52PM +0800, tom.leiming@xxxxxxxxx wrote:
>> From: Ming Lei <tom.leiming@xxxxxxxxx>
>>
>> For root-hub devices, we don't support the 'remove' action,
>> but deconfiguration may cause root-hub to stop work even
>> usb_remove_device returns failure.
>>
>> Considered it is very similar to remove a usb device by
>> usb_remove_device only, compared with physical disconnection processing.
>>
>> There are no races conditions found if only usb_remove_device is
>> called to do 'remove' action without deconfiguration, so remove
>> the deconfiguration to fix it.
>>
>> Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx>
>
> Have you had problems with the root hub being disabled?  Why would this

Once you call 'echo 1 > /sys/bus/usb/devices/usbN/remove', the root-hub
(usbN) will not detect any devices connected into the hub any longer but
failure is returned for the 'echo 1 > remove' command.

> cause them to stop working?  What tool is trying to remove a root hub?

The reason is that usb_set_configuration(udev, -1) is called before
usb_remove_device even though usb_remove_device doesn't support
remove  of root-hub.

> Why not just fix that tool?

As far as kernel is concerned, we should provide a safe interface to user,
and must prevent a disaster from happening even a mistaken command is
sent to kernel,  shouldn't we?

thanks,
-- 
Lei Ming
--
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