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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97385135400386d174bc1e63e67313efa18ebcca.camel@fi.rohmeurope.com>
Date:   Wed, 25 Mar 2020 09:47:50 +0000
From:   "Vaittinen, Matti" <Matti.Vaittinen@...rohmeurope.com>
To:     "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>
CC:     "tglx@...utronix.de" <tglx@...utronix.de>,
        "dan.j.williams@...el.com" <dan.j.williams@...el.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "talgi@...lanox.com" <talgi@...lanox.com>,
        "brendanhiggins@...gle.com" <brendanhiggins@...gle.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        "Gary.Hook@....com" <Gary.Hook@....com>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "davidgow@...gle.com" <davidgow@...gle.com>,
        "changbin.du@...el.com" <changbin.du@...el.com>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "herbert@...dor.apana.org.au" <herbert@...dor.apana.org.au>,
        "olteanv@...il.com" <olteanv@...il.com>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "rdunlap@...radead.org" <rdunlap@...radead.org>,
        "yamada.masahiro@...ionext.com" <yamada.masahiro@...ionext.com>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "Mutanen, Mikko" <Mikko.Mutanen@...rohmeurope.com>,
        "bp@...e.de" <bp@...e.de>,
        "mhiramat@...nel.org" <mhiramat@...nel.org>,
        "krzk@...nel.org" <krzk@...nel.org>,
        "mazziesaccount@...il.com" <mazziesaccount@...il.com>,
        "skhan@...uxfoundation.org" <skhan@...uxfoundation.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "Laine, Markus" <Markus.Laine@...rohmeurope.com>,
        "vincenzo.frascino@....com" <vincenzo.frascino@....com>,
        "sre@...nel.org" <sre@...nel.org>,
        "ardb@...nel.org" <ardb@...nel.org>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        "zaslonko@...ux.ibm.com" <zaslonko@...ux.ibm.com>,
        "uwe@...ine-koenig.org" <uwe@...ine-koenig.org>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: Re: [PATCH v6 09/10] power: supply: Support ROHM bd99954 charger


On Tue, 2020-03-24 at 12:53 +0200, Matti Vaittinen wrote:
> Hello Andy,
> 
> I do agree with most of the things you pointed out. I didn't comment
> them.
> 
> On Tue, 2020-03-24 at 11:50 +0200, Andy Shevchenko wrote:
> > On Tue, Mar 24, 2020 at 10:32:19AM +0200, Matti Vaittinen wrote:
> > > The ROHM BD99954 is a Battery Management LSI for 1-4 cell
> > > Lithium-
> > > Ion
> > > secondary battery intended to be used in space-constraint
> > > equipment
> > > such
> > > as Low profile Notebook PC, Tablets and other applications.
> > > BD99954
> > > provides a Dual-source Battery Charger, two port BC1.2 detection
> > > and a
> > > Battery Monitor.
> > 
> > > +	do {
> > > +		ret = regmap_field_read(bd-
> > > >rmap_fields[F_OTPLD_STATE], 
> > > &state);
> > > +		if (ret)
> > > +			return ret;
> > > +
> > > +		msleep(10);
> > > +	} while (state == 0 && --rst_check_counter);
> > 
> > regmap_read_poll_timeout() exists, but I see you use it for field.
> > Perhaps it's
> > a time to introduce similar helper for field polling.
> This series is again getting lengthy... I'll see if I add such an API
> in this series. I've learned that adding changes will increase the
> time
> it takes to push the series through. It might be more reviewer
> friendly
> to add it in own patch with limited review audience (as would be the
> patch 10/10 in this series). But I think your point is valid.

I took a peek at regmap_read_poll_timeout(). Nice API - and if we were
to create similar for fields, we should probably make behaviour
identical to regmap_read_poll_timeout(). I see
regmap_read_poll_timeout() is using hrtimers for timeout - which is
overkill for the BD99954 needs. I'd rather keep the msleep here.

Br,
	Matti

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ