From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 903914399E6 for ; Mon, 10 Aug 2026 21:58:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786399090; cv=none; b=qGnUJFQIT7/mZVZ1+F5V9PI4KZxNODpK083h/K3JrOieh6uBBhiOGvr4sIMK6zM0bfZLMegwdRm8wNdS0q4XYCvDMwxVvsjyi2Gm9InNYRftoNmV3PIkTx2NnzrTaMVRxCJ3UfoNBm0bVCba0/xwyvmD06YzxvOXNO2rY20REiQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786399090; c=relaxed/simple; bh=FZ+/71kynJZqIhRLVCnpGq9DzPUvEW+6dLYoLNMlYPY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KGk8IXd+xn/5D2aTC1enK9VznPmRzCcWoAD4dqMBpEZlwAOKU6IW30ZSlJ/5Gq6FGf/qqXnlwu1gnzcI+9fxOfsjPEIQlC1dR8/K49Pd1FqZcqRXKbHER13ej2cKGrhYzLcPKCbGg/Y4E0SCupt0XwxlCpw7lkUnOtFNksw1uE0= 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=S3gX9Dz4; arc=none smtp.client-ip=209.85.210.171 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="S3gX9Dz4" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-8487214ad2bso3114990b3a.1 for ; Mon, 10 Aug 2026 14:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786399089; x=1787003889; 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:content-type; bh=d7bGIdvE0TviHkwGAKBCM6Lg6niDAldjBWkfqCqVxew=; b=S3gX9Dz4Pc1HKmDJ/pIFAotDBLY3uF1uhlnIto77UchCf5I+lCJs+iP+sLC/k3yoC7 w2WbNwKBhsdP8lRc4dToplh8p/iOmwja1Adyfe2upglynyFnmpRNdlgX4M70sHAdDTqa i5loIJU+4LmiqBLvxkPNQlQ6JwHPs2kU6YIXbXAnfMJWkxNiEqJbxinyIF1pwa2y9kYL e2wRRwJDnsa7xwbzIumxAp5ABcuAjb4x1l90QSp9Q0NGxRlwFJ7cloZ8xzfSEkGI9vzD snxLRy6qAMlhyg8EAaA3FpinKk6GBNdyW27xgb728i6X2ozwIYnIbj/zaTTJ1ko89wdh ECCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786399089; x=1787003889; 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:content-type; bh=d7bGIdvE0TviHkwGAKBCM6Lg6niDAldjBWkfqCqVxew=; b=O0Sx7LTTLabsO7uOspl4Qzjsm3641E+O9L98hVbkvH74z0/loeQv/Wa2Yy9GIlJuO1 UswU96ZN2Q/PiHovqbd6jSukNPfQas+piGCrhwTWfIWuMRDPwR3sUoHsCquj2bUcOR0f eEgYOsOm4QKrv9LAeLkfWE3R1JjWhIgJ2JXucHhOmlck04/8wCsyjShO+WNjX83jwmVg lQnphYdRWzi6rKEWrO0x9jVlhOhQIMj5QsIkFBZL9W6Ei34un6xmvLu27XsoJUkGFq4o W0WlRDrFTDYVhV2ayZ72fBufZwA4obPj+fTtICcEIqvJog2ThJmxqyGlspN3ZN+JoOex ImVw== X-Forwarded-Encrypted: i=1; AHgh+RqpPabZR0r3hBBiChT8d97KaO/z6sMbRtUkTXJoFqej4Ht/bXhu967/Xr28IhqZxP01SVsuT7vyGBaFD7g=@vger.kernel.org X-Gm-Message-State: AOJu0Yyq5snmJawMrB8gbaMV0JR+/1x7RkLazV2Pi8p8koGnbLvwThfK Qb98IOMooSNdRxn7b11qKtaV7K0mYq811yrfpBk8pf3RV6oJfOCaySIN X-Gm-Gg: AR+sD11WRp+4JShGwhDQAQN+c0cBEtA46d96HiSwIMl7gv/cHwZ1UGOX9bdabGlPHfV JEeDUMqR7UH/7MTfBmA3Y1tgh3Fci7j5X5pbLgTOfZBVNFoPiGddMS3B14ygIvcCmwnZSP7NeLq cfun1MsaZ0u0nSmgmewCKYpIyYUCw0eQ3bpqDKiR8+NS/AjEPgoJz121SZvl0yBqfX3Dl8sb13g T1pDg9Sl4WyvxPIi5/pJNWnadp0KepV9sB/wQbzAktp26sYIVrdEReRxlcZdoGC8L//O939sWc3 WH/sHCF1OO5teqfjhLVN1tfVZaEEAACyLL6FvwwtERCifNo1tTmMonl217fSDE4ZfnI5ljizeWl KB9zAfMlhT6PtZZHmosyGckx37CARXa9TOOv/azgzSBN87Mqjd9Gs0HnOIqVy+4aAYvUki1I5de OlJWW0Z0oJ316YF8bd8IF2NplGC8Sa0JRvPm8BKM+qQ8N5EYgqXwV0S5aNBRpR9LNwSsNlWk9jQ zseY4SzGQ== X-Received: by 2002:a05:6a00:1150:b0:845:c5d5:3745 with SMTP id d2e1a72fcca58-84f5e10f964mr27414921b3a.34.1786399088547; Mon, 10 Aug 2026 14:58:08 -0700 (PDT) Received: from yash-Bravo-15-B5DD.. ([2402:8100:2aa2:1af5:b8c4:d4c2:cc72:1386]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbe8f38b7d9sm4508200a12.32.2026.08.10.14.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Aug 2026 14:58:07 -0700 (PDT) From: Yash Suthar To: jic23@kernel.org Cc: andriy.shevchenko@intel.com, andy@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] iio: accel: bmc150: use IIO_DECLARE_BUFFER_WITH_TS Date: Tue, 11 Aug 2026 03:28:00 +0530 Message-ID: <20260810215800.55944-1-yashsuthar983@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260810001852.6afc2c2e@jic23-huawei> References: <20260810001852.6afc2c2e@jic23-huawei> 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 Mon, Aug 10, 2026 at 12:00:05PM +0300, Andy Shevchenko wrote: > > So what is going on here? > > AI slop? No. I only intended to convert buffer to IIO_DECLARE_BUFFER_WITH_TS() and dont want to mix it with the existing scan member. Really sorry for that i should have asked. On Mon, Aug 10, 2026 at 12:18:52AM +0100, Jonathan Cameron wrote: > Given the data alignment is fixed, if we were going to do this it would > be clearer as > struct { > s16 chans[3]; //see later, I believe this should be __le16 > aligned_s64 timestamp; > }; > > But that is very similar to the structure that follows immediately after > this, but that has __le16 chans[] > > So what is going on here? > ... > The chan spec is little endian so the scan one is more correct. > > So I think the fix for this issue is move the scan element to the end of > struct bmc150_accel_data and mark it with __aligned(IIO_DMA_MINALIGN); > > Then use that for both the bmc150_accel_trigger_handler() and > __bmc150_accel_fifo_flush() paths. A second fix will resolve the local > buffer in __bmc150_accel_fifo_flush() that is being used for a bulk > regmap transfer that may need a dma safe buffer. > > Please combine these two fixes (if you agree with my analysis) with a > follow up to do the iio_push_to_buffers_with_ts() all in one series > as they will be touching the same code. Thanks, Jonathan. I agree with your analysis. On type, kept s16 because that was the originally used. I'll keep __le16 and will merge buffer and scan together as you suggested. Will move scan to the end with __aligned(IIO_DMA_MINALIGN) and use it for both trigger handler and fifo flush. A separate patch for the FIFO stack buffer and keep the iio_push_to_buffers_with_ts() change in the same. Yash Suthar