Re: Restart power on USB bus/host controller?

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

 



On Fri, 6 Feb 2009, Toan Pham wrote:

> Hi,
> 
> I would like to know if it is possible to tell the USBcore/HCD to
> restart/reinitialize power to the
> USB bus and force redetection of all devices as if the machine has
> just booted up?
> 
> Sometimes, my usb devices or hubs get into a start that it can not
> communicate with the
> computer at all.  Disconnecting the usb cable and/or power to the
> powered usb hub solve
> the problem.  I would like to know if I can so it by software,
> controller the driver to issue
> a restart on all devices.  Thank you.

As Greg mentioned, the USB hardware found on most desktop and laptop 
computers is not capable of turning off power to the USB bus.

However it _is_ possible to reinitialize a USB bus and force 
redetection of devices on it.  For example, to reinitialize bus 2:

	cd /sys/class/usb_host/usb_host2/device/driver
	ls

On my system this produces output something like this:

	0000:00:0f.3  bind  module  new_id  uevent  unbind

You'll have to figure out which name in that listing is the USB 
controller device.  It's usually pretty easy to recognize; here it's 
the first one: 0000:00:0f.3.

Next you write that device name to the unbind file and the bind file, 
using "echo -n":

	echo -n 0000:00:0f.3 >unbind
	# Wait a few seconds for the unbind to finish
	echo -n 0000:00:0f.3 >bind

That will do everything you asked for short of removing power from the
bus.

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