From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (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 C42F5411603 for ; Mon, 2 Mar 2026 15:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772465975; cv=none; b=eWXCJel5pLZMf3wZzPyVmfcpVoO08aYU9+mk3lbptsapeE2uF2NJcgpr5Zvu5ni/0kBRmkpGr2+deJXOZ1vgkMLg5Us9rFmNjQ7/nYSgAMEr72Gs6gnBLSXeyPAe3+XKRb9L0l1pqlhau2w164fBw9tCYBxhjcBriEAHrmAxK7U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772465975; c=relaxed/simple; bh=pu1I02sYh4+cO2CSPw9w87sHzIWlMmVNgS2cffxbA6g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UoYwEqrYpim71ak5zP2rqajwW/GLtu3K7EZIdUehbR3KwcN4jiYTpYEswWJzmscOivvkk80+Xjx6fspa2XcpSn8nyzTPy1TKfIBIbjcm3nAYg2eOxYZvv7PHh652NjFMgliecjsWg6NFltKK11hqU0VfAxmvRkv6VFPy27eSdzc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=c9ZJxG5V; arc=none smtp.client-ip=209.85.210.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="c9ZJxG5V" Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-7d4bc9e48bbso2195777a34.2 for ; Mon, 02 Mar 2026 07:39:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1772465973; x=1773070773; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PQKYDG8QbYnUOgU9BiYmvyjnHkVzeJt+cs+KoB644B4=; b=c9ZJxG5VgiFCXPtHXziRtMzO8J8YRis9FBfWQ2Kd5FqMD/GBW+w1nNZJw43R/WacJA lZHwG4hoJno/SFdgV1t2FIJisYkaXNmhTzMVrgPhHsZ6coC1bqaNQvCqxyKyLDCtUGdq zg/1qCi00TDIXdux+NG4hXcYscxeQAzUAtjCmhb+tmMB4v0/eu8O9TW5u4Z0jgCb0o7W UQd0L9x12O1Zv8QPX9Ba5jOKmBezOAfwAY51NVoDJUASFZAywUJDRg41fq4QwPFa97Gc wFMsyMnA/FxGROhFxv3gPnpjmgIVsk/SdWMT5cWg3XuMPPLJr/KF+Tb2jqmzJ4Y96un7 8ZPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772465973; x=1773070773; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PQKYDG8QbYnUOgU9BiYmvyjnHkVzeJt+cs+KoB644B4=; b=h8MleP5ylC8MoRj86lU5xa/rLIz0G726sQXsdU6g0bi7BoOwTbJmmJ7P1qse9JvHWO bMzfGGRysKzSBHpaDPEpiZhfHn7ZXt9sSlhaSqQnCKajJ/XyLuWgMp8+buqMG5zJDpDm 1xcZdg/W2Fvi+aQuxmZ06x6DkKXfHtHnG/Sc2sPThKUq2P0Z3SONxeTOLsBEBFRDbhsU 7kl/Q+VeMtrkMlpjRbyzcLUgKzt1Z0B6MqA9+MGr+JUvuM656Rcba/t+rLzYK+4zu+NB KJqIiy2vPxRkfmM9AY5I7VakE03pAIuGTUw/ngs58XscEgHf08Ie8JJ9vRVr9WkSEJLK YMzQ== X-Forwarded-Encrypted: i=1; AJvYcCVbsR6L2Ktegumuccv+OjOwMsNau5EsDFdToP3a73xSz+k38npXT6QPZ3CTfVdBPbYtkG0yatHYvWUIwdQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyaODyR3adTTaAtRBHk5w8G4QaYOP8/P+VExP/qMv/uEg2ka36E XZmev8ygUJelNsmYvONmkPPKSHpIV6d43Aueh+6gLrfn8GOVPjmorknQWqM9ZVPswcI= X-Gm-Gg: ATEYQzz23OPdzM78g37JOg53AFa9nihrm493U4rJBCzk/udAuqG7Ec0/Y0UwNZ8hIvh Nueu9YAehtzyUJHvEquCmvyWXKBkfAnFUiixnoENT3C7kqX+hGvFVdM4roWG5fEQVq2EChZLI12 aGJAUey75OPk09hYlFt2DoG7/852CM7oZxNHcUtJGK26e4BNjnBHlp0NUwl3fAU40iu7UA/M2Aw hgo9pDXuFoBlzldX55QmDrk9XytnrkYk3r0o3AJCrjYD2affpkhbMjUekrmD6NKIaWnnvqMscgo /TBQAiiKD+1SdIBmyIszcpydH1cBurV4Vf34Tda/P9oHcvPEW5sdYG513gFapISq8WVDHFcRsNB /CGpGwfgFUo/WNid9rAMpPwUjLASf953WBrSt6vXBPnTXZ3flUBSkwPjkqPkqmP2TFSlrGm+Spp j4ADzRWn5kLkJusD831bfILT7EdhcNp5O2aQ9Lt8RGIsNGvEn4QPRQ+ZA9NmhidEILI4ZSFEh7g g== X-Received: by 2002:a05:6830:854c:10b0:7cf:e3f3:437 with SMTP id 46e09a7af769-7d591bcdb8emr5176114a34.22.1772465972689; Mon, 02 Mar 2026 07:39:32 -0800 (PST) Received: from ?IPV6:2600:8803:e7e4:500:4c09:7c6b:bc48:f2f7? ([2600:8803:e7e4:500:4c09:7c6b:bc48:f2f7]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7d586626869sm10916908a34.16.2026.03.02.07.39.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Mar 2026 07:39:32 -0800 (PST) Message-ID: Date: Mon, 2 Mar 2026 09:39:30 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] iio: buffer: fix timestamp alignment when quaternion in scan To: Andy Shevchenko Cc: Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , =?UTF-8?Q?Lars_M=C3=B6llendorf?= , Lars-Peter Clausen , Greg Kroah-Hartman , Jonathan Cameron , Lixu Zhang , linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260301-iio-fix-timestamp-alignment-v1-0-1a54980bfb90@baylibre.com> <20260301-iio-fix-timestamp-alignment-v1-4-1a54980bfb90@baylibre.com> Content-Language: en-US From: David Lechner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/2/26 2:47 AM, Andy Shevchenko wrote: > On Sun, Mar 01, 2026 at 02:24:53PM -0600, David Lechner wrote: >> Fix timestamp alignment when a scan buffer contains an element larger >> than sizeof(int64_t). Currently s32 quaternions are the only such >> element, and the one driver that has this (hid-sensor-rotation) has a >> workaround in place already so this change does not affect it. >> >> Previously, we assumed that the timestamp would always be 8-byte aligned >> relative to the end of the scan buffer, but in the case of a scan buffer >> a 16-byte quaternion vector, scan_bytes == 32, but the timestamp needs >> to be placed at offset 16, not 24. > > ... > >> - ((int64_t *)data)[ts_offset] = timestamp; > >> + *(int64_t *)(data + ts_offset) = timestamp; > > What's the point in modifying this? The comment you added suffice for > the original line. > ts_offset is now in bytes rather than number of int64_t elements. So ((int64_t *)data)[ts_offset] would now 8x past the end of the array.