* USB Hub Port Power Control and Hotplug Events
@ 2006-08-10 23:21 Andy Dalton
2006-08-11 7:39 ` Guennadi Liakhovetski
2006-08-11 8:37 ` Greg KH
0 siblings, 2 replies; 3+ messages in thread
From: Andy Dalton @ 2006-08-10 23:21 UTC (permalink / raw)
To: linux-hotplug
Greetings,
Please forgive me if this question has been addressed before -- I'm
new to the list and I wasn't able to find anything related to this
problem in the archives.
I'm writing some software that will, among other things, control the
port power on a USB hub to allow for the powering on and off of
attached devices (this is currently an expansion of hub-ctrl-2.c found
at http://www.gniibe.org/log/2006/01/14 and using a Targus, Inc.'s
PAUH212 hub). I also want to keep this application aware of any
hardware changes that occur while the application is running (e.g.
new USB devices added, existing USB devices removed) and have been
exploring using udev/hotplug for this.
While experimenting, I noticed something a bit strange. If I power
down a port on the USB hub, then later power it back on, I do *not*
get a hotplug removal event on power off, but I *do* get an insertion
event on power on.
Initially I didn't think much of this; however, it gets a bit more
ugly if I do actually unplug the device while the port power is off.
Even if I eventually turn the port power back on, the system still
thinks the device is attached (i.e. it still shows up in
/proc/bus/usb/devices). If I then plug this same device into a
different port, I get two entries in /proc/bus/usb/devices for the
same device. I have to physically unplug the hub and re-plug it to
get the correct state.
Should the system not view the powering off of a USB port as a removal
of the device attached to that port, and cleanup appropriately?
I'm running the following configuration:
kernel: 2.6.17-gentoo-r4
udev: 087
hotplug: 20040401
If I can provide you with any additional information, please let me
know. Thank you for your time and assistance.
Andy Dalton
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: USB Hub Port Power Control and Hotplug Events
2006-08-10 23:21 USB Hub Port Power Control and Hotplug Events Andy Dalton
@ 2006-08-11 7:39 ` Guennadi Liakhovetski
2006-08-11 8:37 ` Greg KH
1 sibling, 0 replies; 3+ messages in thread
From: Guennadi Liakhovetski @ 2006-08-11 7:39 UTC (permalink / raw)
To: linux-hotplug
On Thu, 10 Aug 2006, Andy Dalton wrote:
> While experimenting, I noticed something a bit strange. If I power
> down a port on the USB hub, then later power it back on, I do *not*
> get a hotplug removal event on power off, but I *do* get an insertion
> event on power on.
It has been discussed on the USB-devel list. The thing is - the hub
doesn't report a "port status change" on "port power off". It's on power
on it first reports a "disconnect" and then immediately a "new device".
And the system cannot really simulate this event for you because the "port
power off" command can come from various places - kernel drivers, user
space. So, your only option seems to be to use the fact that it's you who
issues the command, so, you know that the device is gone. Just use this
knowledge.
Not sure, but I don't think you can tell the kernel that the device is
gone...
Thanks
Guennadi
---------------------------------
Guennadi Liakhovetski, Ph.D.
DSA Daten- und Systemtechnik GmbH
Pascalstr. 28
D-52076 Aachen
Germany
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: USB Hub Port Power Control and Hotplug Events
2006-08-10 23:21 USB Hub Port Power Control and Hotplug Events Andy Dalton
2006-08-11 7:39 ` Guennadi Liakhovetski
@ 2006-08-11 8:37 ` Greg KH
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2006-08-11 8:37 UTC (permalink / raw)
To: linux-hotplug
On Fri, Aug 11, 2006 at 09:39:47AM +0200, Guennadi Liakhovetski wrote:
> On Thu, 10 Aug 2006, Andy Dalton wrote:
>
> > While experimenting, I noticed something a bit strange. If I power
> > down a port on the USB hub, then later power it back on, I do *not*
> > get a hotplug removal event on power off, but I *do* get an insertion
> > event on power on.
>
> It has been discussed on the USB-devel list. The thing is - the hub
> doesn't report a "port status change" on "port power off". It's on power
> on it first reports a "disconnect" and then immediately a "new device".
> And the system cannot really simulate this event for you because the "port
> power off" command can come from various places - kernel drivers, user
> space. So, your only option seems to be to use the fact that it's you who
> issues the command, so, you know that the device is gone. Just use this
> knowledge.
>
> Not sure, but I don't think you can tell the kernel that the device is
> gone...
No, the USB stack does not allow you to do this at this point in time,
sorry.
You can unbind a device from a driver though, that would prevent it from
being used by any userspace programs.
thanks,
greg k-h
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-08-11 8:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-10 23:21 USB Hub Port Power Control and Hotplug Events Andy Dalton
2006-08-11 7:39 ` Guennadi Liakhovetski
2006-08-11 8:37 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).