Linux IIO development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: jean-baptiste.maneyrol@tdk.com
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Jonathan Cameron" <jonathan.cameron@oss.qualcomm.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] iio: inv_sensors: fix estimated value larger than interrupt timestamp
Date: Mon, 24 Aug 2026 18:32:51 +0300	[thread overview]
Message-ID: <aoxkI3SV4IGumncy@ashevche-desk.local> (raw)
In-Reply-To: <20260824-iio-common-inv-sensors-fix-estimated-use-v1-1-6e93506e7e93@tdk.com>

On Mon, Aug 24, 2026 at 05:16:58PM +0200, Jean-Baptiste Maneyrol via B4 Relay wrote:

> When interrupt timestamp interval is not valid, we use an estimated value
> that can in rare case be bigger than the interrupt timestamp. This is
> obviously wrong, so better use interrupt timestamp in this case.

...

> -		ts->period = ts->mult * ts->chip_period.val;
> +		ts->period = min(ts->mult * ts->chip_period.val, period);

It's u32 * u32, how is this guaranteed to be always under the u32 result?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-08-24 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 15:16 [PATCH] iio: inv_sensors: fix estimated value larger than interrupt timestamp Jean-Baptiste Maneyrol via B4 Relay
2026-08-24 15:32 ` Andy Shevchenko [this message]
2026-08-25 13:31   ` Jean-Baptiste Maneyrol
2026-08-31  1:18     ` Jonathan Cameron

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=aoxkI3SV4IGumncy@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jic23@kernel.org \
    --cc=jonathan.cameron@oss.qualcomm.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=stable@vger.kernel.org \
    /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