[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VeJtorTzV-dmxgJz+UD4gTWY1v67U0iU5nZ1pR36W9tMg@mail.gmail.com>
Date: Mon, 25 Jul 2022 23:20:55 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Matti Lehtimäki <matti.lehtimaki@...il.com>
Cc: linux-iio <linux-iio@...r.kernel.org>,
~postmarketos/upstreaming@...ts.sr.ht,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Linus Walleij <linus.walleij@...aro.org>,
Alexandru Ardelean <aardelean@...iqon.com>,
Cai Huoqing <cai.huoqing@...ux.dev>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] iio: st_sensors: Retry ID verification on failure
On Sun, Jul 24, 2022 at 6:54 PM Matti Lehtimäki
<matti.lehtimaki@...il.com> wrote:
>
> Some sensors do not always start fast enough to read a valid ID from
> registers at first attempt. Let's retry at most 3 times with short sleep
> in between to fix random timing issues.
...
> + for (i = 0; i < VERIFY_ID_RETRY_COUNT; i++) {
> + err = regmap_read(sdata->regmap,
> + sdata->sensor_settings->wai_addr, &wai);
> +
> + if (!err && sdata->sensor_settings->wai == wai)
> + return 0;
> +
> + msleep(20);
NIH regmap_read_poll_timeout()
> + }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists