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: <20150519091442.GF14396@lpalcu-linux>
Date:	Tue, 19 May 2015 12:14:42 +0300
From:	Laurentiu Palcu <laurentiu.palcu@...el.com>
To:	Krzysztof Kozlowski <k.kozlowski@...sung.com>
Cc:	Rob Herring <robh+dt@...nel.org>, Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Sebastian Reichel <sre@...nel.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
	David Woodhouse <dwmw2@...radead.org>,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-pm@...r.kernel.org
Subject: Re: [PATCH 2/2] power_supply: Add support for TI BQ25890 charger chip

Hi Krzysztof,

On Tue, May 19, 2015 at 05:40:25PM +0900, Krzysztof Kozlowski wrote:
> > +
> > +static int bq25890_chip_reset(struct bq25890_device *bq)
> > +{
> > +       int ret;
> > +
> > +       ret = bq25890_field_write(bq, F_REG_RST, 1);
> > +       if (ret < 0)
> > +               return ret;
> > +
> > +       do {
> > +               ret = bq25890_field_read(bq, F_REG_RST);
> > +               if (ret < 0)
> > +                       return ret;
> > +
> > +               usleep_range(5, 10);
> > +       } while (ret == 1);
> 
> Is it possible to loop here indefinetely?
According to specifications, this field is "Reset to 0 after register
reset is completed", so I'm trusting the chip will behave as advertised!
:) We could implement a safety mechanism to avoid looping in case the
chip misbehaves but I don't think it's worth it. What do you think?

I'll address the other comments in v2.

Thanks for reviewing,
laurentiu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ