From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 19B0A3E6399 for ; Tue, 25 Aug 2026 08:52:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787647932; cv=none; b=oz+ykvWBQaawaCSLpRPgcxr7H3guckV16ugAEBV+/Im1HaYYyR8cNFUZE3kkHfdnwD3dZhL6ccwcl8QVdFp/QjaliR66eXVP+y8Am6WCHIlIdKS0JwQ6L0rs5kzzWhpp129uin2S4BL9Q9cbvgGVejhMBERPYLmZqFgR0lCaAew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787647932; c=relaxed/simple; bh=VKMDL07sLr7LbZt82TUIHGSLkr70YD0v/4T4k6XUbRE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ho9QcM//iMJrmBysndBnLNbVmx701aNIdo4cZTH8FUm7dNmFp5dNSmVXwxs6NtwYAuAVwy578MWmewlapik25iqnmRZPcAA5yyUxKSXaTGuQVflEpjkFSAhgJwqlsctc9y+topFJ9rmM+ImmURcPDqtGFj3fuEMY8lAQyoWaAj4= 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=FJWbO6VD; arc=none smtp.client-ip=209.85.214.170 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="FJWbO6VD" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2ceaf8a1265so51034865ad.2 for ; Tue, 25 Aug 2026 01:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787647929; x=1788252729; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=SeFWWXdSP58uLbYYiN12WkJAIPfpSpNXceEQnAekcAE=; b=FJWbO6VD715FFuzv49kcEGd5Wql+3MUoq3CvxsFgdG7fSPuFw8ZBWj7y3XRhOGfi5h zQY142bo+I7N9duxT3Y7ENqhhwoCuHslNGgN3bET8wDVHmnje3GW1qsK5asGdNz/AOTw Qj5Q9BWhW6Brl4G4O+fZBLuDrlDjsvwG44Fzo8K578Kj9Db5ANj/2ReOJMuR2hdXyjt8 cufblxozeVc9D8WeIwMqRFSPsqdmQraHIBdDigcVy983Jr3VOe6/5Xg1Lbv2LNPJCz6x Qer1eInjBEGARLXzmb5k6QWOd5n1R+gVrgl3K2g4vjocj2jpUxY8KDfFWMXTymUxxVLQ ii4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787647929; x=1788252729; h=content-transfer-encoding:mime-version: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=SeFWWXdSP58uLbYYiN12WkJAIPfpSpNXceEQnAekcAE=; b=Sl2SbzgJdwnmLJrngtBxKff96gmxxIC4dYJZpXSLsoGhgBuh+5oa9CeviUd4GGHQKs mBcOly0fpzI90pM+UVcNE35p4w2iscVUSzJg03/nDnmZNWpn8doaOKcaQB7naN3T7zOr 103bsvscqMZYzHqlEnX22f+oXtdmLmR1jVTVRzNdBuwfjSKjIMcIgFBCFb5xzz3PvnXn hLdBW/2szeziWA8lRMflUCxLNUXaoWfC2Ht1bplByXcF5cELpgcUH0HW1xkp+/Ht7/Xj DyjueuZg7FZu8iIrdND4m2DQbXJzWa/kiCyrZ5zLvOA4D2UBO/SiQSEuQ9jM5I2iLf3t dUlQ== X-Forwarded-Encrypted: i=1; AHgh+RrjgiKU/u8Mdvs6og2T5cF+Om0Yvp8ZbTQXjETx1MTShGUD1m3SIpLtSHTuwPsGv1P7sND05NCjekQKBhQ=@vger.kernel.org X-Gm-Message-State: AFuF++ls57BOgklLOsseQuV7mJ3Z5c5c7wN4M6ir428+CYXuN2detBMq jEvNeZuZEZWgLnvFRjknvhW6xzck8xu/KAYqYcPnqc1bpuWVR6wtfBnd X-Gm-Gg: AR+sD1197dnx/CEpITmeuN/gynYcyc6E/p2Es/TGekrUY4+asOIXh4D9rSiVHttiCRl bYG+DdSW2UKjDsKJKVr3JVwyQvyX0A743eHqxztn6c+QW4iuzlEej0lsPqEJjMllePJz80PU2Fk 1DU5RlO+OwYSwsAKvy0clQWynWPLxQkAIf7D47vjlUcsidkL874lUSUhjMJFCONISZ2uNY55M7d wDupbI7aZcX/Bk4l9eBa188NFyFI0DZbsm3EaPBkeVpaniKaqA1QVU3AyGlwGjg0CXObN8NgDDg NCBoDX2BzpK2VjyKqNI4OzyXULAot3LRu+RhC5IF1rEMVHNskkR2ASU7f0P5naAFkA3kFGlIpKd 9dxtzGdjGzrKuShdYYR3CEwfPthT0zVK6dgQC2ymRaKcKs1ThLLkhxB8hxKBGZh0xMSPEnKr+ps OtcMimE5ds8FV+ZeBiE5hI5Ti4MTDYnHJdYoqlnwzczq6v9S5AB6YV1ld1aJXFcUBClPRBeuB72 OBlRBY= X-Received: by 2002:a17:902:e552:b0:2d1:1f73:3667 with SMTP id d9443c01a7336-2d64ae3b141mr490183535ad.1.1787647929346; Tue, 25 Aug 2026 01:52:09 -0700 (PDT) Received: from shrey-Mi.local ([106.51.251.74]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327f90c0a59sm42032202eec.9.2026.08.25.01.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2026 01:52:08 -0700 (PDT) From: Yash Suthar To: jic23@kernel.org Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, andriy.shevchenko@intel.com, grondon@gmail.com, linusw@kernel.org, hexlabsecurity@proton.me, sakari.ailus@linux.intel.com, srinivas.pandruvada@linux.intel.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Yash Suthar Subject: [PATCH v3 0/3] iio: accel: bmc150: DMA-safe buffers and use iio_push_to_buffers_with_ts() Date: Tue, 25 Aug 2026 14:21:53 +0530 Message-ID: <20260825085156.212042-1-yashsuthar983@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The trigger path used a plain s16 buffer while the FIFO path already had a properly typed scan member (__le16 + aligned timestamp). Those two buffers did the same job, and s16 does not represent little-endian data. Drop the duplicate, keep scan at the end of struct bmc150_accel_data with IIO_DMA_MINALIGN, and use it for both the trigger and FIFO paths. The FIFO and read_raw buffers are passed to regmap bulk/raw reads, which is not DMA-safe. Move them into struct bmc150_accel_data after the aligned scan buffer. Because all buffers are serialized by data->mutex, placing them after scan ensures DMA safety without needing separate alignment. Finally, replace the deprecated iio_push_to_buffers_with_timestamp() with iio_push_to_buffers_with_ts() so the push sites pass an explicit buffer size. This supersedes the earlier standalone patches: Link: https://lore.kernel.org/linux-iio/20260808220236.421832-1-yashsuthar983@gmail.com/ Link: https://lore.kernel.org/linux-iio/20260809111303.496393-1-yashsuthar983@gmail.com/ Link to v1: https://lore.kernel.org/all/20260814101845.301769-1-yashsuthar983@gmail.com/ Link to v2: https://lore.kernel.org/linux-iio/20260815175728.99541-1-yashsuthar983@gmail.com/ Changes in v3: - patch 1: hold mutex for both the read and push to guarantee DMA safety - patch 1: drop unused AXIS_MAX and use sizeof(data->scan.channels) - patch 2: remove redundant __aligned(IIO_DMA_MINALIGN) from fifo_buff and regval, as the mutex serializes access - patch 2: fix comma typo in commit message Changes in v2: - patch 1: restore early error check flow - patch 2: keep fifo_buff declaration in one line Yash Suthar (3): iio: accel: bmc150: use aligned scan buffer for both trigger and fifo iio: accel: bmc150: use DMA-safe buffers for regmap bulk reads iio: accel: bmc150: use iio_push_to_buffers_with_ts() drivers/iio/accel/bmc150-accel-core.c | 28 +++++++++++++-------------- drivers/iio/accel/bmc150-accel.h | 19 +++++++++--------- 2 files changed, 23 insertions(+), 24 deletions(-) -- 2.43.0