Re: [PATCH 2/3] iio: pressure: dps310: reset the chip at probe
From: Jonathan Cameron
Date: Sat Oct 31 2026 - 21:05:09 EST
On Fri, 30 Oct 2026 00:06:34 +0200
Rupesh Majhi <zoone.rupert@xxxxxxxxx> wrote:
> The chip keeps its registers across a warm reboot, and probe changes
> only the shift bits in CFG_REG. A reboot during a FIFO capture leaves
> FIFO_EN set, so the ready bits never come and every raw read times
> out. The timeout reset does not clear it either, since the CFG_REG
> update that follows writes FIFO_EN back from the register cache.
>
> Reset the chip first, as remove already does.
Why do we do it in remove? Does it put it in a power saving mode
or similar? It's fairly unusual to bother resetting in that path
given as you've seen here, we pretty much have to reset in probe.
Jonathan
>
> Fixes: 90f0d1016398 ("iio: pressure: dps310: read buffered samples from the hardware FIFO")
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Closes: https://sashiko.dev/#/patchset/20260921183132.233136-1-zoone.rupert%40gmail.com
> Signed-off-by: Rupesh Majhi <zoone.rupert@xxxxxxxxx>
> ---
> Cc: Paulius Zaleckas <paulius.zaleckas@xxxxxxxxx>
>
> drivers/iio/pressure/dps310.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/iio/pressure/dps310.c b/drivers/iio/pressure/dps310.c
> index b6aa5dbe2bcd..29778f25bb33 100644
> --- a/drivers/iio/pressure/dps310.c
> +++ b/drivers/iio/pressure/dps310.c
> @@ -1445,6 +1445,11 @@ static int dps310_probe(struct i2c_client *client)
> if (rc)
> return rc;
>
> + /* The chip keeps its state across a warm reboot */
> + rc = dps310_reset_wait(data);
> + if (rc)
> + return rc;
> +
> rc = dps310_startup(data);
> if (rc)
> return rc;