On Wed, 18 Jul 2012, Oliver Neukum wrote:

> On Tuesday 17 July 2012 15:00:08 Alan Stern wrote:
> 
> > Furthermore, what happens if you power down a port when the attached 
> > device is active (not suspended)?  Again it will look like a physical 
> > disconnect.  So again, you don't want to power off such ports -- even 
> > though they don't have remote wakeup enabled.
> > 
> > I guess this comes down to deciding how much power you want to give the 
> > user.  Are you saying that the user should be prevented from powering 
> > down a port unless:
> > 
> >     there is no device attached, or
> > 
> >     the attached device is suspended with wakeup disabled?
> > 
> > But the justification seems weak.  If powering down a port looks 
> > exactly like a disconnect, then you should allow powering down to the 
> > same extent that you allow disconnects.  Last time I checked, the 
> > kernel did not try to prevent users from unplugging their USB devices.  
> 
> But it does not claim that a device is still present after that. An attempt
> to use it returns an error.

Any attempt to use a suspended device will return an error, whether the
port is powered off or not.  The driver has to resume the device before
using it, and Sarah is proposing that this should cause the port to
power back on.

An alternative to her suggestion would be to disconnect the device when 
the port goes off.  When the port is powered back on, the device will 
be rediscovered and probed again.  This relies on userspace doing the 
work instead of the kernel making everything happen automatically.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to