Re: [PATCH] iio: pressure: bm1390: replace short msleeps with usleep_range
From: Matti Vaittinen
Date: Tue Jun 09 2026 - 06:02:23 EST
On 09/06/2026 09:13, Andy Shevchenko wrote:
On Mon, Jun 08, 2026 at 06:41:54PM +0100, Jonathan Cameron wrote:
On Sun, 7 Jun 2026 14:00:18 +0000
Hungyu Lin <dennylin0707@xxxxxxxxx> wrote:
Replace msleep(1) with usleep_range(1000, 2000) for the
driver's short delays.
The BM1390 datasheet specifies a 1 ms reset cancel wait time
(tSC1) during the power-on sequence. Use usleep_range() for
these short delays, as it is more appropriate than msleep()
and avoids unnecessarily long sleeps.
Use fsleep() which has the added advantage of standardizing the
'slack' so we don't have to thing about the values chosen
While true, msleep(1) is kinda idiomatic, we don't need to hunt subtle timing
issues in case of switching to stricter fsleep(), which will most likely choose
usleep_range() beneath. TL;DR: I do not see a value in this change.
I don't see the value either, unless there is a real problem the patch author has encountered. If there is a real world problem this is solving - please state it. My stance on fsleep() Vs. msleep() in ASYNC probes can be read from discussion (bikeshedding) between me and Nuno ;)
https://lore.kernel.org/all/14a23df0e1828b72b8b03c358980fe08a12bb216.camel@xxxxxxxxx/
Yours,
-- Matti
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~