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] [day] [month] [year] [list]
Date:   Wed, 3 Aug 2022 20:20:00 +0200
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Jonathan Cameron <jic23@...nel.org>
Cc:     Matti Lehtimäki <matti.lehtimaki@...il.com>,
        linux-iio@...r.kernel.org, ~postmarketos/upstreaming@...ts.sr.ht,
        Lars-Peter Clausen <lars@...afoo.de>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Alexandru Ardelean <aardelean@...iqon.com>,
        Cai Huoqing <cai.huoqing@...ux.dev>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] iio: st_sensors: Retry ID verification on failure

On Sun, Jul 31, 2022 at 10:07 PM Jonathan Cameron <jic23@...nel.org> wrote:
> Matti Lehtimäki <matti.lehtimaki@...il.com> wrote:

> > Based on the specification for the sensor I have and also driver used in
> > Android kernel for my device (it uses a 3 x 20 ms loop) I think 20 ms is
> > a good value but to be sure a slightly longer might make sense. As
> > suggested in the other review comment by changing the regmap_read to
> > regmap_read_poll_timeout the function doesn't always need to wait at
> > least 20 ms in case first read doesn't provide the correct value, if a
> > suitable shorter poll interval is used (something like 1-10 ms).
> >
> > However testing on my device has shown that I still need to have a loop
> > or at least a retry possibility because I have noticed a rare random
> > read error (-6, happens after some time not at first read) when reading
> > the id from the hardware. This could be due to for example internal
> > init failure of the sensor chip causing an internal reset. Because of
> > this read error regmap_read_poll_timeout returns with an error and
> > without retrying to read the id the sensor probe fails.
>
> Nasty. If you can get a confirmation that it's a possible failure on startup
> from the manufacturer then I'd be happier with that justification to retry
> rather than just sleep for say 30msec after power on.

If the power comes from an external regulator (such as a fixed-regulator
on a GPIO) it could be that the startup time for that regulator is incorrectly
specified or unspecified (startup-delay-us = ... for regulator-fixed)?

Else I think if the a vendor version of a driver for this HW does this quirk,
that's as good indication as you will ever get from a vendor. Do you
have the android driver source code? Or is it a userspace blob?

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ