Google
  Web www.spinics.net

Re: hub port power control vs. physical disconnect/connect

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


On Dec 12, 2007 6:15 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, 12 Dec 2007, Vlado Handziski wrote:
>
>
> > On Dec 12, 2007 4:20 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > > The USB stack doesn't remove a device until it gets a disconnect
> > > message from the device's hub.  When you turn off the port power the
> > > hub doesn't send any disconnect messages, so the kernel doesn't realize
> > > the device is gone.
> > >
> > > Currently there is no way for you to force this behavior (and there is
> > > no way to call usb_disconnect from userspace).  You can come close by
> > > unbinding the device's driver.  For example, if the device's sysfs ID
> > > was 1-2.3 you would do:
> > >
> > >        echo -n 1-2.3 >/sys/bus/usb/drivers/usb/unbind
> > >
> > > That won't remove the device structure but it will make the structure
> > > almost unusable.
> > >
> >
> > Yes, we are already doing that (as shown in case 2 in the log at the end of
> > the original message). I was hoping that there is something more that can be
> > done that would either remove the device completely or at least export
> > somehow the info to sysfs that the structure below this devce path is stale.
>
> Right now there isn't anything like that.  It could be added if people
> really want it.

We can track this using internal state. It is not "pretty", but allows
us to work around it. I guess the HAL guys in KDE/GNOME must be doing
something similar, assuming they support hub port power control at
all...

Vlado

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

[Home]     [Video for Linux]     [Photo]     [Yosemite Forum]     [Yosemite Photos]    [Video Projectors]     [PDAs]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [Free Dating]

  Powered by Linux