From: sashiko-bot@kernel.org
To: "Guenter Roeck" <linux@roeck-us.net>, linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon: (sht4x) Convert update_interval to jiffies in pending data check
Date: Sun, 01 Nov 2026 01:51:25 +0000 [thread overview]
Message-ID: <sashiko-outbox-192241@kernel.org> (raw)
In-Reply-To: <20261101014756.1921506-1-linux@roeck-us.net>
> In sht4x_read_values(), the check for whether a pending post-heater
> measurement is still fresh compares get_jiffies_64() against
> data->heating_complete + data->update_interval. However,
> data->heating_complete is stored in jiffies whereas data->update_interval
> is stored in milliseconds.
>
> Whenever HZ != 1000, adding data->update_interval directly without
> msecs_to_jiffies() mixes incompatible time units. For example, with the
> default 2000 ms update_interval, the validity window is inflated to 8
> seconds at HZ=250 and 20 seconds at HZ=100 instead of 2 seconds. A read
> within that extended window skips triggering a fresh measurement and
> instead returns and caches the stale post-heating measurement left in the
> sensor's output buffer.
>
> Convert data->update_interval to jiffies using msecs_to_jiffies() when
> computing the pending measurement expiration deadline, matching the
> next_update calculation right below it.
>
> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Fixes: 0eed6fc3d2b9 ("hwmon: (sht4x): add heater support")
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261101014756.1921506-1-linux@roeck-us.net?part=1
prev parent reply other threads:[~2026-11-01 1:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 1:47 [PATCH] hwmon: (sht4x) Convert update_interval to jiffies in pending data check Guenter Roeck
2026-11-01 1:51 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-192241@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox