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]
Date:   Sat, 12 Oct 2019 16:38:39 +0000
From:   Dan Robertson <dan@...obertson.com>
To:     Jonathan Cameron <jic23@...nel.org>
Cc:     linux-iio@...r.kernel.org,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        devicetree@...r.kernel.org, Hartmut Knaack <knaack.h@....de>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        linux-kernel@...r.kernel.org,
        Andy Shevchenko <andy.shevchenko@...il.com>
Subject: Re: [PATCH v2 2/2] iio: (bma400) add driver for the BMA400

On Sat, Oct 12, 2019 at 05:33:44PM +0100, Jonathan Cameron wrote:
> On Sat, 12 Oct 2019 15:35:56 +0000
> Dan Robertson <dan@...obertson.com> wrote:
> > On Sat, Oct 12, 2019 at 10:40:33AM +0100, Jonathan Cameron wrote:
> > >
> > > Silly question.  Why is soft_reset preferred to sleep mode?  
> > 
> > Not a silly question. I actually debated this when initially implementing the
> > driver. The datasheet describes soft-reset behavior in section 4.9, the
> > following snippet from the datasheet is particularly relevant:
> > 
> > > The softreset performs a fundamental reset to the device which is largely
> > > equivalent to a power cycle. Following a delay, all user configuration
> > > settings are overwritten with their default state...  
> > 
> > Sleep mode is the default power-mode, so the only real difference would be that
> > the oversampling ratio, sampling frequency, and scale would all be reset to
> > their defaults with a soft-reset. If we just set the power-mode to sleep mode,
> > the user configuration registers would be preserved.
> > 
> > I can add a comment about the behavior of a softreset in bma400_remove.
> I'd just not do it.  That way there is only the putting it to sleep path.
> We normally assume that we don't know the state during startup and aren't
> as careful on remove to make sure things are in a default state.
> 
> That way you only need a single path in the remove function. If sleep mode
> fails you are probably broken anyway.

Sounds good. That does make remove much easier if the device is not ready for a
command. I'll remove this in the next patchset version.

Cheers,

 - Dan

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ