Re: USB power accounting at root hub level

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

 



On Tue, 26 Jul 2011, Oliver Neukum wrote:

> Am Dienstag, 26. Juli 2011, 08:46:07 schrieb Thomas Petazzoni:
> > Hello,
> > 
> > Thanks again for the quick feedback.
> > 
> > Le Mon, 25 Jul 2011 15:08:53 -0400 (EDT),
> > Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> a écrit :
> 
> > > There's no contradiction.  If 175 mA total are available, then one way
> > > to apportion it is to plug in a single device requiring 175 mA.  In
> > > other words, there really is up to 175 mA available for each port.
> > 
> > Hum, I'm sorry, but I still see a contradiction :
> > 
> >  * On one side, there is a computation that assumes that hdev->bus_mA
> >    is a *per-port* current limit (and this computation is used to
> >    reject new USB configurations from connecting) ;
> > 
> >  * On another side, there is a computation that assumes that
> >    hdev->bus_mA is a *global hub* current limit (and this computation
> >    is used to print a warning in the kernel messages).
> > 
> > If I set a global current limit of 175 mA, then two devices of 100 mA
> > shouldn't be allowed to connect.
> 
> I am afraid this is a true problem. We need to make the computation of
> the available power dynamic. The computation of hub->mA_per_port
> once is insufficient, as we cannot say that a limit valid for any port is valid
> for every port forever.

You have misunderstood the purpose of hub->mA_per_port.  It is not a
dynamic value reflecting the amount of current available at any moment.  
Rather, it is a static upper limit reflecting the computations
prescribed by the USB-2.0 spec, section 7.2.1.

For example, suppose a bus-powered hub with only two ports receives 500
mA from the bus and uses 100 mA for its own internal functioning.  
That doesn't mean it can supply 200 mA to each port; according to the
spec each port is still allowed to use only 100 mA.

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