Re: [PATCH v2 5/7] iio: pressure: dps310: use time unit macros for sleeps and timeouts

From: Andy Shevchenko

Date: Thu Nov 26 2026 - 08:49:33 EST


On Thu, Nov 26, 2026 at 02:17:34PM +0100, Joshua Crofts wrote:
> On 26-Nov-26 13:13, Rupesh Majhi wrote:

...

> > - usleep_range(15000, 55000);
> > + msleep(20);
> I think it's safe to use 15 as specified in the datasheet, as msleep()
> guarantees sleep for the specified time + a max of 12.5% slack.

Wouldn't be better to have some margin still? You know that time goes
differently on different CPUs and in general time can go backwards (in
computers), so the long sleeps can (I haven't checked though) go both ways,
and a minimum sleeping time can be less. Also on the other side firmware
might have issues in some circumstances and require slightly bigger sleep
than specified. That's why I proposed margin.

> This can be tweaked whilst applying though (or not, at it's pretty minuscule).

--
With Best Regards,
Andy Shevchenko