Re: USB bus power budget and hubs

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

 



On Sat, 07 November 2009 Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> > I'm wondering how the power budget should work with regard to USB
> > hub.
> > 
> > I have a hub (SkyMaster 4-port hub) that reports MaxPower 500ma when
> > powerered by USB bus and MaxPower 100ma when externally powered.
> 
> This means that the hub will use up to 500 mA of current when it is
> bus powered and it will use up to 100 mA of bus current when
> externally powered.
> 
> > In addition it reports 100ma for bHubContrCurrent.
> 
> That is the current needed for running the hub itself; everything
> else is devoted to powering the devices plugged into the hub's
> downstream ports.  Hence the 500 mA value in the bus-powered state
> means that 100 mA is devoted to the hub and 100 mA is available for
> each of the four ports.

Ok, I would have thought the 400ma remaining could by used as needed on
the hub's ports and would not need to be at most 100ma (in this
case it's also equally distributed on all of the 4 ports).

> > Pluging in two usb devices into the hub triggers the following
> > message: rejected 1 configuration due to insufficient available bus
> > power
> > 
> > The devices I connect report 100ma for Profilic USB2Serial and 200ma
> > for Sandisk USB pen.
> 
> Presumably this happens only when the hub is bus-powered, not when it
> has external power.  With external power there should not be any
> restrictions; the hub should be able to provide 500 mA to each port.

Exact, when HUB is externally powered it the USB pen is happily
accepted.

> When a hub is bus-powered, the USB specification does not allow it to
> provide more than 100 mA to each port.  Since the Sandisk pen wants
> more than 100 mA, the kernel rejects its configuration.  You can
> override this decision if you want by writing the appropriate config
> value to the pen's /sys/bus/usb/devices/.../bConfigurationValue file.

That's a not so nice limitation of the spec... It would have been more
useful if the "available" power could be forwarded to a single port of
the HUB even if in that case 0ma remain for the other 3 ports.

> > I'm wondering if the 500ma reported by HUB when bus powered
> > *include* the power the hub is ready to forward to devices
> > connected to it but the kernel just sums up all the MaxPower values
> > for the budget check...
> 
> Yes, the 500 mA value does include the current forwarded to connected 
> devices.  The kernel does not sum up all the MaxPower values; instead 
> it checks that each device does not draw more current than the amount 
> available on the device's port.
> 
> > I'm currently running on 2.6.32-rc6, but the same issue exists at
> > least since 2.6.30.
> 
> It goes back a lot farther than that.  Power budgeting was added
> pretty early in the 2.6 kernels.
> 
> Alan Stern

Thanks for the details!

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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux