lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87r38mzi35.fsf@notabene.neil.brown.name>
Date:   Wed, 14 Sep 2016 16:11:58 +0200
From:   NeilBrown <neilb@...e.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     Baolin Wang <baolin.wang@...aro.org>,
        Felipe Balbi <balbi@...nel.org>,
        Greg KH <gregkh@...uxfoundation.org>,
        Sebastian Reichel <sre@...nel.org>,
        Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
        David Woodhouse <dwmw2@...radead.org>, robh@...nel.org,
        Jun Li <jun.li@....com>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Ruslan Bilovol <ruslan.bilovol@...il.com>,
        Peter Chen <peter.chen@...escale.com>,
        Alan Stern <stern@...land.harvard.edu>, r.baldyga@...sung.com,
        grygorii.strashko@...com,
        Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
        Lee Jones <lee.jones@...aro.org>,
        Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>,
        patches@...nsource.wolfsonmicro.com,
        Linux PM list <linux-pm@...r.kernel.org>,
        USB <linux-usb@...r.kernel.org>,
        device-mainlining@...ts.linuxfoundation.org,
        LKML <linux-kernel@...r.kernel.org>,
        "Bird\, Timothy" <Tim.Bird@...sony.com>
Subject: Re: [PATCH v16 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

On Wed, Sep 14 2016, Mark Brown wrote:

> [ Unknown signature status ]
> On Tue, Sep 13, 2016 at 10:00:28AM +0200, NeilBrown wrote:
>> On Mon, Sep 12 2016, Mark Brown wrote:
>
>> > That's not actually 100% clear to me - for what the wm831x is doing it
>> > probably *does* want the higher limit.  This is a system inflow limit
>> > (as it should be for this), at least the charger will adapt to voltage
>> > variations though other users in the system are much less likely to do
>> > so.
>
>> Not having very much electrical engineering background, I cannot say for
>> sure what will happen, but it seems likely that once the voltage drops
>> much below 4.75V, the charger won't be operating at peak efficiency,
>> which would be a waste.
>> I can easily imagine that the hardware would switch off at some voltage
>> level, rather than just making do with what is there.
>> So I'm skeptical of this approach, but I'm open to being corrected by
>> someone more knowledgeable than I.
>
> Yes, the idea is that the charger will back off charging and stop
> entirely if the rest of the system is consuming too much power to allow
> it to continue effectively.  The same thing happens with wall power, if
> a wall supply isn't able to power the charger (eg, because the rest of
> the system is running flat out) it'll have to cope with that.

Maybe you are correct.  I don't find your argument convincing, but maybe
that is because I don't want to...
Some facts though:
 1/ I had a report once from someone whose device stopped charging
   because it was pulling more current than the charger could supply.
   The voltage dropped below the 3.5V (I think) that the battery
   charging hardware needed, so it switched off.  It wouldn't switch
   back on again until explicitly told too.  It would then overload the
   charger again and switch off.
   Changing the code to put a lower limit on the current allowed the
   battery to be charged.  So empirical evidence suggests that the
   lower number should be used.

 2/ I hoped that
      Battery Charging Specification
      Revision 1.2
      December 7, 2010

    would say something definite, but I cannot find it.
    However,  "note 1" to "Table 5-2 Currents" says:
     
        1) The maximum current is for safety reasons, as per USB 2.0 section 7.2.1.2.1.
     
    Which seems to say the maximum is just for safety, implying that the
    minimum is the important value.

 3/  Felipe Balbi <balbi@...nel.org>  appears to agree with my
   perspective.
      http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1224904.html
   does argument-by-authority work?


>
>> Looking at it from a different perspective, according to the patch set,
>> the limits that wm831x is able to impose are:
>
>>  +	0,
>>  +	2,
>>  +	100,
>>  +	500,
>>  +	900,
>>  +	1500,
>>  +	1800,
>>  +	550,
>
>> These are, from the battery charger spec, minimums rather than maximums.
>> e.g. a CDP provides at least 1500, and as much as 5000.  So it seems
>> that the wm831x was designed to be told the minimum guaranteed available.
>> But that is circumstantial evidence and might be misleading.
>
> AIUI this is conservatisim in the system design - another way of reading
> a spec with a range like this is that the consumer should aim for the
> lower limit, the provider should aim for the upper limit and that way if
> either of them has issues with tolerances things will still work out.
> It predates wide availability of CDP so I wouldn't be surprised if that
> bit were just an oversight.  Like I say this bit of hardware is totally
> separate to the battery charger.

Your last sentence is interesting .... I would reply "of course".
All the code we are talking about is only tangentially related to battery
charging.  It is about how much current can safely be pulled from a USB
port.  What that current is used for is a completely separate question.

NeilBrown

Download attachment "signature.asc" of type "application/pgp-signature" (819 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ