From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795897262; b=4IYl5Uw7XahDNr/N/4l74minzPs/2HkR0CHhy0FO2ji4KOF47Vd6zbb2baFg7f++MHCl 0cCOA/5dvN6HT0fUTB9xG0EOqVw9KnbXmFpb08stQsQGoUA9SE/FieHmWxSgahmHpW79V Ukq3SedCqYyy0KvTOtlNL2bzITH69D7ic/2/jAsXMgWQUjsX0T/YeUMt88zIJ0xnV1dJg MK28UvY0tMzmBPAkI9Wv7AMyCPTWAiEZEcUyXyk3iDViWH+oRtKVXYOp9OKIoZ0wijQje 1AVEVX1NaJdzYxM7xo85jnSzf1Jz0IzU5N1SW/jeYkDTx3cwGdK4Z1Ci0gDy2Zi6fcA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795897262; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=1Vvz3jFaCbvc6db1U2SG8/m6SnoStjhhe3DRRLOvh58=; b=0W404Ye9tQRkVz0YBq7AlEyepVi4GeP8N5+0o4c7KIk7AadRKRGE2YZrajmSreARQHZ6 lPj+t7T1aOK/3d/GCBLKUbFkBdr+lJugXDbbNDYzvNVwCzzo1fVgjI/SN3WfgXGhMaP/2 NCY2E8ZQq3jUtJcvmOIIqUK7lXx73qLZQBtwfVwXERgKxLbuQl6lbBu8zeKzmWVCMpnf1 0SN9mZiAF0jf3fL9WCMoaCq/G12Rf97l1bunbl4wS/G5vupkZgHOXD3gRgirDXvTHz6mw glUwxYhvO+qQjns+KuCitIzCR1GHb/WKvA0uD2cuCTDQDYHI/10VzkEfsHNYZZeizjA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="RcpU+0o/"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C628A606A321; Sat, 28 Nov 2026 20:21:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RcpU+0o/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id A12F31F00893; Sat, 28 Nov 2026 20:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795897262; bh=1Vvz3jFaCbvc6db1U2SG8/m6SnoStjhhe3DRRLOvh58=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=RcpU+0o/RpH5Ry2zXeBYI3veZBX39P6DBRT4I5KDH+9g2nNBtOTb2mFO0EabY41ly 0ZOSUYmwnUACTPTycBVaWrtWsF0R2MlqUpvOHUkXFFMTBEg2gaIoIHVDNSTn+HzB8g wHYVpeRk3SW1w9LbMIHHgXT3sK34YpCY+cHMwEeVPoYuV4hr14VPae8SFY8PZXT3nX phWGtQJLLmRMaOVaOGb3caGHeAMzIQFRUp6UswVBjpzntlaIQDM9MI1/NV+vJH+fi2 PnVRWyOYSse3ygp3ES6u7elt50C8/1JHrLm6j8KBohAkcls7ktt2QkSBD36+Q/ymDn ITipdD/O5WFow== Date: Sat, 28 Nov 2026 20:20:54 +0000 From: Jonathan Cameron To: Liu Yufei Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Alex Lanzano , David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , Gustavo Silva , stable@vger.kernel.org Subject: Re: [PATCH v3] iio: imu: bmi270: fix zero timestamp in triggered buffer Message-ID: <20261128202016.00b12e44@jic23-hlaptop> In-Reply-To: <20261124-bmi270-fix-timestamp-v3-1-6356a5467d5a@gmail.com> References: <20261124-bmi270-fix-timestamp-v3-1-6356a5467d5a@gmail.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 24 Nov 2026 17:10:07 +0800 Liu Yufei wrote: > The BMI270's own trigger uses iio_trigger_poll_nested() from > the threaded IRQ handler, bypassing the pollfunc top half. > This leaves the buffer timestamp at zero or a stale value. > > Capture the timestamp in the hard IRQ handler and use it when > the selected trigger is the BMI270's own trigger. For an > external trigger, take the timestamp in the threaded buffer > handler before reading the sensor. Drop the pollfunc top half > now that the buffer handler always supplies the timestamp. > > On an Orange Pi Zero 2W, the original driver produced 256 zero > timestamps in 256 samples with the BMI270's own trigger. > > Fixes: a1854d55f54b ("iio: imu: bmi270: add support for data ready interrupt trigger") > Cc: stable@vger.kernel.org > Signed-off-by: Liu Yufei So this got a little messy because the driver was updated (by me) this cycle to use the iio_push_to_buffers_with_ts() helper. As such I'm going to apply this the slow way and then we can look at backports as needed. Applied to the testing branch of iio.git with that conflict resolved. Longer term, I'm trying to stop drivers using iio_dev->trig directly but that can just get swept up in that series. Even longer term I want to spend some time looking at a generic way of dealing with this timestamp issue but that's a way off given my backlog of things to sort. Thanks, Jonathan