* Re: USB devices fail unnecessarily on unpowered hubs
[not found] ` <6iYQx-5Jc-7@gated-at.bofh.it>
@ 2006-06-01 23:37 ` Robert Hancock
0 siblings, 0 replies; 22+ messages in thread
From: Robert Hancock @ 2006-06-01 23:37 UTC (permalink / raw)
To: linux-kernel; +Cc: Alan Stern
Alan Stern wrote:
>>
>> (Goes away and pats all his 240V plugpacks which are happily working off 110V).
>
> They probably will. The question is, how far out-of-spec should the
> kernel allow by default? 200% is likely to be too far (your plugpacks
> notwithstanding).
I would say by default the kernel should not allow any out-of-spec power
condition. Some devices might decide to go into over-current mode if a
device draws too much power, taking down other devices on the USB bus.
This sort of behavior should only be enabled if the user explicitly
chooses to live dangerously.
Especially given the fact that Windows enforces the USB power supply
limits strictly, and that's where all the hardware is best tested..
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
^ permalink raw reply [flat|nested] 22+ messages in thread
[parent not found: <6kl8h-1Uf-15@gated-at.bofh.it>]
* Re: USB devices fail unnecessarily on unpowered hubs
[not found] <6kl8h-1Uf-15@gated-at.bofh.it>
@ 2006-06-07 0:51 ` Robert Hancock
0 siblings, 0 replies; 22+ messages in thread
From: Robert Hancock @ 2006-06-07 0:51 UTC (permalink / raw)
To: Lee Dowling, linux-kernel
Lee Dowling wrote:
> This, of course, doesn't deal with outside cases.
>
> It's common knowledge that a lot of equipment is running out of spec all
> the time because of cheap components, bad BIOS's etc. As an example, my
> Asus L4500R laptop (with the latest ASUS BIOS) ALWAYS shows
> "over-current" under Linux on all *internal* USB ports the second
> ANYTHING is plugged in (and I have nearly 50 different USB devices of
> different types, manufacturers and quality).
>
> The suggestion to simply stop over-current ports from working would
> immediately disable all USB ports, including any powered hubs that I
> plug into them, I assume. I can't update the BIOS any further to stop
> this and if I could I doubt it would solve the problem (it looks like
> cheap hardware to me). Therefore, you've just removed all my perfectly
> functional USB capability because the best BIOS I can use reports an
> incorrect error (hey, what's new?).
I don't think you assume correctly. Overcurrent indication from the hub
is supposed to mean that something on the hub is shorted or pulling too
much current. This discussion is about the kernel refusing to enable
devices when they would consume more power than the hub they are
connected to can provide. Regardless of what you do with plugging in
devices, overcurrent isn't supposed to happen unless something is broken.
>
> Windows XP, incidentally, runs flawlessly with all USB devices without
> power warnings on this laptop. This may well be fixable somewhere else,
> it may even be a bug in the internal USB code for my laptop which may be
> help in hunting such bugs down.
Probably either XP ignores the overcurrent indication, or else something
in Linux is interacting badly with the controller and causing this
indication. XP definitely DOES enforce USB power budgeting.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
@ 2006-06-05 11:07 Lee Dowling
0 siblings, 0 replies; 22+ messages in thread
From: Lee Dowling @ 2006-06-05 11:07 UTC (permalink / raw)
To: linux-kernel
This, of course, doesn't deal with outside cases.
It's common knowledge that a lot of equipment is running out of spec all
the time because of cheap components, bad BIOS's etc. As an example, my
Asus L4500R laptop (with the latest ASUS BIOS) ALWAYS shows "over-current"
under Linux on all *internal* USB ports the second ANYTHING is plugged in
(and I have nearly 50 different USB devices of different types,
manufacturers and quality).
The suggestion to simply stop over-current ports from working would
immediately disable all USB ports, including any powered hubs that I plug
into them, I assume. I can't update the BIOS any further to stop this and
if I could I doubt it would solve the problem (it looks like cheap
hardware to me). Therefore, you've just removed all my perfectly
functional USB capability because the best BIOS I can use reports an
incorrect error (hey, what's new?).
Windows XP, incidentally, runs flawlessly with all USB devices without
power warnings on this laptop. This may well be fixable somewhere else,
it may even be a bug in the internal USB code for my laptop which may be
help in hunting such bugs down. However, anything like this should be
optional and not with some convoluted command-line echo, but by as simple
binary switch accesible to userspace. I know what I'm doing, if I choose
to ignore the error, that's my problem. The fact is, if I don't ignore
this particular error, my laptop loses all USB functionality. Taint my
kernel if you want (that's what the new userspace taint is for, is it
not?) but I need to use the USB ports that I've paid a lot of money to
have and that DO work perfectly if given a nudge.
Spec's are lovely and all, but we all know that if real hardware confirmed
to the spec's all the time that the Linux kernel would be about half it's
current size.
Lee Dowling
ICT Technician
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [linux-usb-devel] USB devices fail unnecessarily on unpowered hubs
@ 2006-06-02 15:11 Alan Stern
2006-06-02 19:49 ` David Liontooth
0 siblings, 1 reply; 22+ messages in thread
From: Alan Stern @ 2006-06-02 15:11 UTC (permalink / raw)
To: David Liontooth; +Cc: Greg KH, Andrew Morton, linux-kernel, linux-usb-devel
On Thu, 1 Jun 2006, David Liontooth wrote:
> 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.
I do wish people would read the earlier messages in this thread before
posting. Go back and look at this one:
http://marc.theaimsgroup.com/?l=linux-kernel&m=114918113822427&w=2
Trying to draw too much current from an unpowered hub can and does cause
data loss.
Alan Stern
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-02 15:11 [linux-usb-devel] " Alan Stern
@ 2006-06-02 19:49 ` David Liontooth
0 siblings, 0 replies; 22+ messages in thread
From: David Liontooth @ 2006-06-02 19:49 UTC (permalink / raw)
To: Alan Stern; +Cc: Greg KH, Andrew Morton, linux-kernel, linux-usb-devel
Alan Stern wrote:
> Trying to draw too much current from an unpowered hub can and does cause
> data loss.
>
I consider this issue closed; thank you for looking at it. The
workaround is reasonably simple for the common situation of mounting a
USB stick on a keyboard, perhaps with a mouse attached in a second port:
NUM="$(dmesg | tail -n 3 | grep -r 'new full speed USB device' | cut -b
5-9)"
echo -n 1 >/sys/bus/usb/devices/$NUM/bConfigurationValue
with the understanding this breaks USB power rules and can lead to data
loss.
Dave
^ permalink raw reply [flat|nested] 22+ messages in thread
[parent not found: <6iWP5-2gj-71@gated-at.bofh.it>]
* USB devices fail unnecessarily on unpowered hubs
@ 2006-06-01 9:18 David Liontooth
2006-05-30 20:01 ` Pavel Machek
2006-06-01 10:01 ` Andrew Morton
0 siblings, 2 replies; 22+ messages in thread
From: David Liontooth @ 2006-06-01 9:18 UTC (permalink / raw)
To: linux-kernel
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?
David
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 9:18 David Liontooth
@ 2006-05-30 20:01 ` Pavel Machek
2006-06-03 9:29 ` Oliver Neukum
2006-06-01 10:01 ` Andrew Morton
1 sibling, 1 reply; 22+ messages in thread
From: Pavel Machek @ 2006-05-30 20:01 UTC (permalink / raw)
To: David Liontooth; +Cc: linux-kernel, linux-usb-devel
Hi!
> 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."
Actually I have exactly opposite problem: my computer (spitz) can't
supply full 500mA on its root hub, and linux tries to power up
'hungry' devices, anyway, leading to very weird behaviour.
--
Thanks for all the (sleeping) penguins.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-05-30 20:01 ` Pavel Machek
@ 2006-06-03 9:29 ` Oliver Neukum
0 siblings, 0 replies; 22+ messages in thread
From: Oliver Neukum @ 2006-06-03 9:29 UTC (permalink / raw)
To: Pavel Machek; +Cc: David Liontooth, linux-kernel, linux-usb-devel
Am Dienstag, 30. Mai 2006 22:01 schrieb Pavel Machek:
> Hi!
>
> > 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."
>
> Actually I have exactly opposite problem: my computer (spitz) can't
> supply full 500mA on its root hub, and linux tries to power up
> 'hungry' devices, anyway, leading to very weird behaviour.
You could lower the obvious values in this code from drivers/usb/core/hub.c
if (hdev == hdev->bus->root_hub) {
if (hdev->bus_mA == 0 || hdev->bus_mA >= 500)
hub->mA_per_port = 500;
else {
hub->mA_per_port = hdev->bus_mA;
hub->limited_power = 1;
}
If that does the job we need to somehow inherit the power supply maximum from
PCI when we allocate the root hub's device structure.
Regards
Oliver
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 9:18 David Liontooth
2006-05-30 20:01 ` Pavel Machek
@ 2006-06-01 10:01 ` Andrew Morton
2006-06-01 11:42 ` Daniel Drake
` (2 more replies)
1 sibling, 3 replies; 22+ messages in thread
From: Andrew Morton @ 2006-06-01 10:01 UTC (permalink / raw)
To: David Liontooth; +Cc: linux-kernel, linux-usb-devel, Alan Stern
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?
>
(added linux-usb cc)
Yes, it sounds like we're being non-real-worldly here. This change
apparently broke things. Did it actually fix anything as well?
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 10:01 ` Andrew Morton
@ 2006-06-01 11:42 ` Daniel Drake
2006-06-01 14:58 ` Alan Stern
2006-06-01 17:34 ` Mark Lord
2 siblings, 0 replies; 22+ messages in thread
From: Daniel Drake @ 2006-06-01 11:42 UTC (permalink / raw)
To: Andrew Morton; +Cc: David Liontooth, linux-kernel, linux-usb-devel, Alan Stern
Andrew Morton wrote:
> (added linux-usb cc)
>
> Yes, it sounds like we're being non-real-worldly here. This change
> apparently broke things. Did it actually fix anything as well?
Gentoo recieved several reports of this. It appears that certain vendors
are worse than others (Verbatim flash drives are a common culprit).
Some users tested and found that Windows has the same behaviour - it
rejects these devices on unpowered hubs, and pops up a warning that not
enough power is available.
I added a printk to point out when configurations are rejected due to
power issues, this has been merged into Greg's tree. It's far from
ideal, but better than silent failure...
Daniel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 10:01 ` Andrew Morton
2006-06-01 11:42 ` Daniel Drake
@ 2006-06-01 14:58 ` Alan Stern
2006-06-01 15:09 ` linux-os (Dick Johnson)
2006-06-01 16:59 ` Andrew Morton
2006-06-01 17:34 ` Mark Lord
2 siblings, 2 replies; 22+ messages in thread
From: Alan Stern @ 2006-06-01 14:58 UTC (permalink / raw)
To: Andrew Morton; +Cc: David Liontooth, linux-kernel, linux-usb-devel
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. If we don't, we certainly could. Although this event wouldn't
contain information about the power budget shortfall, it would contain
vendor and product IDs. These would be sufficiently specific for a custom
udev script to install the desired configuration.
> Yes, it sounds like we're being non-real-worldly here. This change
> apparently broke things. Did it actually fix anything as well?
Yes. At least, I think so. The change directly addresses a complaint
filed here:
http://marc.theaimsgroup.com/?l=linux-usb-users&m=112438431718562&w=2
I haven't checked back with the original poster to make sure that his
problem has been solved, but presumably it has been.
As an alternative, we could allow an "over-budget window" of say 10%.
Configurations that exceed the power budget by less than that amount would
still be accepted. I don't know whether this would be enough of a help,
however. I've heard of devices that claim to require 200 mA, for
instance. It just doesn't seem right to enable them when the upstream hub
can only provide 100 mA.
Alan Stern
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 14:58 ` Alan Stern
@ 2006-06-01 15:09 ` linux-os (Dick Johnson)
2006-06-01 15:23 ` Lennart Sorensen
` (2 more replies)
2006-06-01 16:59 ` Andrew Morton
1 sibling, 3 replies; 22+ messages in thread
From: linux-os (Dick Johnson) @ 2006-06-01 15:09 UTC (permalink / raw)
To: Alan Stern; +Cc: Andrew Morton, David Liontooth, linux-kernel, linux-usb-devel
On Thu, 1 Jun 2006, 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. If we don't, we certainly could. Although this event wouldn't
> contain information about the power budget shortfall, it would contain
> vendor and product IDs. These would be sufficiently specific for a custom
> udev script to install the desired configuration.
>
>> Yes, it sounds like we're being non-real-worldly here. This change
>> apparently broke things. Did it actually fix anything as well?
>
> Yes. At least, I think so. The change directly addresses a complaint
> filed here:
>
> http://marc.theaimsgroup.com/?l=linux-usb-users&m=112438431718562&w=2
>
> I haven't checked back with the original poster to make sure that his
> problem has been solved, but presumably it has been.
>
> As an alternative, we could allow an "over-budget window" of say 10%.
> Configurations that exceed the power budget by less than that amount would
> still be accepted. I don't know whether this would be enough of a help,
> however. I've heard of devices that claim to require 200 mA, for
> instance. It just doesn't seem right to enable them when the upstream hub
> can only provide 100 mA.
>
> Alan Stern
>
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.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.4 on an i686 machine (5592.73 BogoMips).
New book: http://www.AbominableFirebug.com/
_
\x1a\x04
****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.
Thank you.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 15:09 ` linux-os (Dick Johnson)
@ 2006-06-01 15:23 ` Lennart Sorensen
2006-06-01 21:39 ` Dagfinn Ilmari Mannsåker
2006-06-01 15:53 ` Oliver Neukum
2006-06-01 16:57 ` Alan Stern
2 siblings, 1 reply; 22+ messages in thread
From: Lennart Sorensen @ 2006-06-01 15:23 UTC (permalink / raw)
To: linux-os (Dick Johnson)
Cc: Alan Stern, Andrew Morton, David Liontooth, linux-kernel,
linux-usb-devel
On Thu, Jun 01, 2006 at 11:09:46AM -0400, 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.
I imagine something like a harddisk might use more power while
reading/writing than when it is just spinning. It might even start
powered down until sent some command that causes it to spin up.
A scanner certainly uses more power with the scanner light on than with
it off, and it starts out off until it is in use on most scanners. Of
course I have never seen a usb powered scanner, so it doesn't seem to
matter.
Len Sorensen
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 15:23 ` Lennart Sorensen
@ 2006-06-01 21:39 ` Dagfinn Ilmari Mannsåker
0 siblings, 0 replies; 22+ messages in thread
From: Dagfinn Ilmari Mannsåker @ 2006-06-01 21:39 UTC (permalink / raw)
To: Lennart Sorensen
Cc: Alan Stern, Andrew Morton, David Liontooth, linux-kernel,
linux-usb-devel
Lennart Sorensen <lsorense@csclub.uwaterloo.ca> writes:
> A scanner certainly uses more power with the scanner light on than with
> it off, and it starts out off until it is in use on most scanners. Of
> course I have never seen a usb powered scanner, so it doesn't seem to
> matter.
Oh, they've been around for years. The CanoScan LiDE 25 is an example:
<http://www.usa.canon.com/consumer/controller?act=ModelTechSpecsAct&fcategoryid=119&modelid=11463>
--
ilmari
"A disappointingly low fraction of the human race is,
at any given time, on fire." - Stig Sandbeck Mathisen
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 15:09 ` linux-os (Dick Johnson)
2006-06-01 15:23 ` Lennart Sorensen
@ 2006-06-01 15:53 ` Oliver Neukum
2006-06-01 17:24 ` linux-os (Dick Johnson)
2006-06-01 16:57 ` Alan Stern
2 siblings, 1 reply; 22+ messages in thread
From: Oliver Neukum @ 2006-06-01 15:53 UTC (permalink / raw)
To: linux-os (Dick Johnson)
Cc: Alan Stern, Andrew Morton, David Liontooth, linux-kernel,
linux-usb-devel
Am Donnerstag, 1. Juni 2006 17:09 schrieb linux-os (Dick Johnson):
> 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
If they do, they are violating the spec. A device in the unconfigured (state 0)
state must not draw more than 100mA.
Regards
Oliver
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 15:53 ` Oliver Neukum
@ 2006-06-01 17:24 ` linux-os (Dick Johnson)
0 siblings, 0 replies; 22+ messages in thread
From: linux-os (Dick Johnson) @ 2006-06-01 17:24 UTC (permalink / raw)
To: Oliver Neukum
Cc: Alan Stern, Andrew Morton, David Liontooth, linux-kernel,
linux-usb-devel
On Thu, 1 Jun 2006, Oliver Neukum wrote:
> Am Donnerstag, 1. Juni 2006 17:09 schrieb linux-os (Dick Johnson):
>> 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
>
> If they do, they are violating the spec. A device in the unconfigured (state 0)
> state must not draw more than 100mA.
>
> Regards
> Oliver
>
Hmmm, the USB-IF recommends 100 mA per port, not requires.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.4 on an i686 machine (5592.73 BogoMips).
New book: http://www.AbominableFirebug.com/
_
\x1a\x04
****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.
Thank you.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 15:09 ` linux-os (Dick Johnson)
2006-06-01 15:23 ` Lennart Sorensen
2006-06-01 15:53 ` Oliver Neukum
@ 2006-06-01 16:57 ` Alan Stern
2 siblings, 0 replies; 22+ messages in thread
From: Alan Stern @ 2006-06-01 16:57 UTC (permalink / raw)
To: linux-os (Dick Johnson)
Cc: Andrew Morton, David Liontooth, linux-kernel, linux-usb-devel
On Thu, 1 Jun 2006, linux-os (Dick Johnson) wrote:
> >> Yes, it sounds like we're being non-real-worldly here. This change
> >> apparently broke things. Did it actually fix anything as well?
> >
> > Yes. At least, I think so. The change directly addresses a complaint
> > filed here:
> >
> > http://marc.theaimsgroup.com/?l=linux-usb-users&m=112438431718562&w=2
> 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.
Looks like you didn't bother to read that complaint and the follow-up
messages. Robert Marquardt's device has two configurations, one using 100
mA and the other using 500 mA. Before my patch, Linux would always
install the high-power config -- even if the device was behind a
bus-powered hub. According to Robert:
This can trigger the overcurrent protection of a bus powered
hub which usually then switches off completely dragging down
three other innocent devices.
Please tell me that Linux kernel programmers are not that idiotic.
I'll avoid speculations about which kernel programmers are or are not
idiotic...
Alan Stern
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 14:58 ` Alan Stern
2006-06-01 15:09 ` linux-os (Dick Johnson)
@ 2006-06-01 16:59 ` Andrew Morton
2006-06-01 17:08 ` Alan Stern
1 sibling, 1 reply; 22+ messages in thread
From: Andrew Morton @ 2006-06-01 16:59 UTC (permalink / raw)
To: Alan Stern; +Cc: liontooth, linux-kernel, linux-usb-devel
On Thu, 1 Jun 2006 10:58:43 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:
> As an alternative, we could allow an "over-budget window" of say 10%.
That, plus we should provide a suitable i-know-what-im-doing user override,
with the appropriate warnings, as well as a printk which directs users to
this option when we decided to disable their device.
> Configurations that exceed the power budget by less than that amount would
> still be accepted. I don't know whether this would be enough of a help,
> however. I've heard of devices that claim to require 200 mA, for
> instance. It just doesn't seem right to enable them when the upstream hub
> can only provide 100 mA.
The power supply spec is a conservative minimum, whereas the device spec is
a worst-case maximum. One would expect a lot of devices will work OK when
run "out of spec".
(Goes away and pats all his 240V plugpacks which are happily working off 110V).
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 16:59 ` Andrew Morton
@ 2006-06-01 17:08 ` Alan Stern
0 siblings, 0 replies; 22+ messages in thread
From: Alan Stern @ 2006-06-01 17:08 UTC (permalink / raw)
To: Andrew Morton; +Cc: liontooth, linux-kernel, linux-usb-devel
On Thu, 1 Jun 2006, Andrew Morton wrote:
> On Thu, 1 Jun 2006 10:58:43 -0400 (EDT)
> Alan Stern <stern@rowland.harvard.edu> wrote:
>
> > As an alternative, we could allow an "over-budget window" of say 10%.
>
> That, plus we should provide a suitable i-know-what-im-doing user override,
> with the appropriate warnings, as well as a printk which directs users to
> this option when we decided to disable their device.
The user override already exists, as do the appropriate warnings. Daniel
Drake just added a printk explaining why the device was not configured,
although it doesn't tell how to configure the device by hand. Perhaps a
FAQ entry at www.linux-usb.org would be appropriate.
> The power supply spec is a conservative minimum, whereas the device spec is
> a worst-case maximum. One would expect a lot of devices will work OK when
> run "out of spec".
>
> (Goes away and pats all his 240V plugpacks which are happily working off 110V).
They probably will. The question is, how far out-of-spec should the
kernel allow by default? 200% is likely to be too far (your plugpacks
notwithstanding).
Alan Stern
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 10:01 ` Andrew Morton
2006-06-01 11:42 ` Daniel Drake
2006-06-01 14:58 ` Alan Stern
@ 2006-06-01 17:34 ` Mark Lord
2006-06-01 17:47 ` Alan Stern
2 siblings, 1 reply; 22+ messages in thread
From: Mark Lord @ 2006-06-01 17:34 UTC (permalink / raw)
To: Andrew Morton; +Cc: David Liontooth, linux-kernel, linux-usb-devel, Alan Stern
Andrew Morton wrote:
> On Thu, 01 Jun 2006 02:18:20 -0700
> ..
>> 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?
..
> Yes, it sounds like we're being non-real-worldly here. This change
> apparently broke things. Did it actually fix anything as well?
I think a far more sensible approach would be to just ensure that the
total current draw for the (unpowered) hub and all connected devices,
stays below the 500mA allowed. So a 200mA device could coexist with
a 100mA device on a hub which itself steals 100mA.
Cheers
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: USB devices fail unnecessarily on unpowered hubs
2006-06-01 17:34 ` Mark Lord
@ 2006-06-01 17:47 ` Alan Stern
0 siblings, 0 replies; 22+ messages in thread
From: Alan Stern @ 2006-06-01 17:47 UTC (permalink / raw)
To: linux-os (Dick Johnson), Mark Lord
Cc: Andrew Morton, David Liontooth, Kernel development list,
USB development list
On Thu, 1 Jun 2006, linux-os (Dick Johnson) wrote:
> > If they do, they are violating the spec. A device in the unconfigured (state 0)
> > state must not draw more than 100mA.
...
> Hmmm, the USB-IF recommends 100 mA per port, not requires.
See section 7.2.1 of the USB 2.0 specification (p. 177):
Devices must also ensure that the maximum operating current drawn
by a device is one unit load, until configured.
Note that a unit load is defined as to be 100 mA. This is a requirement,
not a recommendation.
On Thu, 1 Jun 2006, Mark Lord wrote:
> I think a far more sensible approach would be to just ensure that the
> total current draw for the (unpowered) hub and all connected devices,
> stays below the 500mA allowed. So a 200mA device could coexist with
> a 100mA device on a hub which itself steals 100mA.
On that same page the specification says:
Bus-powered hubs: Draw all of their power for any internal
functions and downstream facing ports from VBUS on the hub s
upstream facing port. Bus-powered hubs may only draw up to one
unit load upon power-up and five unit loads after configuration.
The configuration power is split between allocations to the hub,
any non-removable functions and the external ports. External ports
in a bus-powered hub can supply only one unit load per port
regardless of the current draw on the other ports of that hub.
This clearly states that a bus-powered hub cannot supply 200 mA on one
port, even if another port is unoccupied.
Alan Stern
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2006-06-07 0:51 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <6iYGP-5hv-3@gated-at.bofh.it>
[not found] ` <6iYQx-5Jc-7@gated-at.bofh.it>
2006-06-01 23:37 ` USB devices fail unnecessarily on unpowered hubs Robert Hancock
[not found] <6kl8h-1Uf-15@gated-at.bofh.it>
2006-06-07 0:51 ` Robert Hancock
2006-06-05 11:07 Lee Dowling
-- strict thread matches above, loose matches on Subject: below --
2006-06-02 15:11 [linux-usb-devel] " Alan Stern
2006-06-02 19:49 ` David Liontooth
[not found] <6iWP5-2gj-71@gated-at.bofh.it>
[not found] ` <6iX82-2UJ-3@gated-at.bofh.it>
2006-06-01 23:35 ` Robert Hancock
2006-06-01 23:46 ` Randy.Dunlap
2006-06-01 9:18 David Liontooth
2006-05-30 20:01 ` Pavel Machek
2006-06-03 9:29 ` Oliver Neukum
2006-06-01 10:01 ` Andrew Morton
2006-06-01 11:42 ` Daniel Drake
2006-06-01 14:58 ` Alan Stern
2006-06-01 15:09 ` linux-os (Dick Johnson)
2006-06-01 15:23 ` Lennart Sorensen
2006-06-01 21:39 ` Dagfinn Ilmari Mannsåker
2006-06-01 15:53 ` Oliver Neukum
2006-06-01 17:24 ` linux-os (Dick Johnson)
2006-06-01 16:57 ` Alan Stern
2006-06-01 16:59 ` Andrew Morton
2006-06-01 17:08 ` Alan Stern
2006-06-01 17:34 ` Mark Lord
2006-06-01 17:47 ` Alan Stern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox