From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF2AEC369CF for ; Fri, 18 Apr 2025 15:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=32dAjmITtM2kUNZRqmuxKuI8linc1DnDk8E0d9qbS1c=; b=bU20oclecVUunfxwm9q6asnPbY xJGOQhStmf3pUt/10jAeMXyEbG9pffT+/lrUEsMsual/6WvABYbfKs0EnxL5Q9ZxH220esVabQp6A Je0+DfPndw+Cb/1cLnK0Rp2tzXsKkR7ec/G2X2UF5l6F7jwihXmF+Il5F+fznY80XLH/6L9okxrjQ y6nPJX9Km/zEfS4uy1VCo1ri/QYeTk69rhvLZgQ7TYVuH8rRVhIVH/vZQGVDhlTCTiVsvDEHhF/xl GRiiR00+Sd+twAvoDYx9jGWuDB8VFylqCGG4Gbn9YwHrL1ed+rY40iaF9JUzgyHHsv8zsiOxL3UTg dM+rK9Pw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u5nRK-0000000GcT7-13xB; Fri, 18 Apr 2025 15:15:38 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u5nLR-0000000GapO-2eVp; Fri, 18 Apr 2025 15:09:34 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 7ED19A4B45A; Fri, 18 Apr 2025 15:04:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B6D5C4CEE2; Fri, 18 Apr 2025 15:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744988972; bh=OjvDIgahnZog5eJn8g2EKzm+1K2gEPP7qqBE5WS9ucY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ozI3u+Tx7lvInAjyN8zoQlgZhwS1RX+enBxm2JRv6FjAWwSNpEVe8QVge6Bwsjse+ n1K0Sv21l/UCp1S6hx8PRCmkm2egZRYLaeIC7Wlni9zEctU7qfEcbEYiaDOaRKmZhI Wr1JFSlQOhKRRct+871eJ9VwOxeowlawv5RaSIVPCoo/vxrFqU+0lQfsAz+z7yuL7+ i/kPV1IrSs8UIrbdd/z9Aj/e93P6xR8UUlU1GF5Alu8MadIA5Q4cF7km0Sv7nrTP5g ir+N8W32qis2OvbWRBMXxGH5EVCcT3I2F4uIncyQEM4U134IHAHaOFwQm81UaGPgWy L/mE6B6bJdH/Q== Date: Fri, 18 Apr 2025 16:09:22 +0100 From: Jonathan Cameron To: Jean-Baptiste Maneyrol Cc: Jonathan Cameron , Andy Shevchenko , David Lechner , Nuno =?UTF-8?B?U8Oh?= , Matthias Brugger , AngeloGioacchino Del Regno , Lars-Peter Clausen , Michael Hennerich , Cosmin Tanislav , Tomasz Duszynski , Andreas Klinger , Petre Rodan , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" Subject: Re: [PATCH 7/8] iio: imu: inv_mpu6050: align buffer for timestamp Message-ID: <20250418160922.33bffa7f@jic23-huawei> In-Reply-To: <20250418160238.204701e7@jic23-huawei> References: <20250417-iio-more-timestamp-alignment-v1-0-eafac1e22318@baylibre.com> <20250417-iio-more-timestamp-alignment-v1-7-eafac1e22318@baylibre.com> <20250417184620.00006ae6@huawei.com> <20250418160238.204701e7@jic23-huawei> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.48; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250418_080933_805066_CE1A67D2 X-CRM114-Status: GOOD ( 27.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 18 Apr 2025 16:02:38 +0100 Jonathan Cameron wrote: > On Fri, 18 Apr 2025 11:26:39 +0000 > Jean-Baptiste Maneyrol wrote: > > > On Thu, 17 Apr 2025 19:46:00, Jonathan Cameron wrote: > > > On Thu, 17 Apr 2025 20:00:05 +0300 > > > Andy Shevchenko wrote: > > > > > > > On Thu, Apr 17, 2025 at 11:52:39AM -0500, David Lechner wrote: > > > > > Align the buffer used with iio_push_to_buffers_with_timestamp() to > > > > > ensure the s64 timestamp is aligned to 8 bytes. > > > > > > > > Same question as per previous patch. > > > > > > > In this case I don't think we know the position of the timestamp > > > so a structure would be misleading. > > > > > > The comment above the define certainly suggests it is variable.. > > > > I confirm timestamp position is changing depending on channels enabled. It > > can be at address 8, 16 or 24. > > > > If there is only 1 sensor enabled (6 bytes of data), timestamp is at address > > 8. 2 sensors (12 bytes of data), timestamp will be at address 16. 3 sensors > > for MPU-9xxx (19 bytes of data), timestamp will be at address 24. > > > > If the buffer is aligned on 8 bytes, it will always work without any problem. > > > > > > > > /* > > > * Maximum of 6 + 6 + 2 + 7 (for MPU9x50) = 21 round up to 24 and plus 8. > > > * May be less if fewer channels are enabled, as long as the timestamp > > > * remains 8 byte aligned > > > */ > > > #define INV_MPU6050_OUTPUT_DATA_SIZE 32 > > > > Thanks, > > JB > > I applied this one as it stands with fixes tag and +CC stable. > > Fixes: 0829edc43e0a ("iio: imu: inv_mpu6050: read the full fifo when processing data") > > I thought about seeing if all the cases that are fixes are separable enough > to take through togreg-fixes whilst the with_ts() series goes through togreg > in parallel. I might see if that is doable easily. > I have done so and it seems fine as we didn't rename anything... 52d349884738 (HEAD -> fixes-togreg) iio: adc: ad7266: Fix potential timestamp alignment issue. ffbc26bc91c1 iio: adc: ad7768-1: Fix insufficient alignment of timestamp. 5097eaae98e5 iio: adc: dln2: Use aligned_s64 for timestamp 1bb942287e05 iio: accel: adxl355: Make timestamp 64-bit aligned using aligned_s64 f79aeb6c631b iio: temp: maxim-thermocouple: Fix potential lack of DMA safe buffer. 6ffa69867405 iio: chemical: pms7003: use aligned_s64 for timestamp bb49d940344b iio: chemical: sps30: use aligned_s64 for timestamp Now on the fixes-togreg branch of iio.git. > Jonathan