From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (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 F37FC2F28FF for ; Fri, 14 Aug 2026 10:18:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786702743; cv=none; b=EqWKDUxyAK0O561VTkU4OPBks+z9DfW4WLHr/XeYs/209vqY6VT1k0mcDUY71taOBXMvqkZZUvH+EfTYNv1Z8/vrrVdlz8A7gQjmAY/f/pfQy95D2LPD6fPKfKms1rUSyiEyvgc49BaI2PnDuKy5yJ3ZIHuHgeANuUtfvwZa5V0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786702743; c=relaxed/simple; bh=FOdesGdaNXou5XkibY6IgavdGaoop6u6/nm05YrFSs4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nhrbleUl342Ax7rFbsYo3UxZel2TS0vhekm7goQSTN9VdL6LtPnXaB/hO7+7FvDGTE0iKUEBlHrjmldRDGlPPri7G3xNAAmyL8FRaQgUD/UajlUtw7CpAX1X/DVX6MXKiY8N0hwOx+Gd/f6Dz63Mil2EXhIf8o5/dhm4ZaPUBqc= 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=dgthFY43; arc=none smtp.client-ip=209.85.216.44 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="dgthFY43" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-382ef647e20so793273a91.1 for ; Fri, 14 Aug 2026 03:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786702732; x=1787307532; 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=9uLQmEFa+VWY4gtZ+cCktBxWWCghykwU0UrqU9Ae1N8=; b=dgthFY43nKN1kPqvZShVBNp8JiXKVDuP885S/Gqwp83ilI7qGYZus2vL9/vE5dLvB0 dzIlXDS3MrnwJWpAsMmRyk6Xhy0BKZ4eDlR/xWSLiUsxYWeymwdCbIyr3Mvi04YvHo+t M7sxvtc7KdJFBYpIGYqV4VUqbE9yfJZWbXuHeiyGYJgEa4B7jUdBuubLBzC1CtKq4MXV Y5ShcumQvU/8xLwdTsNHDEamRmQfP1CaMCZe3h4OkSTteChhwVFZmZqNa/kmEEhJGhp1 ceGhhPfXneY8gc2P6i7ZlSNhio3Wl4DrbnJzuW+jQTXRY1YotFxWefAQon9MXVa1fKCg /fbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786702732; x=1787307532; 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=9uLQmEFa+VWY4gtZ+cCktBxWWCghykwU0UrqU9Ae1N8=; b=IVAFjQurXAurIEmfkfdGYIojix9XYwJYtka4sQqHNXy/28HOdKlgDtl1xqiiaFnSYM iUuD6GmitwEXWDFI6xQG73qoJRrnG1/NaadfOKbQIQQz6WEHIGLmyH6idXFgQh1mlia9 5yrQMKMGm97XFZavx+2Kagz5J2Tmy8kBRNjRQzBH4JxsK/dmNLenmY/LbLL3cgCg1kR0 SFG6JhImXBaCX/BDkhEcqjyUcwwZg+Mbd2FuWIVhcfP/VCc9gs/j/YSohTmZEbgzQDAy iX5MhXVT8nVSZoaL2sXmn+up+tOL3+yUAUUrLbrfwZS8l6STN6TAtXnB6ZUCvTSC1w1i GjPw== X-Forwarded-Encrypted: i=1; AHgh+RqEI70XlbnB8pGi0Pdcr6xZo+aJqDOBoAgN8Ebwb3TbXS+mcyprhiwT2m1yoGbehf67oLQnQY9XrQtfj4s=@vger.kernel.org X-Gm-Message-State: AOJu0YxmnyDg+CMBZlwIZFoklckFm+d6iVGqNXQ8h1cecU0aF4VSVLIw tk0K7IlwBIqV+GfHitomZdAzkh1bYg8n041dFrZDcSxjqNGUKwf6UCyZ X-Gm-Gg: AR+sD11tY1FcLkEFXrrudlByPap1o/cbHS+gYU35IBMHpufRaS6sVyu6FdMASbwnzRL /tp8VO+WFhy4e9NrYjuFt9VMdXj5RcXxcqMh0JSatLjESbd4svUySBxTrDYIq9ALKELhmftcDWD CFxJJK3T9lbQyd9Po4LjM/+HgrdAeva8VPxVEtZkCiyGs4aLEPEb3k3z1dNLY7kPd7yLn9mus5M /El19jNKICB6EdpVwM0buO/WKZewo00UO7Z6CjuT5IAMm9VG5bNkBqqUroh7uiyDCe1ge+CpsU9 qIrbOReFTXwhE2lt6k9addk7f4f0TSj+YXn6CjJBUQDVUfAB8adGlioAMwF8k8FJFZ5e2Ut3kVS H5mdH3TKhJUhLBGBngHvWTzyeJkc9nh0PzU8xiSaVEkJ94iZNU9bLgqWtrieRWwlZz5RHwt/5Z8 GeNfJ7hratLEvLbmf+bgNOl8nGX4jC+j0miBG1pI59sst7AnOkNVcvOegJBvTCbbg+drxtxqJom E+ipJxI X-Received: by 2002:a17:90b:5624:b0:38e:7f1b:efa with SMTP id 98e67ed59e1d1-3933e5c4f30mr5205423a91.11.1786702732409; Fri, 14 Aug 2026 03:18:52 -0700 (PDT) Received: from yash-Bravo-15-B5DD.. ([2409:40d4:124c:2e49:6997:3d3f:909e:c279]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-394e920ba18sm2074218a91.0.2026.08.14.03.18.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 03:18:51 -0700 (PDT) From: Yash Suthar To: jic23@kernel.org Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, yashsuthar983@gmail.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 Subject: [PATCH 0/3] iio: accel: bmc150: DMA-safe buffers and use iio_push_to_buffers_with_ts() Date: Fri, 14 Aug 2026 15:48:41 +0530 Message-ID: <20260814101845.301769-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 scan and aligned to IIO_DMA_MINALIGN. 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/ 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 | 20 ++++++++++--------- 2 files changed, 23 insertions(+), 25 deletions(-) -- 2.43.0