Re: USB bus power budget and hubs

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

 



On Sat, 7 Nov 2009, Bruno [UTF-8] Prémont wrote:

> Hi,
> 
> 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.

> 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.

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.

> 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

--
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