From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 336C42E542C for ; Sun, 17 May 2026 07:14:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779002094; cv=none; b=qpAyeeCA5MQrDPXj37/7gJmiJz6Vt8IrDWsgHonLrHETiv7rI0EaVEQRokqml60RpsCw9lPKzgUMyqZoMf6sNJgRyeSnyrO5HqDab04t+TwlLYV17ahPcbxHzgN/K6oBUyr9ri54uwokwmMkuLjbMeJHChyt2L567vg7kfWkXwo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779002094; c=relaxed/simple; bh=C5qrnk4Px0wKxbXP4sbzY4z34/g99Sb7h7icaX534vo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=r53NwL9ppN9IfitHYXzsVMbmYq1HMXifwecH8dKhguiChEi6Vgwxeh7FLkCOYPB75j09pPNgtSIIYTA/PNUSTCdKjgYWmvqtFhUU2OhSrpaQJ7xfgAVy0T/5RXbuaxbPfSqfTjrHgdS1GM00B+esFjTHNC4MS464rBAPUM45rBQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SO5WeQgm; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SO5WeQgm" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4891c569cb1so1502995e9.2 for ; Sun, 17 May 2026 00:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779002091; x=1779606891; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J7+d33LTVY4ueQPeXmqnQ0x+waqN6RxnFKa13re1Dn8=; b=SO5WeQgm3w8fZ8X7eU/Flm6INE1JdQVMiVPM8mBOFGcUTV4doibrAI5pTalk4PZMNH 1KrqSQTvLqer7oOMGmmpoHvbHKbJuJqi3x4ICn+8dBWYERJf9J4CveEhcNivEPFVPkCy QIjYLT9bSLrAbBEHROcN2+khlOtbfBNMUezNl+ZOnN7IgC5mF4bP6DOQftks4krjxs+H vpiKHQ4FK22TXFJ0xmiu6AimPs0Wk7mWoKJCT3Og3D97LLyz17dyeQbjPtPkT7aY/Q83 UcJu6qjvN1hCy16tNxXDgsbyVtqY2yCgJd02yWNbpQo2w4HgipuKgla6WSjvAldQKkrg bXkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779002091; x=1779606891; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=J7+d33LTVY4ueQPeXmqnQ0x+waqN6RxnFKa13re1Dn8=; b=enmKcGQZu4ZFMm934o3sGP5nIKpRpgRoV6IjLbAv7gnndLsR6DjAQed2SlvkvYs2Nx LRvtTp2YGYmOJBgJuv1jDetf1iRNR266Sfc5/D5CHLBGx15L+h42x142WPS+JSoPYyoL uv1g9Qwi2kRsizHe9FXPvhEGuRiT3hZAbs3inXolUZIMHyN4AdiWiK+a1mYEvCAx3jzw MfG//q92BXNGQ7wxsaKMyRLZl6NKz6KCZOpGE4DA3z67tYs3Ad6om77aPC7GFgqPbKVj GyhbOaYR52q04gvAhdnHMKnJhlsQfiwhJ1HMzOWuAPVywlhUumnQSjpjsfHOtVuAn0c0 Ur4g== X-Forwarded-Encrypted: i=1; AFNElJ9/z4V9/EPqcbYQe+NVEu72pGjeJN+u3XUzkO9MkQXoLotkat0rE65QKll18xYovvDTSofoDdC3EFQRsgY=@vger.kernel.org X-Gm-Message-State: AOJu0Yx24Mvk8aSkbUgWfvc6hRCukky3R7ShBCIl65RsXWKJh6D4FIHx UyeWnrkU6bfqTzkK+sx0k9+QxSiH756aTBDYZ7tzxnLrzkbz3OpPK/oe X-Gm-Gg: Acq92OE2hV47dv9eKqzLaffNIHaThn6uaEs3OMIXd1Aum0U2UoA5wIm6fCPJKLnPqVt ohHrIiFh8xDzzoSfIbY0g70amc/rVoZ+n8wyP8VFTUym3xoO/Qfi7rkn1i26b50fDKfc4f92yvX OTiZqYOCfUFq+eeVDb0Gg3tqIas8wM5Zq6rBJvGUiI+kTYx6gim+Eb6Ccel1QiAoT8R2vtDkGjy JbpzuZ+2hyBaHurWhGgZX5U7FmDI8mBWQguu9tubBWexEEe0i4WZ9jeedMLk5WlOfVBMPj8ODUY ZqArKHlNgmO3EZ2+CApwSI5ohPQ6BQPnMrui1HhG3hDjm5N0pxAjKTg+nfJBWyyGOTFP93YuHtq xJo9sYEDrIIQTcbwJ6KbE49P021gi9mwhfoZoY+sTA1FiF7JOlx+TiJ6ATELZAXF6TAfUXfbkdR Awr3XFA0Mccc3t0U9J9Ymc+CXzzT/Z0ESIWZlMLMFx6sbu X-Received: by 2002:a05:600c:5489:b0:48a:5546:619e with SMTP id 5b1f17b1804b1-48fe61f5830mr79209985e9.4.1779002091368; Sun, 17 May 2026 00:14:51 -0700 (PDT) Received: from localhost.localdomain ([82.215.118.79]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48febe66544sm53656145e9.23.2026.05.17.00.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2026 00:14:50 -0700 (PDT) From: Stepan Ionichev To: shofiqtest@gmail.com Cc: jic23@kernel.org, lars@metafoo.de, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Stepan Ionichev Subject: Re: [PATCH v2] iio: accel: adxl372: Add timestamp to FIFO data Date: Sun, 17 May 2026 12:14:35 +0500 Message-Id: <20260517071436.61-1-sozdayvek@gmail.com> X-Mailer: git-send-email 2.33.0.windows.2 In-Reply-To: <20260516211935.36773-1-shofiqtest@gmail.com> References: <20260516211935.36773-1-shofiqtest@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Sat, May 16, 2026, Md Shofiqul Islam wrote: > + iio_push_to_buffers_with_ts(indio_dev, &st->fifo_buf[i], > + st->fifo_set_size * sizeof(__be16), > + ts); On top of David's note about the size argument, the bigger issue is that iio_push_to_buffers_with_ts() writes the timestamp into the buffer it was given, at offset (scan_bytes - sizeof(s64)) from the passed pointer. For the 3-channel scan here scan_bytes is 16, so the s64 lands at &fifo_buf[i + 4]. With fifo_set_size == 3 that overlaps the next iteration's samples in the same array, so the following push reads partially overwritten data. iio_push_to_buffers_with_ts_unaligned() copies into an internal aligned bounce buffer instead and does not touch the caller's data, which fits this looped FIFO-drain pattern. Alternatively, the v1 shape with a small local scan struct and a memcpy per iteration works too. Stepan