Re: [PATCH] iio: pressure: dps310: don't wait for new temperature in trigger handler
From: Rupesh Majhi
Date: Fri Nov 13 2026 - 18:55:11 EST
On Fri, 13 Nov 2026 03:19:29 +0530
Arnav Kapoor <kapoorarnav43@xxxxxxxxx> wrote:
> Maybe I'm getting this wrong, but isn't there a case the new path
> doesn't cover? Nothing reads a temperature at probe, so if a pressure
> only buffer is enabled shortly after probe and the first pressure
> result is ready before any temperature result,
> dps310_refresh_temp_locked() finds TMP_RDY clear and the pressure is
> compensated with temp_raw still 0.
You're right. After a reset the chip has pressure ready about 3 ms
after measurement starts and temperature about 7 ms. On my board probe
takes longer than that, so I could only see it by dropping the first
temperature result in a test build. The first scan then reads 1.2 kPa
high.
> Would it make sense to do the same here with a flag set
> when a temperature has been read, and wait for one temperature in
> dps310_refresh_temp_locked() only while it's unset? That would cover
> direct pressure reads and after the first sample the scans stay at the
> pressure rate as your patch intends.
I'd rather read one temperature in probe. That covers direct reads
too, costs a few ms at most and needs no flag. I'll send v2 with that.
Thanks,
Rupesh