* Re: [linux-usb-devel] Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 14:58 ` Alan Stern
@ 2006-06-01 16:43 ` Greg KH
2006-06-02 0:03 ` David Liontooth
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2006-06-01 16:43 UTC (permalink / raw)
To: Alan Stern; +Cc: Andrew Morton, David Liontooth, linux-kernel, linux-usb-devel
On Thu, Jun 01, 2006 at 10:58:43AM -0400, Alan Stern wrote:
> On Thu, 1 Jun 2006, Andrew Morton wrote:
>
> > On Thu, 01 Jun 2006 02:18:20 -0700
> > David Liontooth <liontooth@cogweb.net> wrote:
> >
> > > Starting with 2.6.16, some USB devices fail unnecessarily on unpowered
> > > hubs. Alan Stern explains,
> > >
> > > "The idea is that the kernel now keeps track of USB power budgets. When a
> > > bus-powered device requires more current than its upstream hub is capable
> > > of providing, the kernel will not configure it.
> > >
> > > Computers' USB ports are capable of providing a full 500 mA, so devices
> > > plugged directly into the computer will work okay. However unpowered hubs
> > > can provide only 100 mA to each port. Some devices require (or claim they
> > > require) more current than that. As a result, they don't get configured
> > > when plugged into an unpowered hub."
> > >
> > > http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg43480.html
> > >
> > > This is generating a lot of grief and appears to be unnecessarily
> > > strict. Common USB sticks with a MaxPower value just above 100mA, for
> > > instance, typically work fine on unpowered hubs supplying 100mA.
> > >
> > > Is a more user-friendly solution possible? Could the shortfall
> > > information be passed to udev, which would allow rules to be written per
> > > device?
>
> I'm not sure whether we create a udev event when a new USB device is
> connected.
Yes we do. It's of the class "usb_device" and you can write a single
udev rule to override the power test if you really want to.
Of course I don't recommend someone doing this, as it is violating the
USB power rules, and it is a good thing that we are finally testing for
them.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
[not found] ` <6iX82-2UJ-3@gated-at.bofh.it>
@ 2006-06-01 23:35 ` Robert Hancock
2006-06-01 23:46 ` Randy.Dunlap
0 siblings, 1 reply; 5+ messages in thread
From: Robert Hancock @ 2006-06-01 23:35 UTC (permalink / raw)
To: linux-kernel
linux-os (Dick Johnson) wrote:
> Many, most, perhaps all such devices don't take more power when they
> are "enabled". Everything is already running and sucking up maximum
> current when you plug it in! If the motherboard didn't smoke when
> the device was plugged in, you might just as well let the user use
> it! Perhaps a ** WARNING ** message somewhere, but by golly, they
> got it running or else you wouldn't be able to read its parameters.
Wrong.. USB devices are not allowed to draw more than some amount (100
mA I think) of power before the host tells it that it is allowed to
switch into full-power mode. Any device that doesn't do this doesn't
comply with the USB specs. Therefore it is very possible to connect a
device and discover that it can't be enabled.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 23:35 ` USB devices fail unnecessarily on unpowered hubs Robert Hancock
@ 2006-06-01 23:46 ` Randy.Dunlap
0 siblings, 0 replies; 5+ messages in thread
From: Randy.Dunlap @ 2006-06-01 23:46 UTC (permalink / raw)
To: Robert Hancock; +Cc: linux-kernel
On Thu, 01 Jun 2006 17:35:22 -0600 Robert Hancock wrote:
> linux-os (Dick Johnson) wrote:
> > Many, most, perhaps all such devices don't take more power when they
> > are "enabled". Everything is already running and sucking up maximum
> > current when you plug it in! If the motherboard didn't smoke when
> > the device was plugged in, you might just as well let the user use
> > it! Perhaps a ** WARNING ** message somewhere, but by golly, they
> > got it running or else you wouldn't be able to read its parameters.
>
> Wrong.. USB devices are not allowed to draw more than some amount (100
> mA I think) of power before the host tells it that it is allowed to
> switch into full-power mode. Any device that doesn't do this doesn't
> comply with the USB specs. Therefore it is very possible to connect a
> device and discover that it can't be enabled.
so does Thunderbird on Windows have absolutely no Reply-to-All
and no References or In-Reply-To capabilities?
---
~Randy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-usb-devel] Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 16:43 ` [linux-usb-devel] " Greg KH
@ 2006-06-02 0:03 ` David Liontooth
0 siblings, 0 replies; 5+ messages in thread
From: David Liontooth @ 2006-06-02 0:03 UTC (permalink / raw)
To: Greg KH; +Cc: Alan Stern, Andrew Morton, linux-kernel, linux-usb-devel
Greg KH wrote:
> On Thu, Jun 01, 2006 at 10:58:43AM -0400, Alan Stern wrote:
>
>> On Thu, 1 Jun 2006, Andrew Morton wrote:
>>
>>
>>> On Thu, 01 Jun 2006 02:18:20 -0700
>>> David Liontooth <liontooth@cogweb.net> wrote:
>>>
>>>
>>>> Starting with 2.6.16, some USB devices fail unnecessarily on unpowered
>>>> hubs. Alan Stern explains,
>>>>
>>>> "The idea is that the kernel now keeps track of USB power budgets. When a
>>>> bus-powered device requires more current than its upstream hub is capable
>>>> of providing, the kernel will not configure it.
>>>>
>>>> Computers' USB ports are capable of providing a full 500 mA, so devices
>>>> plugged directly into the computer will work okay. However unpowered hubs
>>>> can provide only 100 mA to each port. Some devices require (or claim they
>>>> require) more current than that. As a result, they don't get configured
>>>> when plugged into an unpowered hub."
>>>>
>>>> http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg43480.html
>>>>
>>>> This is generating a lot of grief and appears to be unnecessarily
>>>> strict. Common USB sticks with a MaxPower value just above 100mA, for
>>>> instance, typically work fine on unpowered hubs supplying 100mA.
>>>>
>>>> Is a more user-friendly solution possible? Could the shortfall
>>>> information be passed to udev, which would allow rules to be written per
>>>> device?
>>>>
>> I'm not sure whether we create a udev event when a new USB device is
>> connected.
>>
> Yes we do. It's of the class "usb_device" and you can write a single
> udev rule to override the power test if you really want to.
>
> Of course I don't recommend someone doing this, as it is violating the
> USB power rules, and it is a good thing that we are finally testing for
> them.
>
It's clearly a good thing to be testing for this. As Alan points out,
100mA is the maximum permitted pre-configuration draw, so what a device
draws when plugged in is not informative.
However, obeying the USB power rules is not an end in itself -- the
relevant question is the minimum power the device requires to operate
correctly and without damage.
The MaxPower value does not appear to be a reliable index of this. My
USB stick has a MaxPower value of 178mA and works flawlessly off an
unpowered hub. Unfortunately devices don't seem to tell us what their
minimum power requirements are, so we need more flexibility in writing
rules for this.
udev could surely pick up on the MaxPower value and tolerate up to a
100% underrun on USB flash drives. That would likely still 90% of the
pain right there, maybe all of it.
What are the reasons not to do this? What happens if a USB stick is
underpowered to one unit? Nothing? Slower transmission? Data loss? Flash
memory destruction? If it's just speed, it's a price well worth paying.
This is a great opportunity for a small exercise in empathy, utilizing
that little long-neglected mirror neuron. Thousands of USB sticks
inexplicably go dead in people's familiar hubs on keyboards and desks;
Linux kernel coders dream sweet dreams of not violating USB power rules.
I appreciate Andrew's support for a real-worldly solution.
Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-usb-devel] Re: USB devices fail unnecessarily on unpowered hubs
[not found] ` <6j5oR-7Sw-11@gated-at.bofh.it>
@ 2006-06-02 2:39 ` Robert Hancock
0 siblings, 0 replies; 5+ messages in thread
From: Robert Hancock @ 2006-06-02 2:39 UTC (permalink / raw)
To: linux-kernel; +Cc: David Liontooth
David Liontooth wrote:
> It's clearly a good thing to be testing for this. As Alan points out,
> 100mA is the maximum permitted pre-configuration draw, so what a device
> draws when plugged in is not informative.
>
> However, obeying the USB power rules is not an end in itself -- the
> relevant question is the minimum power the device requires to operate
> correctly and without damage.
>
> The MaxPower value does not appear to be a reliable index of this. My
> USB stick has a MaxPower value of 178mA and works flawlessly off an
> unpowered hub. Unfortunately devices don't seem to tell us what their
> minimum power requirements are, so we need more flexibility in writing
> rules for this.
The fact it appears to work on an unpowered hub doesn't mean anything.
Why would the manufacturer specify it can consume 178 mA if it couldn't
consume that much under some conditions? Have you measured it? What
makes you think that the hub can supply that much power on all ports at
the same time despite not being specified to do so?
Trying to say "Well, it says it needs this much, but it probably doesn't
really NEED that much.." is an unreliable guessing game.
>
> udev could surely pick up on the MaxPower value and tolerate up to a
> 100% underrun on USB flash drives. That would likely still 90% of the
> pain right there, maybe all of it.
>
> What are the reasons not to do this? What happens if a USB stick is
> underpowered to one unit? Nothing? Slower transmission? Data loss? Flash
> memory destruction? If it's just speed, it's a price well worth paying.
If the device can't get enough power, all kinds of bad stuff can happen.
This is the reason why USB power budgeting is part of the standard in
the first place. The kernel has no business ignoring such restrictions,
not without a clearly-marked-as-dangerous user choice.
> This is a great opportunity for a small exercise in empathy, utilizing
> that little long-neglected mirror neuron. Thousands of USB sticks
> inexplicably go dead in people's familiar hubs on keyboards and desks;
> Linux kernel coders dream sweet dreams of not violating USB power rules.
> I appreciate Andrew's support for a real-worldly solution.
Keep in mind that Windows will not permit the USB device to work in such
configurations either. Windows always did the right thing here. Linux
did not do the right thing before, and now it does.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-06-02 2:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <6iS8y-35Z-5@gated-at.bofh.it>
[not found] ` <6iWP5-2gj-71@gated-at.bofh.it>
[not found] ` <6iX82-2UJ-3@gated-at.bofh.it>
2006-06-01 23:35 ` USB devices fail unnecessarily on unpowered hubs Robert Hancock
2006-06-01 23:46 ` Randy.Dunlap
[not found] ` <6iYxg-53W-29@gated-at.bofh.it>
[not found] ` <6j5oR-7Sw-11@gated-at.bofh.it>
2006-06-02 2:39 ` [linux-usb-devel] " Robert Hancock
2006-06-01 10:01 Andrew Morton
2006-06-01 14:58 ` Alan Stern
2006-06-01 16:43 ` [linux-usb-devel] " Greg KH
2006-06-02 0:03 ` David Liontooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox