From patchwork Tue May 3 08:58:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E383CC433F5 for ; Tue, 3 May 2022 08:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232984AbiECIz2 (ORCPT ); Tue, 3 May 2022 04:55:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECIz1 (ORCPT ); Tue, 3 May 2022 04:55:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D1A921817 for ; Tue, 3 May 2022 01:51:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B46276128D for ; Tue, 3 May 2022 08:51:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F185C385B1; Tue, 3 May 2022 08:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651567914; bh=h9r3d73XPxk1oBrIlOcP2R/gKealCiOCT99s4IAnug8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FGSH71V2F/Ojvca6Mqn9fsuzqBNse1L38CnWZ4/LOYjLPqCWnDNO0PBIpH7udadpa nLmfo7XfoKfG99ooamnA013ovSrJR+Y9t3RplahO3IegR+jzPVUnmK6Nji1UcJlXQp BO2wQLrllx54q4zlh6V+jolAwWkGPBfEtJ3WftKLO+hfRuSOZ85t+V2hnbOe98y97G BsRVi13H2w4ZY4WyS5F+g3FAIGVeE/R78qN8qBiTOxi+gVfoqSFuku+ghoN/epxiuP 5uPNcrlPeUREeF2Iimc2i8aS+wKWWQZwRXELjOw9JBQ16PyCc6VZUTor5YEMi7nuW2 57+ZYv3hUi55Q== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 01/92] iio: core: Fix IIO_ALIGN as it was not sufficiently large on some platforms. Date: Tue, 3 May 2022 09:58:04 +0100 Message-Id: <20220503085935.1533814-2-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Discussion of the series: https://lore.kernel.org/all/20220405135758.774016-1-catalin.marinas@arm.com/ mm, arm64: Reduce ARCH_KMALLOC_MINALIGN brought to my attention that our current IIO usage of L1CACHE_ALIGN is insufficient as their are Arm platforms out their with non coherent DMA and larger cache lines at at higher levels of their cache hierarchy. Note this patch will greatly reduce the padding on some architectures that have smaller requirements for DMA safe buffers. The history of changing values of ARCH_KMALLOC_MINALIGN via ARCH_DMA_MINALIGN on arm64 is rather complex. I'm not tagging this as fixing a particular patch from that route as it's not clear what to tag. Most recently a change to bring them back inline was reverted because of some Qualcomm Kryo cores with an L2 cache with 128-byte lines sitting above the point of coherency. c1132702c71f Revert "arm64: cache: Lower ARCH_DMA_MINALIGN to 64 (L1_CACHE_BYTES)" That reverts: 65688d2a05de arm64: cache: Lower ARCH_DMA_MINALIGN to 64 (L1_CACHE_BYTES) which refers to the change originally being motivated by Thunder x1 performance rather than correctness. Fixes: 6f7c8ee585e9d ("staging:iio: Add ability to allocate private data space to iio_allocate_device") Signed-off-by: Jonathan Cameron --- include/linux/iio/iio.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index faf00f2c0be6..30937f8f9424 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -9,6 +9,7 @@ #include #include +#include #include #include /* IIO TODO LIST */ @@ -657,8 +658,13 @@ static inline void *iio_device_get_drvdata(const struct iio_dev *indio_dev) return dev_get_drvdata(&indio_dev->dev); } -/* Can we make this smaller? */ -#define IIO_ALIGN L1_CACHE_BYTES +/* + * Used to ensure the iio_priv() structure is aligned to allow that structure + * to in turn include IIO_ALIGN'd elements such as buffers which must not share + * cachelines with the rest of the structure, thus making them safe for use with + * non-coherent DMA. + */ +#define IIO_ALIGN ARCH_KMALLOC_MINALIGN struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv); /* The information at the returned address is guaranteed to be cacheline aligned */ From patchwork Tue May 3 08:58:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 582E5C433F5 for ; Tue, 3 May 2022 08:52:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232989AbiECIzi (ORCPT ); Tue, 3 May 2022 04:55:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECIzh (ORCPT ); Tue, 3 May 2022 04:55:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDCF035DD0 for ; Tue, 3 May 2022 01:52:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7A8A8B81A9A for ; Tue, 3 May 2022 08:52:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5E28C385B3; Tue, 3 May 2022 08:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651567923; bh=zrPeTpPwyYRJzjj5h+2/9EvBk7yhpJi/4NNpHdEdfkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QdIDfxQVxQ6yK2vF0B0zWAlCm1axHMoQb5t3Evkisq2Clbj8FDzJDpHrj689y5xkl rTD1y4DLRWTM2S65joqo4yEuRvR5ofT44Z3V4FOxzmyTXgAmX9DV1h9LHlyTGshmzk f2X4Hpn5dTkb+vjSuNNTFqA5QbiiV0Jgxj8bnuiH+1cMtzVcym8DvEVsUbamB36oq2 YJjVt0FODnV7FZzYS2ITv5I0Bilhwp03dhnFuiap1gLU94NlSCqZjzAd3ZhdEKQQL7 +7o6KRkVmCIv9zh7xM3o8C5+yO+7SGRTodQDMsQrq4dEgs5Ils52w+PnqqW3v8q6EJ ji5/FRtFIgblg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 02/92] iio: accel: adxl313: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:05 +0100 Message-Id: <20220503085935.1533814-3-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the update IIO_ALIGN definition. Fixes: 636d44633039 ("iio: accel: Add driver support for ADXL313") Signed-off-by: Jonathan Cameron --- drivers/iio/accel/adxl313_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/adxl313_core.c b/drivers/iio/accel/adxl313_core.c index 9e4193e64765..508fccbd4347 100644 --- a/drivers/iio/accel/adxl313_core.c +++ b/drivers/iio/accel/adxl313_core.c @@ -46,7 +46,7 @@ EXPORT_SYMBOL_NS_GPL(adxl313_writable_regs_table, IIO_ADXL313); struct adxl313_data { struct regmap *regmap; struct mutex lock; /* lock to protect transf_buf */ - __le16 transf_buf ____cacheline_aligned; + __le16 transf_buf __aligned(IIO_ALIGN); }; static const int adxl313_odr_freqs[][2] = { From patchwork Tue May 3 08:58:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835302 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44623C433FE for ; Tue, 3 May 2022 08:52:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232852AbiECIzs (ORCPT ); Tue, 3 May 2022 04:55:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECIzr (ORCPT ); Tue, 3 May 2022 04:55:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D699D20BFD for ; Tue, 3 May 2022 01:52:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5BB82B81A56 for ; Tue, 3 May 2022 08:52:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8875C385B0; Tue, 3 May 2022 08:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651567932; bh=k8lrlU1EJFTuTAIMI9l2v+LwrJS7ciXRC7FdaIeuPSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=be5axW7J4Y/iaOGSSCLQsWZedJwL4d8Dvpc1EmaRdujJodKUpN4UcRRcOJmHf36mt ZOIkltyiyK5177gPGPyYkO/RFYS4Ubt25JpDuINzXEHfVLmzK4FvtLxGkMxaiancGe FzK+J4NYsI3WwEyNse6hL/bmmlcp2CQlIX61v8VYPsVWE23n5h7ekvrXbizXZM/MyS L3oBJqO+FII1c81myP/uiynkgiqgP3SSCp1ZoVbix7BCZynN+ztFTXbEXBiOz17wA2 WP/c+56zK+qqVuda7HFf8S3bUoPZ+LVyp8yedQDgEOrJXMNUNAEl924haTKQQwxgqS e1stKfPQT30EQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 03/92] iio: accel: adxl355: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:06 +0100 Message-Id: <20220503085935.1533814-4-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_ALIGN definition. Fixes: 327a0eaf19d53 ("iio: accel: adxl355: Add triggered buffer support") Signed-off-by: Jonathan Cameron Cc: Puranjay Mohan --- drivers/iio/accel/adxl355_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c index e9c10c8c32f0..50513db39ee8 100644 --- a/drivers/iio/accel/adxl355_core.c +++ b/drivers/iio/accel/adxl355_core.c @@ -177,7 +177,7 @@ struct adxl355_data { u8 buf[14]; s64 ts; } buffer; - } ____cacheline_aligned; + } __aligned(IIO_ALIGN); }; static int adxl355_set_op_mode(struct adxl355_data *data, From patchwork Tue May 3 08:58:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35303C433EF for ; Tue, 3 May 2022 08:52:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230482AbiECIz4 (ORCPT ); Tue, 3 May 2022 04:55:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECIzy (ORCPT ); Tue, 3 May 2022 04:55:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9A6C20BFD for ; Tue, 3 May 2022 01:52:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 765B4612DD for ; Tue, 3 May 2022 08:52:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B26F0C385A9; Tue, 3 May 2022 08:52:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651567941; bh=qM//c9ayuCqnoyQxEHD2ne7ItUofq48CK9Nuw0vQYM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fMGVIYotC34U7aPBduKrrOqWRreRp1byN5Nx/aw2ZbqXSkMlegeV9A8gYzhA7kX/W aibz9B3n6eNnlbB+McWWTfDsvLGVI5j1aJL7IuDHKx/7Q3yYRRiepc2FLvqzJ2sS6q wMi5cv9YjLsWwt43c+7IwQfd8Cxqn5+vDT9utV18FmaHxqtrr825ntNicFb8xPYUJz 7s/wnLwHtoE33m4BSIjjVCZUfFeWUE6q8JftCrGNHZrEUsiV0IGQUrV++viu0BjJbi 2iJ2x+m8UlDLSge+C0Uh0v1JfMM2V0N9OE+57n2a0OMdPxx19Jmbohce/XI16wiUrK EKaEjJzDZubhw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron , Cosmin Tanislav Subject: [PATCH 04/92] iio: accel: adxl367: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:07 +0100 Message-Id: <20220503085935.1533814-5-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_ALIGN definition. Update comment to reflect that DMA safety may require separate cachelines. Fixes: cbab791c5e2a5 ("iio: accel: add ADXL367 driver") Signed-off-by: Jonathan Cameron Cc: Cosmin Tanislav --- drivers/iio/accel/adxl367.c | 2 +- drivers/iio/accel/adxl367_spi.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c index 62960134ea19..9b933c5715c3 100644 --- a/drivers/iio/accel/adxl367.c +++ b/drivers/iio/accel/adxl367.c @@ -179,7 +179,7 @@ struct adxl367_state { unsigned int fifo_set_size; unsigned int fifo_watermark; - __be16 fifo_buf[ADXL367_FIFO_SIZE] ____cacheline_aligned; + __be16 fifo_buf[ADXL367_FIFO_SIZE] __aligned(IIO_ALIGN); __be16 sample_buf; u8 act_threshold_buf[2]; u8 inact_time_buf[2]; diff --git a/drivers/iio/accel/adxl367_spi.c b/drivers/iio/accel/adxl367_spi.c index 26dfc821ebbe..872b1c5a2cc5 100644 --- a/drivers/iio/accel/adxl367_spi.c +++ b/drivers/iio/accel/adxl367_spi.c @@ -9,6 +9,8 @@ #include #include +#include + #include "adxl367.h" #define ADXL367_SPI_WRITE_COMMAND 0x0A @@ -28,10 +30,10 @@ struct adxl367_spi_state { struct spi_transfer fifo_xfer[2]; /* - * DMA (thus cache coherency maintenance) requires the - * transfer buffers to live in their own cache lines. + * DMA (thus cache coherency maintenance) may require the + * transfer buffers live in their own cache lines. */ - u8 reg_write_tx_buf[1] ____cacheline_aligned; + u8 reg_write_tx_buf[1] __aligned(IIO_ALIGN); u8 reg_read_tx_buf[2]; u8 fifo_tx_buf[1]; }; From patchwork Tue May 3 08:58:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835304 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BD03C433EF for ; Tue, 3 May 2022 08:52:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232714AbiECI4H (ORCPT ); Tue, 3 May 2022 04:56:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI4F (ORCPT ); Tue, 3 May 2022 04:56:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6811335DD0 for ; Tue, 3 May 2022 01:52:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1E810B81A96 for ; Tue, 3 May 2022 08:52:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A214DC385A9; Tue, 3 May 2022 08:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651567951; bh=GZ916rUM5mobvwSg7ELO95C3DwWBWvDhGnwDva2QGjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cPsOmkYQ4ZOsRSzM8CNd4ojmnK5VaJFgcNL2+cNCmZmkjGfNen+RAgM5N6StZoy/c sWEs/KCDIo9vqJV910AKsYXMiFkhJvqXn+ZXYppa3szhYZXzkWHafuxttsKKJTyu/l h52ibTgB+Yse6A2ZqARR399QIBcKLJWs4+iDo6eOuTJoNHwv67rmqgqdf3XQwU+6dg zTG0HDK4uEZOrw9k/NoNI2kD2wUsZtsufhmdptUexl/XemUR6E6CwKItiZfcBnfOzy mhXzgWyzz1OPWysCdOh62G/22JK6mq6u26D27Mg84x/JotIkbpD2GLaqvdauUmAfik NwUWSQZ9ssa2w== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 05/92] iio: accel: bma220: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:08 +0100 Message-Id: <20220503085935.1533814-6-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_ALIGN definition. Fixes: bf2a5600a3ebc ("iio: accel: Add support for Bosch BMA220") Signed-off-by: Jonathan Cameron --- drivers/iio/accel/bma220_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c index 74024d7ce5ac..219731393be4 100644 --- a/drivers/iio/accel/bma220_spi.c +++ b/drivers/iio/accel/bma220_spi.c @@ -67,7 +67,7 @@ struct bma220_data { /* Ensure timestamp is naturally aligned. */ s64 timestamp __aligned(8); } scan; - u8 tx_buf[2] ____cacheline_aligned; + u8 tx_buf[2] __aligned(IIO_ALIGN); }; static const struct iio_chan_spec bma220_channels[] = { From patchwork Tue May 3 08:58:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E278C433EF for ; Tue, 3 May 2022 08:52:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232835AbiECI4Q (ORCPT ); Tue, 3 May 2022 04:56:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI4P (ORCPT ); Tue, 3 May 2022 04:56:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78F6220BFD for ; Tue, 3 May 2022 01:52:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2B3F9B81BE0 for ; Tue, 3 May 2022 08:52:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61A58C385A4; Tue, 3 May 2022 08:52:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651567961; bh=m9MbVeTuFky3shhvEmrjFU74ARZe3/f3Vz8nQdsQAqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=osvTIZ/g2cNgtS0ypt2eumAoeRJCItMnnlVEkN2r9KB+HvTOeTjq+kFnpXWYRjBbn JETq+c4fjkgZREAdqdsWjXHWgQA+fj+FTUIzRcuaTwtOCvMEdnfjdarZQuXF9vy/0d ktpGOQoZt6KGkkDKrym9kShLQLWLR1vs2qpVDIJqnh9yb5d2MBtthb4nYQqhngh01k N1aJbctMpYz7WajYWMXDLgDntZ61BymQyz1f6fjYLSQeXGSA+Qhv4hwiAzJEy2K5Zr h4johPyGCMIGis8K7EnLWp439boFWUK1JOQz0mBt/iX84/7KkHl1HCR/dSCYrYo4/w /mAJQnO2IjuXg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 06/92] iio: accel: bmi088: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:09 +0100 Message-Id: <20220503085935.1533814-7-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_ALIGN definition. Signed-off-by: Jonathan Cameron --- drivers/iio/accel/bmi088-accel-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c index 8b2728bbcade..bde5bfd08118 100644 --- a/drivers/iio/accel/bmi088-accel-core.c +++ b/drivers/iio/accel/bmi088-accel-core.c @@ -124,7 +124,7 @@ struct bmi088_accel_chip_info { struct bmi088_accel_data { struct regmap *regmap; const struct bmi088_accel_chip_info *chip_info; - u8 buffer[2] ____cacheline_aligned; /* shared DMA safe buffer */ + u8 buffer[2] __aligned(IIO_ALIGN); /* shared DMA safe buffer */ }; static const struct regmap_range bmi088_volatile_ranges[] = { From patchwork Tue May 3 08:58:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835306 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5CF8C433F5 for ; Tue, 3 May 2022 08:52:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232999AbiECI41 (ORCPT ); Tue, 3 May 2022 04:56:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI40 (ORCPT ); Tue, 3 May 2022 04:56:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E5F920BFD for ; Tue, 3 May 2022 01:52:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 32D09B81BE0 for ; Tue, 3 May 2022 08:52:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68350C385B1; Tue, 3 May 2022 08:52:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651567972; bh=4tsRDGAcD+68l8OlJcHhJp9KeN7ffiYjsAH1rSx2e44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iG6OmtQf8DOfgsLZ63IusHs41pQ3Nijq3LqMFqZDvV+LLpVsVhETNZ2/Xnl1JhMrH 4P8Q/pRimcAOFXSnv0v5tNe6Pln1TRxJi9J/0asFNuHEAqO7+I3iTI/WS726QWyobC pBdZQ+3kNoLvvxxSAksydS4KUAfJ7rfOUeNrElz1G6I0Noyj8SCZvhwObbs3+MAB52 wuP9h8KiQIYYFXlgMbJeo0E7P1K2si6yutAswDWt6q9l7gTW2gVPj+4Xq5/qwEC59z kSDI1tV4/5mhKNimMd+m2pBmpmRwx0dBLxF/CCDS6NRF4RktkrlEOdEkxyAkDO2S8h TsS9fFvacJehg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 07/92] iio: accel: sca3000: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:10 +0100 Message-Id: <20220503085935.1533814-8-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_ALIGN definition. Fixes: ced5c03d360ae ("staging:iio:accel:sca3000 merge files into one.") Fixes: 152a6a884ae13 ("staging:iio:accel:sca3000 move to hybrid hard / soft buffer design.") Signed-off-by: Jonathan Cameron --- drivers/iio/accel/sca3000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c index 83c81072511e..a8897b684210 100644 --- a/drivers/iio/accel/sca3000.c +++ b/drivers/iio/accel/sca3000.c @@ -167,8 +167,8 @@ struct sca3000_state { int mo_det_use_count; struct mutex lock; /* Can these share a cacheline ? */ - u8 rx[384] ____cacheline_aligned; - u8 tx[6] ____cacheline_aligned; + u8 rx[384] __aligned(IIO_ALIGN); + u8 tx[6] __aligned(IIO_ALIGN); }; /** From patchwork Tue May 3 08:58:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0017CC433EF for ; Tue, 3 May 2022 08:53:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232990AbiECI4g (ORCPT ); Tue, 3 May 2022 04:56:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI4e (ORCPT ); Tue, 3 May 2022 04:56:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42EC920BFD for ; Tue, 3 May 2022 01:53:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D1E0361326 for ; Tue, 3 May 2022 08:53:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9247DC385A4; Tue, 3 May 2022 08:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651567982; bh=SWemmiZ6YucxgePs7gOxzZzdJKMBjw1YOniS7+GNcVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=naYgLca41rXCDa+amWB9htpVMzVuDr8KaBgxCpaZTaGCJRXgrc1jVGBiOweoBV0p6 OxU8Ja7ExxPF7cI/o7m/YEEB7LJRPL7tKVCmY0y4Wtny44pImjP0Vll1DpZuezvN40 4TDs3lOuhkz3CJibCZQo4zVtEMiK+KtLnC/DJhR9/UHyjT6jPOKn4whZUY00hmhkRI wAO8cMFdjZlPY7x46ixVHEX8a3al1yltHpNXHm2Labo6Tk2I64NK8ru7OqE/LEah3W yc4Uc7paRkdTPeXb1IphGGJ9TfNn60e9LFHeRXdfuBVQ94V/35k9zvcOklh8isAqNE cBiZDWuDoyBFw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 08/92] iio: accel: sca3000: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:11 +0100 Message-Id: <20220503085935.1533814-9-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_ALIGN definition. Fixes: 9cc9806e22178 ("iio: accel: Add driver for Murata SCA3300 accelerometer") Signed-off-by: Jonathan Cameron Cc: Tomas Melin Reviewed-by: Tomas Melin --- drivers/iio/accel/sca3300.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/sca3300.c b/drivers/iio/accel/sca3300.c index f7ef8ecfd34a..0e87746829a4 100644 --- a/drivers/iio/accel/sca3300.c +++ b/drivers/iio/accel/sca3300.c @@ -115,7 +115,7 @@ struct sca3300_data { s16 channels[4]; s64 ts __aligned(sizeof(s64)); } scan; - u8 txbuf[4] ____cacheline_aligned; + u8 txbuf[4] __aligned(IIO_ALIGN); u8 rxbuf[4]; }; From patchwork Tue May 3 08:58:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835308 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84E26C433EF for ; Tue, 3 May 2022 08:53:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233000AbiECI4q (ORCPT ); Tue, 3 May 2022 04:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI4p (ORCPT ); Tue, 3 May 2022 04:56:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A57035ABF for ; Tue, 3 May 2022 01:53:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DE416B81A96 for ; Tue, 3 May 2022 08:53:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD78BC385B0; Tue, 3 May 2022 08:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651567991; bh=AD03ydEU+BaOTVySZHLdLUykv6lO6TuqENNKavTGzsk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y11AYrjwJmTgXO+/8Ey1CvtHST/kg/o1gm+IUX4IMc+5HuSTMOO+qjFRG+V0IEyq5 tivz1AB4SAa7W3DmfEDJ7F3zjJn85nay7C33rKFwxlUYiDvvZVq2o3zk1hRvwb+p64 o+pJVUm2/vbAqvJA7ruXaSnBuafIRNtKxwuF39bpt+OXa3LqxkheO11SgoNi3lhuJU 3XjqspRKhRrCPXR/PJGqlWJve19tkWVIPrLqIE9Q9Pd6YS8AVkGSFd/cDGN+AVAYCj rmWXTFvLxZQeDMBldoAfdM4/CIr6s50ynJfVtEgOemBwyEIva9RcsavMF4ygS+q2xx LAE2Vfe4MjUhw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 09/92] iio: adc: ad7266: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:12 +0100 Message-Id: <20220503085935.1533814-10-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to reflect that DMA safety 'may' require separate cachelines. Fixes: 54e018da3141 ("iio:ad7266: Mark transfer buffer as __be16") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ad7266.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c index c17d9b5fbaf6..54fdb8fbb6a2 100644 --- a/drivers/iio/adc/ad7266.c +++ b/drivers/iio/adc/ad7266.c @@ -37,15 +37,15 @@ struct ad7266_state { struct gpio_desc *gpios[3]; /* - * DMA (thus cache coherency maintenance) requires the - * transfer buffers to live in their own cache lines. + * DMA (thus cache coherency maintenance) may require the + * transfer buffers live in their own cache lines. * The buffer needs to be large enough to hold two samples (4 bytes) and * the naturally aligned timestamp (8 bytes). */ struct { __be16 sample[2]; s64 timestamp; - } data ____cacheline_aligned; + } data __aligned(IIO_ALIGN); }; static int ad7266_wakeup(struct ad7266_state *st) From patchwork Tue May 3 08:58:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EBC7C433F5 for ; Tue, 3 May 2022 08:53:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233006AbiECI4z (ORCPT ); Tue, 3 May 2022 04:56:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI4x (ORCPT ); Tue, 3 May 2022 04:56:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90C6B20BFD for ; Tue, 3 May 2022 01:53:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2DA6E61326 for ; Tue, 3 May 2022 08:53:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37E71C385A9; Tue, 3 May 2022 08:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568001; bh=1jAZkZcI7BBOiYuBGkmPzkwxT3TF9Uqi+bvzj6CBGrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rNW5+M0+hseUhylkwyl/nBbRv60jgO0rdMcngNdu2JZvGqi59hgtN+a3jjlGTeF0L +HVhU3JCorKe3louAMkI1QDr3pB104IwoxUKis7ar+vT0097Dm873zFwyiLVO08k3f zW42omIhF81Yw5Z3I3HWZgNl7WDBYxX6XJpolCrKijj//gF9qju3MdkAXZT8oHcneQ WU65OySEF6FOM8US2fFvhglGpcUWRNZKmIDdYYvij/pHoDW8oZLC8U5Kz0tGCdJw+3 MIa5wPi7LMz2ZDB4VpaOnSn4mrQZuSLGKw+0bU7D8d0AyVj5fU2Hxu2DoksPQ1mN6d NhneQbPie0KEQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 10/92] iio: adc: ad7280a: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:13 +0100 Message-Id: <20220503085935.1533814-11-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 003f1d48de52 ("staging:iio:adc:ad7280a: Split buff[2] into tx and rx parts") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ad7280a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7280a.c b/drivers/iio/adc/ad7280a.c index ec9acbf12b9a..74173e54b254 100644 --- a/drivers/iio/adc/ad7280a.c +++ b/drivers/iio/adc/ad7280a.c @@ -183,7 +183,7 @@ struct ad7280_state { unsigned char cb_mask[AD7280A_MAX_CHAIN]; struct mutex lock; /* protect sensor state */ - __be32 tx ____cacheline_aligned; + __be32 tx __aligned(IIO_ALIGN); __be32 rx; }; From patchwork Tue May 3 08:58:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835310 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 031B7C433F5 for ; Tue, 3 May 2022 08:53:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232871AbiECI5G (ORCPT ); Tue, 3 May 2022 04:57:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI5F (ORCPT ); Tue, 3 May 2022 04:57:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A10835ABF for ; Tue, 3 May 2022 01:53:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 27D1FB81A96 for ; Tue, 3 May 2022 08:53:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FD04C385B0; Tue, 3 May 2022 08:53:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568011; bh=jGI2OSMTOwOb0RbPbYJDUpm0dWtsy4B0H8J1EwuN84s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e93OCqDGJkvtxDi0RjT8mJ/Tz5CqcWuUp5j0M+pQTmx5vqHGeWjnTrayKERW7B47Z j27dgy9tikaesR60S4sB2ZBBnisJrYTmJp2r9BwO7l1eYK0OAOVL9VagbwjTDvGyv9 OCw21bgP2QbF3r8Sc0Pw+GIMPoM3Btz2rwQzZcdl+15UOCsJ5mMj7bvPYauMftT8Wv EUTsS2pZXLsT3Yoj+Qnf1I3ll94e4jXExWBD7bBOipxc4Z6lFHO/2Zoq4nL4CXOKGK 3dy1kS/HzgvpWUMQfU9duF4C7shzAxi0uP386RmI0sAqG8XbiEP9Enz3vUl4k3GLce Zg6Bdsc87MvJg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 11/92] iio: adc: ad7292: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:14 +0100 Message-Id: <20220503085935.1533814-12-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 506d2e317a0a ("iio: adc: Add driver support for AD7292") Signed-off-by: Jonathan Cameron Cc: Marcelo Schmitt Acked-by: Marcelo Schmitt --- drivers/iio/adc/ad7292.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7292.c b/drivers/iio/adc/ad7292.c index 3271a31afde1..08985fc5c200 100644 --- a/drivers/iio/adc/ad7292.c +++ b/drivers/iio/adc/ad7292.c @@ -80,7 +80,7 @@ struct ad7292_state { struct regulator *reg; unsigned short vref_mv; - __be16 d16 ____cacheline_aligned; + __be16 d16 __aligned(IIO_ALIGN); u8 d8[2]; }; From patchwork Tue May 3 08:58:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 853BEC433F5 for ; Tue, 3 May 2022 08:53:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233016AbiECI5Q (ORCPT ); Tue, 3 May 2022 04:57:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI5O (ORCPT ); Tue, 3 May 2022 04:57:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A67B635DD0 for ; Tue, 3 May 2022 01:53:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 55D4DB81A96 for ; Tue, 3 May 2022 08:53:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A545C385A4; Tue, 3 May 2022 08:53:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568021; bh=vBaOjsU2OUBDx6O3pBDfg3rbhke5YJrf4Tzei5bc6wA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qf22L9YTn5CtR7jj4SkW/KAgeDgP5tLOWrdRifXCCNMup3cBoF2XFE15IhV87ASpV otzQBg8HIzrIZIpWHQybzPO0T2JTIcW2txep6tPwj1gKni4EqOiTDrMnUQ/gKtgxpd 8zvF58FMzE/n5yQea2fa/dQoa1JEw1Te5AZSPM5mlMfrzO58HPSgivjEzr7kr0BcwY /p1U0Hdm6didy+KutqxYHlTWfXhbtvq1XxdoxMo9vzMzjajdzOaGxDqkBLRkNrfeCv DvaYBQuVtq51PKprEFK6tGS8E/MtFo+NspcuWeo3UkzWTNz582yA1FbzTLEWcg2m6k O91reU/qTuzqQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 12/92] iio: adc: ad7298: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:15 +0100 Message-Id: <20220503085935.1533814-13-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: be7fd3b86ad2 ("iio:adc:ad7298 make the tx and rx buffers __be16") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ad7298.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7298.c b/drivers/iio/adc/ad7298.c index 3f4e73f7d35a..3461321effae 100644 --- a/drivers/iio/adc/ad7298.c +++ b/drivers/iio/adc/ad7298.c @@ -49,7 +49,7 @@ struct ad7298_state { * DMA (thus cache coherency maintenance) requires the * transfer buffers to live in their own cache lines. */ - __be16 rx_buf[12] ____cacheline_aligned; + __be16 rx_buf[12] __aligned(IIO_ALIGN); __be16 tx_buf[2]; }; From patchwork Tue May 3 08:58:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835312 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DD06C433F5 for ; Tue, 3 May 2022 08:53:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232891AbiECI50 (ORCPT ); Tue, 3 May 2022 04:57:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI5Z (ORCPT ); Tue, 3 May 2022 04:57:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE18020BFD for ; Tue, 3 May 2022 01:53:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5FAB7B81A56 for ; Tue, 3 May 2022 08:53:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 924AAC385B0; Tue, 3 May 2022 08:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568031; bh=SALcPILQlJ3wwKAouKog/dFWpS5n452LpWj7no2Rshc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TEFyfYZrj2QcXLrcbDP8SdOfh2CouDjETpL5kbVYHx1CcK53Gw6CHqWwh9Ij9dPA3 iaXehU4f9ZpZ5xyUC3krZH3r54YtaAh9om47li9qW3MoDH19zNi7SJ8Yu+l8byplNc /OTFqDR4vXVNYpbsSGo8HJsOqScAc7ooPhyKnuVQghZtiq8fjWnSACj5jFy4fFVqyN T5+kpQfJNKDkIfg68wCwYGB9ZqEDI6AQkrPORSg9OoI5iD+1l4VHEvIpeEdXMCdlO1 RveiZ9nUzRovdKlJ8CiEEBBysmK/HPuSjCoPBb43mZ6CtRbfebuE/5/AXxcCuCtK5V 6yEIAKBs6E8Mw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 13/92] iio: adc: ad7476: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:16 +0100 Message-Id: <20220503085935.1533814-14-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to reflect that DMA safety 'may' require separate cachelines. Fixes tag is unlikely to be the actual introdution of the problem but is far enough back to cover any likely backporting. Fixes: 7a28fe3c93d6 ("staging:iio:ad7476: Squash driver into a single file.") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ad7476.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ad7476.c b/drivers/iio/adc/ad7476.c index a1e8b32671cf..d02b1c801957 100644 --- a/drivers/iio/adc/ad7476.c +++ b/drivers/iio/adc/ad7476.c @@ -44,13 +44,12 @@ struct ad7476_state { struct spi_transfer xfer; struct spi_message msg; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. * Make the buffer large enough for one 16 bit sample and one 64 bit * aligned 64 bit timestamp. */ - unsigned char data[ALIGN(2, sizeof(s64)) + sizeof(s64)] - ____cacheline_aligned; + unsigned char data[ALIGN(2, sizeof(s64)) + sizeof(s64)] __aligned(IIO_ALIGN); }; enum ad7476_supported_device_ids { From patchwork Tue May 3 08:58:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835313 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5965C433F5 for ; Tue, 3 May 2022 08:54:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233041AbiECI5g (ORCPT ); Tue, 3 May 2022 04:57:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI5e (ORCPT ); Tue, 3 May 2022 04:57:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E44B135DE9 for ; Tue, 3 May 2022 01:54:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9927CB81A56 for ; Tue, 3 May 2022 08:54:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98CD5C385A4; Tue, 3 May 2022 08:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568040; bh=nem98y3YJbF+X6WsRnQpMXvAhuEIpY19h6dWqMNoKAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gFhAWdgFGMzudVvIyf5IEAJ2o9HravxPu9j279Gn+24i6sPxUFxUxF6igFUDPTeZg qnRaZ3XguV4kWQZrrHhHWH0Bk0spbqy3GU3tsSbU2cY0qkA20q+C5Ws/r7lidqtHHA Ifu8OVluXTcDedGUYETs97hy0/6QXkxFYxh9+t6OjMjrL6TVJEHtMJ4s118rYfJVS/ 0tv6c+JWuSLdClS5cnT+l+dyzRx7dvDY8W33UiTrKh+ibMhjYHti2ghflQAu4VFzrn yonVJ4H4S+a0V00v9BskS4TQfD8Bre8UMrLLLzDSDgkuepfzTrcm86y52fH57okihm w10odzx4PdDVA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 14/92] iio: adc: ad7606: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:17 +0100 Message-Id: <20220503085935.1533814-15-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to reflect the fact DMA safety 'may' require separate cachelines. Fixes: 7989b4bb23fe ("iio: adc: ad7616: Add support for AD7616 ADC") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ad7606.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ad7606.h b/drivers/iio/adc/ad7606.h index 4f82d7c9acfd..f52aedb1ecf3 100644 --- a/drivers/iio/adc/ad7606.h +++ b/drivers/iio/adc/ad7606.h @@ -116,11 +116,11 @@ struct ad7606_state { struct completion completion; /* - * DMA (thus cache coherency maintenance) requires the - * transfer buffers to live in their own cache lines. + * DMA (thus cache coherency maintenance) may require the + * transfer buffers live in their own cache lines. * 16 * 16-bit samples + 64-bit timestamp */ - unsigned short data[20] ____cacheline_aligned; + unsigned short data[20] __aligned(IIO_ALIGN); __be16 d16[2]; }; From patchwork Tue May 3 08:58:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835314 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25436C433EF for ; Tue, 3 May 2022 08:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233033AbiECI5p (ORCPT ); Tue, 3 May 2022 04:57:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232906AbiECI5n (ORCPT ); Tue, 3 May 2022 04:57:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18AF735DD0 for ; Tue, 3 May 2022 01:54:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C5280B81BE6 for ; Tue, 3 May 2022 08:54:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEDD9C385B0; Tue, 3 May 2022 08:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568049; bh=UCgM/j0Xkhj1HqBdk6oBVY4FaPJC8EcwEtoutlNABXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VzaZH6pWto/Cnq/AlJxeevKfQcyZ93KpWyMvrM/sydees+aQF9RmpRP4ZMXTO6RW5 XOuWPpfWCYtMdjgE2ROYKDuEIgrEHWQ9nqoeaIg6e85hVXJQkMvGf6/UPruq6uia2Y B/EBEEHz7wXAUAl8964kGOZBEAPwpTPnBZ7rX3ajQNKHu76bHOfS7B6ZyWYExOy05B iB2vpA34YnGfi3gAT+duL/vpehSuYrCvfh3Qb7iCC4KhxTLzbG1Q7lji7p4pjYMEIh wSiDqEeelmPsWYGhtDQQuqBOG2n4hmA5anP7Q44v9J4offFUa4F9mprOR/5mN0Bqvp jG00cnFU3a80Q== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 15/92] iio: adc: ad7766: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:18 +0100 Message-Id: <20220503085935.1533814-16-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to reflect the fact DMA safety 'may' require separate cachelines. Fixes: aa16c6bd0e09 ("iio:adc: Add support for AD7766/AD7767") Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen --- drivers/iio/adc/ad7766.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c index 51ee9482e0df..f26115967bed 100644 --- a/drivers/iio/adc/ad7766.c +++ b/drivers/iio/adc/ad7766.c @@ -45,13 +45,12 @@ struct ad7766 { struct spi_message msg; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. * Make the buffer large enough for one 24 bit sample and one 64 bit * aligned 64 bit timestamp. */ - unsigned char data[ALIGN(3, sizeof(s64)) + sizeof(s64)] - ____cacheline_aligned; + unsigned char data[ALIGN(3, sizeof(s64)) + sizeof(s64)] __aligned(IIO_ALIGN); }; /* From patchwork Tue May 3 08:58:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835315 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FDCEC433F5 for ; Tue, 3 May 2022 08:54:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231320AbiECI6D (ORCPT ); Tue, 3 May 2022 04:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232906AbiECI54 (ORCPT ); Tue, 3 May 2022 04:57:56 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DC5535DE9 for ; Tue, 3 May 2022 01:54:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 60E23CE1E67 for ; Tue, 3 May 2022 08:54:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF908C385A4; Tue, 3 May 2022 08:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568058; bh=MqdHuosWBnnyP+/Jrjq2c52P+lAsMXYGETCOBH7CA0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BRVVrN+z7QtKNGz67/ctStUD6daaSJcQvbQFQ4JPpq4aajRjP/x03Wb4PNegylbaI +1BvZqO426ntqMHPDlia5a3Q0c0CFtnJfL33nxLam6pcFfZr0QQQulMi7pezrxLRKX 0KaktUP8doBPQjxXYhqpVNpRd+gcuhe1twvhULTQ1MZ00yQ9ouaV+pWF3iBksay4Zc WtgxR9x6rNbFg8NkWcYWBkFno0hx09jV3srber/tktVkpq7TR8pDh016EYqZWpRc6X W0reJupLDYZi60FuncIznDpIwoj/+u/cobdEDxwIUlWkOGfk9dufidP/IvN2KuIdmT Q7GC1qvQTcPmw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 16/92] iio: adc: ad7768-1: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:19 +0100 Message-Id: <20220503085935.1533814-17-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to reflect that separate cachelines 'may' be required. Fixes: a5f8c7da3dbe ("iio: adc: Add AD7768-1 ADC basic support") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ad7768-1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ad7768-1.c b/drivers/iio/adc/ad7768-1.c index aa42ba759fa1..325d3aba5abb 100644 --- a/drivers/iio/adc/ad7768-1.c +++ b/drivers/iio/adc/ad7768-1.c @@ -163,7 +163,7 @@ struct ad7768_state { struct gpio_desc *gpio_sync_in; const char *labels[ARRAY_SIZE(ad7768_channels)]; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ union { @@ -173,7 +173,7 @@ struct ad7768_state { } scan; __be32 d32; u8 d8[2]; - } data ____cacheline_aligned; + } data __aligned(IIO_ALIGN); }; static int ad7768_spi_reg_read(struct ad7768_state *st, unsigned int addr, From patchwork Tue May 3 08:58:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835316 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E643C433FE for ; Tue, 3 May 2022 08:54:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232306AbiECI6D (ORCPT ); Tue, 3 May 2022 04:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI6B (ORCPT ); Tue, 3 May 2022 04:58:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA8EC35ABF for ; Tue, 3 May 2022 01:54:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A1078B81BE0 for ; Tue, 3 May 2022 08:54:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F251AC385B3; Tue, 3 May 2022 08:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568067; bh=/BNk9/AlOPchEdgEbpPVzhIEOuH6okWywZLnZ66GgGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nJViwevIO+PFx3ynllppohdgacUltAfG3PpHvtDkh0r6kH0EtNMh014dTpeQpmA4h +HRHI+teSnb+8KxJlBs95Z+iCQNGXHfMWZ7mdgLpiKFb7o/JXnnv17+Lp8oHe5Ns13 ddpAI6R6d8yfwDRNTT0CfmOlv8yUkMt5ziCT2wJP7ceIJ3twivsnMEzhUFG8QRbbMM w5DcDxOnEsVyh/Xjg68kf7bU85zMkSpCsuUG54tABAVLpCU3nLqjS5syuRmLdObLFG aRu/GCGIibQEyuzG7iHj9cBiTDoTtaUVeGPNiRLeGKjdDRwZ0OU5+2GEKH2kvvi00L Nl2v6FNVd6Ccw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 17/92] iio: adc: ad7887: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:20 +0100 Message-Id: <20220503085935.1533814-18-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes tag is clearly not where this was introduced but it is very unlikely anyone will back port it past that point. Fixes: 65dd3d3d7a9b ("staging:iio:ad7887: Squash everything into one file") Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen --- drivers/iio/adc/ad7887.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ad7887.c b/drivers/iio/adc/ad7887.c index f64999714a4d..17b20d2085f9 100644 --- a/drivers/iio/adc/ad7887.c +++ b/drivers/iio/adc/ad7887.c @@ -66,13 +66,12 @@ struct ad7887_state { unsigned char tx_cmd_buf[4]; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. * Buffer needs to be large enough to hold two 16 bit samples and a * 64 bit aligned 64 bit timestamp. */ - unsigned char data[ALIGN(4, sizeof(s64)) + sizeof(s64)] - ____cacheline_aligned; + unsigned char data[ALIGN(4, sizeof(s64)) + sizeof(s64)] __aligned(IIO_ALIGN); }; enum ad7887_supported_device_ids { From patchwork Tue May 3 08:58:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835317 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E24CC433EF for ; Tue, 3 May 2022 08:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231902AbiECI6M (ORCPT ); Tue, 3 May 2022 04:58:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiECI6M (ORCPT ); Tue, 3 May 2022 04:58:12 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EA0235ABF for ; Tue, 3 May 2022 01:54:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id E051ECE1E6A for ; Tue, 3 May 2022 08:54:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01184C385B0; Tue, 3 May 2022 08:54:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568077; bh=jPaTbN7zS3YqH2CKXzG9E3+WEnIfp3lOcul6gklYLl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JHGtynp3Bs1GncFswKjB12h4k07/idCwyBlQUn9HBQ9dydYx8/m8O8hEKaIgRY467 n2d4S1VghSkkOSn0XieDHoNdG811A/EQe8ow2nso4QyJZdb+T6fRMWYvVBLPCdltQh lxvOWB4NsgIVdmRcJBDnHUDVkEDQcaYlDJAvMjMNm1I8u0ZA6DZbUXoj3L8B1bFxXg 6s7mkVX9+52tn/NqzfCOtDV11dwAHTY14H6Yj5yzhsLgAgtkKSDgFz2M3ulGVnNUlg GpLmYBC6TRBf0CPNU6Cip5sMt3JpBx4miqmr87uR2v57XGyJigbA0a/5mO922hMYBM 47caHHymDnhHw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 18/92] iio: adc: ad7923: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:21 +0100 Message-Id: <20220503085935.1533814-19-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Note that some other fixes have applied to this line of code that may complicate automated backporting. Signed-off-by: Jonathan Cameron Fixes: 0eac259db28f ("IIO ADC support for AD7923") --- drivers/iio/adc/ad7923.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c index 069b561ee768..596244bccd20 100644 --- a/drivers/iio/adc/ad7923.c +++ b/drivers/iio/adc/ad7923.c @@ -57,12 +57,12 @@ struct ad7923_state { unsigned int settings; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. * Ensure rx_buf can be directly used in iio_push_to_buffers_with_timetamp * Length = 8 channels + 4 extra for 8 byte timestamp */ - __be16 rx_buf[12] ____cacheline_aligned; + __be16 rx_buf[12] __aligned(IIO_ALIGN); __be16 tx_buf[4]; }; From patchwork Tue May 3 08:58:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835318 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9271C433EF for ; Tue, 3 May 2022 08:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230464AbiECI6V (ORCPT ); Tue, 3 May 2022 04:58:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232906AbiECI6U (ORCPT ); Tue, 3 May 2022 04:58:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE6FE35DE9 for ; Tue, 3 May 2022 01:54:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A9944B81A96 for ; Tue, 3 May 2022 08:54:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4B76C385B3; Tue, 3 May 2022 08:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568086; bh=BB8oAlfH4dsktNO9dtAJJR7Qz8Yz1DGUgcqgMnoQDTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sGKmPsJ84weRz+hK/FIT2mgD0Jyntx/BfUh7b+LUkcXats4DWwAsdUYZcWd18GHqK 4YHmqyUJbreUt3XFE/p89SkbV6H37okt8KNsVT+FMOgttmLADURV9ctAVYpDUrqYeQ PQDA4d45E+v5Jo4LyMtUfDPkWlhdDlVssUR5dA7hbt1TrNByA5k5k/g6lPT5bIRWaH 8RxKUe4U28GwR3VWtTVn5zl3MlrT5DqnHuYSjbYrZpIfQ3UPdrqF04rl6YtG6Wq4mC 43oAQkvPGRtdlRF0JyjjS/2bfLPgxXIXJiGx0XEH8EiFfaZei79O+802RiKDFVSukR OjyfQ8ijPnxmg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 19/92] iio: adc: ad7949: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:22 +0100 Message-Id: <20220503085935.1533814-20-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Note the fixes tag predates some changes to this line of code so automated application of this fix may fail. Fixes: 7f40e0614317 ("iio:adc:ad7949: Add AD7949 ADC driver family") Signed-off-by: Jonathan Cameron Cc: Charles-Antoine Couret --- drivers/iio/adc/ad7949.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7949.c b/drivers/iio/adc/ad7949.c index 44bb5fde83de..7906f6c6409e 100644 --- a/drivers/iio/adc/ad7949.c +++ b/drivers/iio/adc/ad7949.c @@ -86,7 +86,7 @@ struct ad7949_adc_chip { u8 resolution; u16 cfg; unsigned int current_channel; - u16 buffer ____cacheline_aligned; + u16 buffer __aligned(IIO_ALIGN); __be16 buf8b; }; From patchwork Tue May 3 08:58:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45D42C433F5 for ; Tue, 3 May 2022 08:54:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232906AbiECI62 (ORCPT ); Tue, 3 May 2022 04:58:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232473AbiECI62 (ORCPT ); Tue, 3 May 2022 04:58:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87C1335ABF for ; Tue, 3 May 2022 01:54:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2519661266 for ; Tue, 3 May 2022 08:54:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14EC8C385A9; Tue, 3 May 2022 08:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568095; bh=tUoUcUcidiwHWW8MIIah/YsyVkTHMvmw3z3Dgq20KxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W6fRvpOGsnC2PXdwFkAOMl0R6JuLiFbjk3wYXSC3HTtFFOB+qAST/Pz3lw0EJ3GM1 o1dxDrgbf3rnKtgr2rtxGVmjVihpuxvbmGHVGOigrK/obA+kYEquag/mIqoix8XCvk G8y/zCacRYB2lhJ0eqEXbu+T4PaLvSVVci4n9KYk32vFZdqeBrBk8MyYWjui599HaH 57dWMID1YpLAIlR3TCbO+A+ZjIvWnARXu+U7fRfTnRuj/z8eAcqKHH0JfU3D+NKYid Z9rVkBLR0WZWK2cCrHdIUdfP1L8MJJMrctLyXtW0C1vztznaEugfbMJPlsz1IEJ8/O aeZf3S4iUOAJg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 20/92] iio: adc: hi8435: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:23 +0100 Message-Id: <20220503085935.1533814-21-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 72aa29ce0a59 ("iio: adc: hi8435: Holt HI-8435 threshold detector") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/hi8435.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/hi8435.c b/drivers/iio/adc/hi8435.c index 8eb0140df133..2a96a185b1db 100644 --- a/drivers/iio/adc/hi8435.c +++ b/drivers/iio/adc/hi8435.c @@ -49,7 +49,7 @@ struct hi8435_priv { unsigned threshold_lo[2]; /* GND-Open and Supply-Open thresholds */ unsigned threshold_hi[2]; /* GND-Open and Supply-Open thresholds */ - u8 reg_buffer[3] ____cacheline_aligned; + u8 reg_buffer[3] __aligned(IIO_ALIGN); }; static int hi8435_readb(struct hi8435_priv *priv, u8 reg, u8 *val) From patchwork Tue May 3 08:58:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835320 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04EB0C433F5 for ; Tue, 3 May 2022 08:55:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232473AbiECI6i (ORCPT ); Tue, 3 May 2022 04:58:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232983AbiECI6h (ORCPT ); Tue, 3 May 2022 04:58:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAB7235DD0 for ; Tue, 3 May 2022 01:55:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 67F1861264 for ; Tue, 3 May 2022 08:55:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EFAAC385B0; Tue, 3 May 2022 08:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568104; bh=Wojjf1F8HxpMQH8Q/29IKDfXecdUDjdapdDceh53ct4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BFHnHOkVTYa3k5aePC94bvGu5rZHKn4XyjZxvrSv+HLGv5k2zahNN/DsPjRxK4tA0 pbxI0G0tiI94TmydTBPCftNw48h2zdL+FEBZhMLUcUtmhcEBayuD9ASZZqBzfYr0hc /MoSRSJPOlVbStCJ8dHpwm3YSJx/G1/eSSh29eRtIS0SFS/yeYa+olP6HVvw3tbJ4C wHX3CgVPCHCyuf/7cOxG5bpHibvUSGRI7jzjYcm1q/+fPNXLkCgWR9T1QaJEVcgWxs 04MO2002b7zJqM0IulSZfxJeHUKzFh8p5c2djQWwxX1/iU4ur9EKkM+beaaerNMXKO WHpLD1lj6Xp4Q== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 21/92] iio: adc: ltc2496: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:24 +0100 Message-Id: <20220503085935.1533814-22-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: e4c5c4dfaa88 ("iio: adc: new driver to support Linear technology's ltc2496") Signed-off-by: Jonathan Cameron Cc: Uwe Kleine-König --- drivers/iio/adc/ltc2496.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ltc2496.c b/drivers/iio/adc/ltc2496.c index 5a55f79f2574..db1e14224ff9 100644 --- a/drivers/iio/adc/ltc2496.c +++ b/drivers/iio/adc/ltc2496.c @@ -24,10 +24,10 @@ struct ltc2496_driverdata { struct spi_device *spi; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ - unsigned char rxbuf[3] ____cacheline_aligned; + unsigned char rxbuf[3] __aligned(IIO_ALIGN); unsigned char txbuf[3]; }; From patchwork Tue May 3 08:58:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BBA4C433EF for ; Tue, 3 May 2022 08:55:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232953AbiECI7T (ORCPT ); Tue, 3 May 2022 04:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233037AbiECI6s (ORCPT ); Tue, 3 May 2022 04:58:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4AA0E47 for ; Tue, 3 May 2022 01:55:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4FBB5612FE for ; Tue, 3 May 2022 08:55:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75BA3C385A9; Tue, 3 May 2022 08:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568113; bh=iA+0LIqpZLa0Hyq2KjXWx8QpkvUGQt90+SNn48CgG0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DKYcDDTZJf2PkTuG+zr560jY2R+DCfHZG0ADup9LV6poxsrgx76B8aqF3Vb2Jm6v4 4lPEQyvZrGWgD8pqneCavT+QBEJ2IpmlyWm36Q+KItvvFTMX2pZaC8SEjxGqLxs7VA zE/LF0RhEqdqT332WyOd8RDjB6xq8u45HhnVh7MVa/TeMsdodz/EpOXZfvVamaqrjS lJ2CzZNIn7txWNIHixSwvYMp2yO0Lj/DfJSxgHxQ1tvjb3I4pFI+FbBigpf4F2TyJ2 EDpa0tnaw4llxIJ1enCzX8oH+oDG8m37INjTo+Z5+TFtRpMipOJyWJsYSTISlZ5eOw eCUYIrZZ1u7gA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 22/92] iio: adc: ltc2497: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:25 +0100 Message-Id: <20220503085935.1533814-23-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: bc82222fcca1 ("iio:adc: Driver for Linear Technology LTC2497 ADC") Signed-off-by: Jonathan Cameron Cc: Michael Hennerich --- drivers/iio/adc/ltc2497.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ltc2497.c b/drivers/iio/adc/ltc2497.c index 1adddf5a88a9..8c78bee16369 100644 --- a/drivers/iio/adc/ltc2497.c +++ b/drivers/iio/adc/ltc2497.c @@ -20,10 +20,10 @@ struct ltc2497_driverdata { struct ltc2497core_driverdata common_ddata; struct i2c_client *client; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ - __be32 buf ____cacheline_aligned; + __be32 buf __aligned(IIO_ALIGN); }; static int ltc2497_result_and_measure(struct ltc2497core_driverdata *ddata, From patchwork Tue May 3 08:58:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835323 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 996FDC4332F for ; Tue, 3 May 2022 08:55:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233060AbiECI7T (ORCPT ); Tue, 3 May 2022 04:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233071AbiECI64 (ORCPT ); Tue, 3 May 2022 04:58:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E368A18B3E for ; Tue, 3 May 2022 01:55:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7FA1C61266 for ; Tue, 3 May 2022 08:55:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 310F9C385B3; Tue, 3 May 2022 08:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568122; bh=YYjIlAMbZFXS5TJCoxi+sB+JWOWMX+6tZaFa1o0muw0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a2l3ZWkhep32CTNWg4Z6WmHyDQXr2A68VXngqTwkYCGU3VscUFUkplmYzntWKB0N1 PmhJvqL3zOC+Qp0HpPRGtT74bjqSj3IQSiQBtKLSzRsoZPeoyuhwcu3S6JH11xceQ9 dUC4JsRpfdXeV+hcHb9pDUtiz59cXz84Gz0HazBNNMmqvofb9U8cxfEKENP8RSnL3Z o7xmrd5D36RgSLr2rZiAgLYiUcEQ/pRTRQFMG9z5+a91ea6JfLcNXO+biRSykH+7Zk Djrn/wYP4/ToYKuDwX4RBuvEJU7HB5kxF7HOhmrwQp2OX6STaFmYqMGfsWHZLgW4r1 Oqgserkhc9wJw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 23/92] iio: adc: max1027: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:26 +0100 Message-Id: <20220503085935.1533814-24-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: fc167f624833 ("iio: add support of the max1027") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/max1027.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c index 4daf1d576c4e..f79fe49d69b7 100644 --- a/drivers/iio/adc/max1027.c +++ b/drivers/iio/adc/max1027.c @@ -272,7 +272,7 @@ struct max1027_state { struct mutex lock; struct completion complete; - u8 reg ____cacheline_aligned; + u8 reg __aligned(IIO_ALIGN); }; static int max1027_wait_eoc(struct iio_dev *indio_dev) From patchwork Tue May 3 08:58:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835322 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86728C43217 for ; Tue, 3 May 2022 08:55:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233071AbiECI7U (ORCPT ); Tue, 3 May 2022 04:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233116AbiECI7G (ORCPT ); Tue, 3 May 2022 04:59:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0498E2B26D for ; Tue, 3 May 2022 01:55:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BF204B81BE5 for ; Tue, 3 May 2022 08:55:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B4B7C385B0; Tue, 3 May 2022 08:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568132; bh=votvr6jkxER1/Y3zpT0OlDP7ViaYazCfgmE9yMu/CGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=imOEE+tt4inkHm6sx96Uom0hewRCEZBXVWIPG07qvQWjESEF/WJvy1YQ8bPsfkar8 OPMkkwB/OQy+15nJIVboiTOvRurk2VL+CN4yOeP+cPbmCj3k15eShDnWIGFoxCV8s/ BNhIhN6ABN1QGYNlda5VxjpH2tXfCy+VBmpp8DntIlcVs6S6eHo3UYCBH6zFYktb/w WTNIyyaqKXdPG48L2JLLRQz3z3ZQM2Tc1lKUi0JATBjUPJTFJX+vkZmXC4NaNX3uNO mRUa8ashcPjtbztGpYqJ4zjrMiZjv5GpeqVFjhBdJ3o2TwFlTz9ReRK8sPM0JFsxEo 7V1jVIcSOhl0g== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 24/92] iio: adc: max11100: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:27 +0100 Message-Id: <20220503085935.1533814-25-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: a8e7e88df9ec ("iio: adc: Add Maxim MAX11100 driver") Signed-off-by: Jonathan Cameron Cc: Jacopo Mondi Acked-by: Jacopo Mondi --- drivers/iio/adc/max11100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/max11100.c b/drivers/iio/adc/max11100.c index eb1ce6a0315c..4766d45344f7 100644 --- a/drivers/iio/adc/max11100.c +++ b/drivers/iio/adc/max11100.c @@ -33,10 +33,10 @@ struct max11100_state { struct spi_device *spi; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ - u8 buffer[3] ____cacheline_aligned; + u8 buffer[3] __aligned(IIO_ALIGN); }; static const struct iio_chan_spec max11100_channels[] = { From patchwork Tue May 3 08:58:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835324 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09729C43219 for ; Tue, 3 May 2022 08:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233038AbiECI7U (ORCPT ); Tue, 3 May 2022 04:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233136AbiECI7R (ORCPT ); Tue, 3 May 2022 04:59:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25F122DD5B for ; Tue, 3 May 2022 01:55:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9828CB81BE9 for ; Tue, 3 May 2022 08:55:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38D23C385B3; Tue, 3 May 2022 08:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568142; bh=NVv3Sup2Gh4TtjUUTxM5mU3w5irBaqRQooRtwe82l1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B6LnshQ7XWuAdsNf/5LHNfq7eRtdKzOOsuCfLAAK0N8njZoM2Vhse8pf4/aF4Yqh9 q0yBAu2sM1eg+QHFF1xkESURO+TwkC77FlLwv5oOGxau8fodCtQ5Lst0Dlb2ViNxJr QfJQQBPWODGM16/1/Z3tkjDKDCsvLHTi6FqQLx2escJnsR5RB5ctXhHsT1T5PzKMQk yFVIlC6dpST7wQc1YuzOI4hZ0I4kdJiMtlj94gMD7a8Aa70j5HK6kCyxzpfOF9DhIP UQKIJJ54wpf8tr30RtDgAs3ZMVrV6Mnzt1zDAIyFvD1oOaY4hmx/9tRla2dBVrnOkC X8Qb4Snypox5g== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 25/92] iio: adc: max1118: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:28 +0100 Message-Id: <20220503085935.1533814-26-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: a9e9c7153e96 ("iio: adc: add max1117/max1118/max1119 ADC driver") Signed-off-by: Jonathan Cameron Cc: Akinobu Mita --- drivers/iio/adc/max1118.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/max1118.c b/drivers/iio/adc/max1118.c index a41bc570be21..6520acaa6938 100644 --- a/drivers/iio/adc/max1118.c +++ b/drivers/iio/adc/max1118.c @@ -42,7 +42,7 @@ struct max1118 { s64 ts __aligned(8); } scan; - u8 data ____cacheline_aligned; + u8 data __aligned(IIO_ALIGN); }; #define MAX1118_CHANNEL(ch) \ From patchwork Tue May 3 08:58:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11040C433EF for ; Tue, 3 May 2022 08:56:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233066AbiECI7c (ORCPT ); Tue, 3 May 2022 04:59:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233075AbiECI7a (ORCPT ); Tue, 3 May 2022 04:59:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D41C536312 for ; Tue, 3 May 2022 01:55:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 70F0F612FE for ; Tue, 3 May 2022 08:55:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED0C4C385A4; Tue, 3 May 2022 08:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568151; bh=S7JbmaK1gDOvlJtqDvbGv4b9Xf9XakDgGWtzPmBVk60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uBAm7Sy5rPkFymUyhx10zazVh/TV0G/T6MJVhXMxusdjKmEow12lTOA2S5CBhJTki urGKUrtzVmhkgMsBunwWxQfa39W7K6UULtYV/3Q83pEI3bK3t3KoCgDA/eEFpJ5Cqf HgwVvFY4ja9sTcgCm088rJIcAMzQxi3W3JOjxHHtNJIouoRPg3zar96+gb90R2Qobm sLU2VRLjlKm13L9xLc7gQuVzXA3Z9vGWd5gomGkjxjnV9UIdTI9BWMcHFldB39ciqu GKX+/APUQxUayVk29COQjepSnoDMDE1TrN8ekDHdYf3aZH6xvw0QQuuNt5QJZlqTy6 7/+F7iP2RzyBg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 26/92] iio: adc: max1241: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:29 +0100 Message-Id: <20220503085935.1533814-27-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 8a80a71d9020 ("iio: adc: Add MAX1241 driver") Signed-off-by: Jonathan Cameron Cc: Alexandru Lazar Acked-by: Alexandru Lazar --- drivers/iio/adc/max1241.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/max1241.c b/drivers/iio/adc/max1241.c index a5afd84af58b..e3dbcc2e4e77 100644 --- a/drivers/iio/adc/max1241.c +++ b/drivers/iio/adc/max1241.c @@ -26,7 +26,7 @@ struct max1241 { struct regulator *vref; struct gpio_desc *shutdown; - __be16 data ____cacheline_aligned; + __be16 data __aligned(IIO_ALIGN); }; static const struct iio_chan_spec max1241_channels[] = { From patchwork Tue May 3 08:58:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835326 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17984C433EF for ; Tue, 3 May 2022 08:56:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233054AbiECI7f (ORCPT ); Tue, 3 May 2022 04:59:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233058AbiECI7e (ORCPT ); Tue, 3 May 2022 04:59:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36A2D36302 for ; Tue, 3 May 2022 01:56:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CF215B81A9A for ; Tue, 3 May 2022 08:56:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D896C385B2; Tue, 3 May 2022 08:55:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568160; bh=DOHw1JFl7Au2bILP541xfQIOYQvoTz718tLKZ917eqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IGzgh0KajY4MUInkv5fvT471G3NdS6Wj69ljZw+qToudOE9ml3tcIfzUxH035S3f4 MoGUiM30S17xl/icONMAw+S7YqzVVHKHQTtYrYc+ZGCMljsa7wyDagUQTbwsvXUOGo qy9ENorvqLaij1//o2hZI2EbcRmt95gHr+yX0U7AoViHw+YsvHMVdBXFbDsZ6adcr4 x8tw8CvHo2ykVGly9RXb0fhG8jODWttJBHulah5rEHF+ZtC5NS7fTWpLni1qNNZPrx XYPV7f/ee44f5z6QRJBSinfdzL0/lbOr5eOJ7pMVJj897HFCol32b2KdqHJqmKSXNH +xbARxiCMW/zw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 27/92] iio: adc: mcp320x: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:30 +0100 Message-Id: <20220503085935.1533814-28-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Worth noting the fixes tag refers to the same issue being observed on a platform that probably had only 64 byte cachelines. Fixes: 0e81bc99a082 ("iio: mcp320x: Fix occasional incorrect readings") Signed-off-by: Jonathan Cameron Cc: Michael Welling --- drivers/iio/adc/mcp320x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/mcp320x.c b/drivers/iio/adc/mcp320x.c index b4c69acb33e3..bd3ef543cc5d 100644 --- a/drivers/iio/adc/mcp320x.c +++ b/drivers/iio/adc/mcp320x.c @@ -92,7 +92,7 @@ struct mcp320x { struct mutex lock; const struct mcp320x_chip_info *chip_info; - u8 tx_buf ____cacheline_aligned; + u8 tx_buf __aligned(IIO_ALIGN); u8 rx_buf[4]; }; From patchwork Tue May 3 08:58:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835327 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14C1FC433F5 for ; Tue, 3 May 2022 08:56:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231273AbiECI7r (ORCPT ); Tue, 3 May 2022 04:59:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiECI7m (ORCPT ); Tue, 3 May 2022 04:59:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D264236141 for ; Tue, 3 May 2022 01:56:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6E5B961329 for ; Tue, 3 May 2022 08:56:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DF60C385B0; Tue, 3 May 2022 08:56:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568169; bh=L8nwN4eo/PXE8EV06YujWPh7wxwvltSpvUWHK0TkhTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fg6pO6p9ud4LZHlxKliJbut7xPHgIRwg+zEhpNRSsQgMd1lbJPdxEZacLVxE8Vnnp Ne01uUsSEWZ3mxJRQMReQR36uf91dw4mbGQHQf2Hd1zrFM05CcmxgbcSAVk94m57oA GHxxIk4rJf+RzLZniA7cKoR68O82KBNw0YKadZ4Nd/EBgbR7m4O5fpEs9sksTiTnB1 LhEnlZ02M9aOP6yKLu208Mmlr7XPZX5PW/tkkNt0JWQ89uDtAhbRujPcpm711HLGvB fjhsxEOeWJ+3WGaoa/KxRyPSDN2fOy59Wx3tB13y8bwoNHJo+stz4Latnt0Gtnk4Hs R7wMHyi+ysPBA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 28/92] iio: adc: ti-adc0832: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:31 +0100 Message-Id: <20220503085935.1533814-29-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: efc945fb729c ("iio: adc: add support for ADC0831/ADC0832/ADC0834/ADC0838 chips") Signed-off-by: Jonathan Cameron Cc: Akinobu Mita --- drivers/iio/adc/ti-adc0832.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-adc0832.c b/drivers/iio/adc/ti-adc0832.c index fb5e72600b96..0a18e63e70cd 100644 --- a/drivers/iio/adc/ti-adc0832.c +++ b/drivers/iio/adc/ti-adc0832.c @@ -36,7 +36,7 @@ struct adc0832 { */ u8 data[24] __aligned(8); - u8 tx_buf[2] ____cacheline_aligned; + u8 tx_buf[2] __aligned(IIO_ALIGN); u8 rx_buf[2]; }; From patchwork Tue May 3 08:58:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835328 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE356C433F5 for ; Tue, 3 May 2022 08:56:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233058AbiECI7x (ORCPT ); Tue, 3 May 2022 04:59:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiECI7w (ORCPT ); Tue, 3 May 2022 04:59:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11D6936161 for ; Tue, 3 May 2022 01:56:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A1F26612DD for ; Tue, 3 May 2022 08:56:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62C3EC385A4; Tue, 3 May 2022 08:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568179; bh=lHj2vQhzucEiq3jHmXCf6RtwutscHCKUf5XBwb1ON9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ffqNpvCIanG/LzPNUfEHa7K4xo6AHGClNqWHcsz/40ZGqoety/aHEE5XnKOGQXpNB 6my85+9Cq8Jq86Fbh2iTme+rc1KImEhnyrGunLipS8/3bp/M9xzLdUv7pGdpHdapF0 3BOXm6cCOqW3wCOYlisGN2jEmyKnqNsw3BZR7DOb4sAg/H4e1cCcpw2mgWbg7BpX+u Mz0SUr7t3pQTXn2eQp0ZiKxltCLtQxqos4ozY+xOonLh5vXrjZ1qGS2iD90fYuPnNd KoKWLJ4X+90Lx1CiYtsWdHqnsFzo/M59TpBfuAslCzU4/vVcAmz9lP6TlNmg8hzj/I Zug9xi0ceuocg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 29/92] iio: adc: ti-adc084s021: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:32 +0100 Message-Id: <20220503085935.1533814-30-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: 3691e5a69449 ("iio: adc: add driver for the ti-adc084s021 chip") Signed-off-by: Jonathan Cameron Cc: Mårten Lindahl Acked-by: Mårten Lindahl --- drivers/iio/adc/ti-adc084s021.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-adc084s021.c b/drivers/iio/adc/ti-adc084s021.c index c9b5d9aec3dc..6464541319af 100644 --- a/drivers/iio/adc/ti-adc084s021.c +++ b/drivers/iio/adc/ti-adc084s021.c @@ -32,10 +32,10 @@ struct adc084s021 { s64 ts __aligned(8); } scan; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache line. */ - u16 tx_buf[4] ____cacheline_aligned; + u16 tx_buf[4] __aligned(IIO_ALIGN); __be16 rx_buf[5]; /* First 16-bits are trash */ }; From patchwork Tue May 3 08:58:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835329 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1CC2C433EF for ; Tue, 3 May 2022 08:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233028AbiECJAB (ORCPT ); Tue, 3 May 2022 05:00:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiECJAB (ORCPT ); Tue, 3 May 2022 05:00:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2B4A36141 for ; Tue, 3 May 2022 01:56:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 411CB6126D for ; Tue, 3 May 2022 08:56:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97798C385B2; Tue, 3 May 2022 08:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568188; bh=V1hoaQTCsdNE7BC6xp608amDLKMrFoZ5Gr763uAhcDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MZ35NCVQlwMnluY0FbUDycjeix8/9yDK+HG6T3qEUddU20XqqlEWJsgiVFR89oFzk XikTvwd5BvRId+uWZw78fyRBwLS8QngCOznwLCyGSjQRc480e5nIXZVsUzD1Xh1aDH GTJ3dq2pzbEltIVsLivrKQzC8kCA6Kz4qyodhm0zIGDI/hEeDYXXTs6eG9CKCMpF5d 5e5+fBakIH0fr39gyU2Ux/KJPM3YuzA12E1Zxhbw4266p1ba/ncm5QdB4LtlAXvueP YtgQjlhhKvYvieFFamFm3JUJLAt1ADcUafO6SJ6RViVaPqx5ClA7TVajT+t7Q/wxPd rG/bCG4KLIR6w== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 30/92] iio: adc: ti-adc108s102: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:33 +0100 Message-Id: <20220503085935.1533814-31-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Dual fixes tags as two cases that were introduced in different patches. One of those patches is a fix however and likely to have been backported to stable kernels. Fixes: 3691e5a69449 ("iio: adc: add driver for the ti-adc084s021 chip") Fixes: cbe5c6977604 ("iio: adc: ti-adc108s102: Fix alignment of buffer pushed to iio buffers.") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ti-adc108s102.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-adc108s102.c b/drivers/iio/adc/ti-adc108s102.c index c8e48881c37f..4307d87d5400 100644 --- a/drivers/iio/adc/ti-adc108s102.c +++ b/drivers/iio/adc/ti-adc108s102.c @@ -77,8 +77,8 @@ struct adc108s102_state { * tx_buf: 8 channel read commands, plus 1 dummy command * rx_buf: 1 dummy response, 8 channel responses */ - __be16 rx_buf[9] ____cacheline_aligned; - __be16 tx_buf[9] ____cacheline_aligned; + __be16 rx_buf[9] __aligned(IIO_ALIGN); + __be16 tx_buf[9] __aligned(IIO_ALIGN); }; #define ADC108S102_V_CHAN(index) \ From patchwork Tue May 3 08:58:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835330 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC216C433EF for ; Tue, 3 May 2022 08:56:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230339AbiECJAR (ORCPT ); Tue, 3 May 2022 05:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233085AbiECJAM (ORCPT ); Tue, 3 May 2022 05:00:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DC743632C for ; Tue, 3 May 2022 01:56:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1F066B81C66 for ; Tue, 3 May 2022 08:56:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55726C385B1; Tue, 3 May 2022 08:56:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568197; bh=J04tOqRAuTq5bRWNE9JPzQ6uWbnXLfjth0Vn/m5J9LU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s9j+MsJ3rQj4AV/uQqa67QaYSiUhEoMk6zGjzyYKWBKObL8Fh+k+hLr+GjVynUnHz msJ+r07/zFakKL8PlkfrT7c5PEpCj4sGdFIwmSxjVtdUfb61vJEZeODPHD++ZZNGEB e0paLIRxvp6/7QDDuwsm5RFcnNo0pDAll9QaWDsL1HlMEjvVWdQYyfqm4l+8itT3nV 2ynHc0R0Dmj+Jo9w1llsX/HObZI/gdeWjQMAU1DaPvQAi1uI4PySfdpOTmzDN+z6WD 518OtgsRigm23OISdlWMVXXLT4RRbpNfiZGIusuYfvTA9X5zqTA5g4p8JQ747qYHze E29LOBLmBTz/A== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 31/92] iio: adc: ti-adc12138: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:34 +0100 Message-Id: <20220503085935.1533814-32-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 50a6edb1b6e0 ("iio: adc: add ADC12130/ADC12132/ADC12138 ADC driver") Signed-off-by: Jonathan Cameron Cc: Akinobu Mita --- drivers/iio/adc/ti-adc12138.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-adc12138.c b/drivers/iio/adc/ti-adc12138.c index 59d75d09604f..f93eaa7e6143 100644 --- a/drivers/iio/adc/ti-adc12138.c +++ b/drivers/iio/adc/ti-adc12138.c @@ -55,7 +55,7 @@ struct adc12138 { */ __be16 data[20] __aligned(8); - u8 tx_buf[2] ____cacheline_aligned; + u8 tx_buf[2] __aligned(IIO_ALIGN); u8 rx_buf[2]; }; From patchwork Tue May 3 08:58:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835331 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBFA4C433EF for ; Tue, 3 May 2022 08:56:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233085AbiECJA2 (ORCPT ); Tue, 3 May 2022 05:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233088AbiECJAV (ORCPT ); Tue, 3 May 2022 05:00:21 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0E5B36175 for ; Tue, 3 May 2022 01:56:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9829FB81BE5 for ; Tue, 3 May 2022 08:56:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70DD8C385B2; Tue, 3 May 2022 08:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568207; bh=AC4fsPPKUja2Db0fuh8xLITAKrXrB4pCXFhEEwXgMQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S1v3RLnmeEPXWxfNZm5v7nuiacac317E4ynxBE30ueq3k273FuywC+Qfb/WdhX5Pn DrXkpee5MqkhLh6+VV2zrZ2Qy/XGNESe+ySlk9fwMxgOIWsS1K0+bHgCBre9ZlFlB5 HxW3gcO6Z3S/AyxqhpLmV1rDTc5k9+ZgiWa3dPT+kSmunDdB7Rv0rn5jXIJjRKGuK0 6y7IdZvKLL9oiHvXZolLjhs48DF9cnL82/xwciQqHONivPc/lST4/9COrA3ZcdLS/E CWZtS5tbcBcXoez7GFCMb1COlVnWCc/ll+9OYAk/9G4rBr8PxMYIRWSvH8UYSRdu57 lvJ2Cwuxp8ReQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 32/92] iio: adc: ti-adc128s052: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:35 +0100 Message-Id: <20220503085935.1533814-33-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 913b86468674 ("iio: adc: Add TI ADC128S052") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ti-adc128s052.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c index 8e7adec87755..db4fd0ea7692 100644 --- a/drivers/iio/adc/ti-adc128s052.c +++ b/drivers/iio/adc/ti-adc128s052.c @@ -29,7 +29,7 @@ struct adc128 { struct regulator *reg; struct mutex lock; - u8 buffer[2] ____cacheline_aligned; + u8 buffer[2] __aligned(IIO_ALIGN); }; static int adc128_adc_conversion(struct adc128 *adc, u8 channel) From patchwork Tue May 3 08:58:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835332 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62BB8C433EF for ; Tue, 3 May 2022 08:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233044AbiECJA3 (ORCPT ); Tue, 3 May 2022 05:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiECJA3 (ORCPT ); Tue, 3 May 2022 05:00:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA1B36154 for ; Tue, 3 May 2022 01:56:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1C57E6134C for ; Tue, 3 May 2022 08:56:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BED61C385B0; Tue, 3 May 2022 08:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568216; bh=LBTEKZ8x0/dYv7DCqBeX9HGE6xYBGlXcinS7wn/MohQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ESry+IWSucAfWU6Bq9kfa0nBq9/NBBlaWWb1C/b4IgRUvNUS80FObktk/1579VLVD 6HwXPHDssHXlu/W7y0rlyEerdsdd6YFdQXjDpDimiOHgUMP5KijfZCtrXG4M4+DczQ c7MOpzNd/S8cizlmsrZpdkyctNCjwi86mvVCNb91UlhTDMDKP2lkvqY9UXqtqhNIWx ZtqOkkt257wmOWyyQ8285lAOHs44GC7r8wYRR2SJRDjVLzOKc0Epypp/P/F2L+s5w3 HzruHBeuTbAeFB9LOh2hXzWQOU62Ty0QW+5eWh2qut6GN0nSAboHzqZbmNLm4OxWGb ojcOlL1SEtUbQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 33/92] iio: adc: ti-adc161s626: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:36 +0100 Message-Id: <20220503085935.1533814-34-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 4d671b71beef ("iio: adc: ti-adc161s626: add support for TI 1-channel differential ADCs") Signed-off-by: Jonathan Cameron Cc: Matt Ranostay --- drivers/iio/adc/ti-adc161s626.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-adc161s626.c b/drivers/iio/adc/ti-adc161s626.c index 75ca7f1c8726..c422da519004 100644 --- a/drivers/iio/adc/ti-adc161s626.c +++ b/drivers/iio/adc/ti-adc161s626.c @@ -71,7 +71,7 @@ struct ti_adc_data { u8 read_size; u8 shift; - u8 buffer[16] ____cacheline_aligned; + u8 buffer[16] __aligned(IIO_ALIGN); }; static int ti_adc_read_measurement(struct ti_adc_data *data, From patchwork Tue May 3 08:58:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD1EFC433EF for ; Tue, 3 May 2022 08:57:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229854AbiECJAi (ORCPT ); Tue, 3 May 2022 05:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbiECJAi (ORCPT ); Tue, 3 May 2022 05:00:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D461736154 for ; Tue, 3 May 2022 01:57:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 712C261351 for ; Tue, 3 May 2022 08:57:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0491FC385B2; Tue, 3 May 2022 08:56:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568225; bh=XygOpR/XRamboLJbrpxuUlhdcNKzCEPQyyxlGKzI44A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MsbYyOypFw29q0g2xvjjKYbyY6UyJpzB8nz1GGVJGiyh0gMDKtWHd89HNhrF7mhwp N2lhdkYkkX3dC8zxuTefXZfaihsaX/Fv5uoDJpJr+20/e0joGxNhsCLGngeZBqJpmw qjngBGnHVyJrH+5vVmWyP6mYIHh5Va3w/R74U3IXMjf/S9224Q2yh9rrWCxAkMavRO /O1CztEe5FSuVc8RKmz7Ah4KBGI6WrpoiBxPBQEq1Dx0vx/ZEFgYyjn0DxIY+oySGK YqR3evrOgaoKxaYHoSdNoI+F/zKmra++g2CGj9Rd0JPCmjnJPJJN+/91sFoVWiP3aS UgZR9l07BEbuA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 34/92] iio: adc: ti-ads124s08: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:37 +0100 Message-Id: <20220503085935.1533814-35-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: e717f8c6dfec ("iio: adc: Add the TI ads124s08 ADC code") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ti-ads124s08.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c index 767b3b634809..b05d98c50c1e 100644 --- a/drivers/iio/adc/ti-ads124s08.c +++ b/drivers/iio/adc/ti-ads124s08.c @@ -106,7 +106,7 @@ struct ads124s_private { * timestamp is maintained. */ u32 buffer[ADS124S08_MAX_CHANNELS + sizeof(s64)/sizeof(u32)] __aligned(8); - u8 data[5] ____cacheline_aligned; + u8 data[5] __aligned(IIO_ALIGN); }; #define ADS124S08_CHAN(index) \ From patchwork Tue May 3 08:58:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E390BC433F5 for ; Tue, 3 May 2022 08:57:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233088AbiECJAu (ORCPT ); Tue, 3 May 2022 05:00:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbiECJAt (ORCPT ); Tue, 3 May 2022 05:00:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEC3B36154 for ; Tue, 3 May 2022 01:57:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A429EB81BE1 for ; Tue, 3 May 2022 08:57:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 661D2C385A9; Tue, 3 May 2022 08:57:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568235; bh=nPC2DmqzAK3DSkF6N8/RDWmAUZv2g0RzReAvIkV4AkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a5O9DY5Dxlbbt7ITGeIe9S3mVbVAKix/ToaYtURc68XXLC7QxYtRgf9sZ+4Wv2j6q dPSPnBI+mDGGFoomsfGjvfp74X7eNIEPxcXXrJhikcyqz8p3DMl9/cMPbJjfoXks88 5FsGavyouym2coe39dZT3wOEofVE5jG1w/D1pie22SU2iqckRTxNraID9Y4mUBaD/K m7PW9KWopgbC0hU+8Fisua5jo9xbAt1EEQw5KA1wlGbWcrzcMaI7G+EIOUz2LML5dV +cxJQjoxODbwN5/BxlOueMvRGRF/Ety8mPFuogLY1A9t7Tmw8e2kQDqNwJPkdo0vqN pBEYxhA6wbyDA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 35/92] iio: adc: ti-ads131e08: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:38 +0100 Message-Id: <20220503085935.1533814-36-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: d935eddd2799 ("iio: adc: Add driver for Texas Instruments ADS131E0x ADC family") Signed-off-by: Jonathan Cameron Cc: Tomislav Denis --- drivers/iio/adc/ti-ads131e08.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-ads131e08.c b/drivers/iio/adc/ti-ads131e08.c index 0c2025a22575..fb490471ffb9 100644 --- a/drivers/iio/adc/ti-ads131e08.c +++ b/drivers/iio/adc/ti-ads131e08.c @@ -105,7 +105,7 @@ struct ads131e08_state { s64 ts __aligned(8); } tmp_buf; - u8 tx_buf[3] ____cacheline_aligned; + u8 tx_buf[3] __aligned(IIO_ALIGN); /* * Add extra one padding byte to be able to access the last channel * value using u32 pointer From patchwork Tue May 3 08:58:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B4FAC433EF for ; Tue, 3 May 2022 08:57:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231758AbiECJBA (ORCPT ); Tue, 3 May 2022 05:01:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbiECJA7 (ORCPT ); Tue, 3 May 2022 05:00:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7852636302 for ; Tue, 3 May 2022 01:57:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 359EBB81A99 for ; Tue, 3 May 2022 08:57:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A9F4C385A4; Tue, 3 May 2022 08:57:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568245; bh=zNbE+kidWuGdFMnV1HGQgTfCdD3pI+EHgO7BT+S645g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iVZKfzGwPDlXSlgapASUIm7wP7UbvVB/p2C+o/umG+XD4tdNsQ9qJL18fA15pMCJO FLlogQqRUW96pfJzb4CUkwiTuPeJha8df4HU/OOS7Shi6aJ38bOIqydf5QnuANBICA ch6MIpYRS3cCFTdPe1XqJ2TvDvl0cNHF8gLpWrAGltr9vr6pb26kd+5dzbHCCJUdR8 gAlxSFWLVh2dLp7ePxF0A2Ly3znTsrW7HXDVcDaVqeWIx7rlRmeUpghdW8jhFOQrv7 H0bJ/ybCu+mFG3DY8hUUDmYef7kM3Emt0RZAVbSRpgEjhPHGzPTBeSY4STcQYyBEyT 1yOkm+JK+/SrQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 36/92] iio: adc: ti-ads7950: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:39 +0100 Message-Id: <20220503085935.1533814-37-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: 902c4b2446d4 ("iio: adc: New driver for TI ADS7950 chips") Signed-off-by: Jonathan Cameron Cc: David Lechner Acked-by: David Lechner --- drivers/iio/adc/ti-ads7950.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-ads7950.c b/drivers/iio/adc/ti-ads7950.c index e3658b969c5b..a1337469d0f2 100644 --- a/drivers/iio/adc/ti-ads7950.c +++ b/drivers/iio/adc/ti-ads7950.c @@ -102,11 +102,11 @@ struct ti_ads7950_state { unsigned int gpio_cmd_settings_bitmask; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ u16 rx_buf[TI_ADS7950_MAX_CHAN + 2 + TI_ADS7950_TIMESTAMP_SIZE] - ____cacheline_aligned; + __aligned(IIO_ALIGN); u16 tx_buf[TI_ADS7950_MAX_CHAN + 2]; u16 single_tx; u16 single_rx; From patchwork Tue May 3 08:58:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835336 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62126C433F5 for ; Tue, 3 May 2022 08:57:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233095AbiECJBJ (ORCPT ); Tue, 3 May 2022 05:01:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233094AbiECJBG (ORCPT ); Tue, 3 May 2022 05:01:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CF453630B for ; Tue, 3 May 2022 01:57:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ADBBB6126D for ; Tue, 3 May 2022 08:57:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A368CC385B2; Tue, 3 May 2022 08:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568254; bh=+i+rHho6JbACgtOJMPVH74qRCXchxxXNx+F6UsQV6wI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uGslf/0EO0KTEl9yhi2jNT2YI4WivYLcjN6VYtIysVVLmnkQ+gtf8bl9FR6xWgL6Q wjQ6/tmPC2M2hUrhLGIM7jPonoD8NHqnvS/hTKuoCvb9kN8p8pwdTpdJe/Pha8GNFj q4ZAkLlkAWeZ9C1k6GiCi5xFCrjZDmROdsrMQucwfJ+3JkUrmUwir1uiwZJOq2werT G/h9Mws5ucLaPk+sAeP7+A3GG4z6sbvwDU3LGWxU5lvv1BJCHzIZHkYshilrDYbJaT MCy2uNElF8HrYyec3i+x8PKqyxT2fU/BMDLo//MSEoO6tEMoZcBzNnskDcOkqjj9d8 WfcQr9d0lm2Ww== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 37/92] iio: adc: ti-ads8344: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:40 +0100 Message-Id: <20220503085935.1533814-38-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 8dd2d7c0fed7 ("iio: adc: Add driver for the TI ADS8344 A/DC chips") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ti-ads8344.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-ads8344.c b/drivers/iio/adc/ti-ads8344.c index c96d2a9ba924..6d182d5f7805 100644 --- a/drivers/iio/adc/ti-ads8344.c +++ b/drivers/iio/adc/ti-ads8344.c @@ -28,7 +28,7 @@ struct ads8344 { */ struct mutex lock; - u8 tx_buf ____cacheline_aligned; + u8 tx_buf __aligned(IIO_ALIGN); u8 rx_buf[3]; }; From patchwork Tue May 3 08:58:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE159C433EF for ; Tue, 3 May 2022 08:57:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231274AbiECJBV (ORCPT ); Tue, 3 May 2022 05:01:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233112AbiECJBS (ORCPT ); Tue, 3 May 2022 05:01:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DABD366AA for ; Tue, 3 May 2022 01:57:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 09AD4B81BE1 for ; Tue, 3 May 2022 08:57:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6798C385B4; Tue, 3 May 2022 08:57:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568263; bh=/QIdpEkt5YW3tLhcK/9Zp5pqlbDfFQvSsc9CbblR6e0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wc4TCNuvhZXMnVu/4NJDqFtivaqoXRXZ0I3BWoDLlOuEiTVtCBRgmq8OkssgYWwwT CcC6hyoLbcNaDdDCH3IkbDApdGwYvS/mI3ZOpOSRh0x6VNvbSiJMu8YvKXo4GKAcVF jaw3OygSroMQBiTIsFMn8Tv3byPaofWFVxyoLvqMZuXJofYTnMbOXtXbcHo18HUyoW XeyLuUg+4Nyx/IGzSUfYF8BKD2mcQV1vJ51KQw+33yI7TNpbFMpcOCh7aikpLbaWP/ 4y8zt5/iW6TRu0YDy46uwMNNuUIndX4oAYAOHWNqu/4GO6SlpU0uH6Gm2XNcdb7PAN Vjo/hZwuCXwtQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 38/92] iio: adc: ti-ads8688: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:41 +0100 Message-Id: <20220503085935.1533814-39-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 3e87e7838328 ("iio: adc: Add TI ADS8688") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ti-ads8688.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-ads8688.c b/drivers/iio/adc/ti-ads8688.c index 22c2583eedd0..3ed422331dc3 100644 --- a/drivers/iio/adc/ti-ads8688.c +++ b/drivers/iio/adc/ti-ads8688.c @@ -71,7 +71,7 @@ struct ads8688_state { union { __be32 d32; u8 d8[4]; - } data[2] ____cacheline_aligned; + } data[2] __aligned(IIO_ALIGN); }; enum ads8688_id { From patchwork Tue May 3 08:58:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835338 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85C5FC433F5 for ; Tue, 3 May 2022 08:57:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233110AbiECJB0 (ORCPT ); Tue, 3 May 2022 05:01:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233105AbiECJBZ (ORCPT ); Tue, 3 May 2022 05:01:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 622DB36175 for ; Tue, 3 May 2022 01:57:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EAECD6134B for ; Tue, 3 May 2022 08:57:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64129C385C2; Tue, 3 May 2022 08:57:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568273; bh=TYzAvVm2ivargEWlAHa9bkYLp2mkvaTW3UJSAz5Z0j4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P4CLva1SkUTV9/MeHUhy5ZZnr18GF7P4kxD59V3UujHSTYtMUkejYVf3KL/vCA4Qh 97z/+gOGvmstoe+97SqQRvWcrbRXWye2/QjpTpxg/t6z+6AkxSfJMNDzS/vdIh7j1E QLRP3YJmJ8F6pZl1J8y17NgJ86qaCMBEjWccwHs0jKX39Nl10mKqRfGI9NCyAySvya ij354Cz/hpLDadsLXL0U5JPs/ckP643sDO/a7rVDE4DyG9FiDJduo3QGcIdW+UGdzy va908K4FoO8q6OupRjUKPvblFe9wesLdaT4VRfeuQm2sSyXhynfkFTbvfG2F5Rhr6U s8/6rF3/TEmoA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 39/92] iio: adc: ti-tlc4541: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:42 +0100 Message-Id: <20220503085935.1533814-40-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: ac2bec9d587c ("iio: adc: tlc4541: add support for TI tlc4541 adc") Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ti-tlc4541.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-tlc4541.c b/drivers/iio/adc/ti-tlc4541.c index 2406eda9dfc6..b418fc47dc8f 100644 --- a/drivers/iio/adc/ti-tlc4541.c +++ b/drivers/iio/adc/ti-tlc4541.c @@ -37,12 +37,12 @@ struct tlc4541_state { struct spi_message scan_single_msg; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. * 2 bytes data + 6 bytes padding + 8 bytes timestamp when * call iio_push_to_buffers_with_timestamp. */ - __be16 rx_buf[8] ____cacheline_aligned; + __be16 rx_buf[8] __aligned(IIO_ALIGN); }; struct tlc4541_chip_info { From patchwork Tue May 3 08:58:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835339 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02B2EC433EF for ; Tue, 3 May 2022 08:58:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232140AbiECJBj (ORCPT ); Tue, 3 May 2022 05:01:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233112AbiECJBi (ORCPT ); Tue, 3 May 2022 05:01:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68D3036332 for ; Tue, 3 May 2022 01:58:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F3F8361336 for ; Tue, 3 May 2022 08:58:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08D60C385B1; Tue, 3 May 2022 08:57:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568283; bh=nPdsk11uFGgd4Jsvi2wuO7sc6TTwHPSYNSF1teGXER0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=To66ZeauVvpBWmdEy7QShWjP+5UxCCnZBV0vXGFopx/BGN8j+wtqb1ntvkg7J10Pe bkkdyz0Lec8wZUzOHuHD0iVuk4ec6XxjcLsxLTYLG66ixZUllvNYwvStfXnL9nx7Uz gm8eqwBTgdILOpRKwe2bk72H1z0HCrPF5Clj/gjaFa5w3rYsvfhSkZ+0/uvF1jlSnP 8VfOUVhMELU3OgJgDK+SGveNHaCKTzy8+RTNjYXo4Xd69N4JBNg9GsbQZiOOTveYEZ acH8LvYGj+nyozUQmuCmJYtxe05qHqeyPYh+edFxp5sWBd8SldHUUQXkhQv1c+znkR wfsMlT/1rtZsw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 40/92] iio: addac: ad74413r: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:43 +0100 Message-Id: <20220503085935.1533814-41-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: fea251b6a5db ("iio: addac: add AD74413R driver") Signed-off-by: Jonathan Cameron Cc: Cosmin Tanislav --- drivers/iio/addac/ad74413r.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/addac/ad74413r.c b/drivers/iio/addac/ad74413r.c index acd230a6af35..99ddf3f4c544 100644 --- a/drivers/iio/addac/ad74413r.c +++ b/drivers/iio/addac/ad74413r.c @@ -77,13 +77,13 @@ struct ad74413r_state { struct spi_transfer adc_samples_xfer[AD74413R_CHANNEL_MAX + 1]; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ struct { u8 rx_buf[AD74413R_FRAME_SIZE * AD74413R_CHANNEL_MAX]; s64 timestamp; - } adc_samples_buf ____cacheline_aligned; + } adc_samples_buf __aligned(IIO_ALIGN); u8 adc_samples_tx_buf[AD74413R_FRAME_SIZE * AD74413R_CHANNEL_MAX]; u8 reg_tx_buf[AD74413R_FRAME_SIZE]; From patchwork Tue May 3 08:58:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835340 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC473C433EF for ; Tue, 3 May 2022 08:58:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233105AbiECJBq (ORCPT ); Tue, 3 May 2022 05:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232655AbiECJBp (ORCPT ); Tue, 3 May 2022 05:01:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04B123630B for ; Tue, 3 May 2022 01:58:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9820F612F1 for ; Tue, 3 May 2022 08:58:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A5BBC385B0; Tue, 3 May 2022 08:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568293; bh=3fy3lxfvD6vkcyolybUXl+5uGmAPzEJnMFUXhaOYO5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=piF5VGMZCJX//H2misD1fkpR3mPLcf8m7ckck+8d4GW0Xdhg1FEWVre6UEbdDjgR8 LXvgoPoip6wgx49NaVMSB8WmJ0ljWLLimowRrWS6bTCfxU+QYzbiJYaW6/P4JQU0r4 mzcyAHwQn8tMRwjCUPRi+wQ+ZlRQ2673qyI214osKLV0h1cmFflPcRUDkKUg54Pxfy xy50vchwTcYcNzAcuAUKjBKRYfF8i2WfFTZWpOJBj1W0MrsUq5jSkTAysr1YFDkwRP bU4d4Mqpj/QBzk8REVKbmVil/Uax1cdybtdoWDbQSxO3gUqM35I/NSVIW6Klb4cZu9 O9t/OREWVipfw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 41/92] iio: amplifiers: ad8366: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:44 +0100 Message-Id: <20220503085935.1533814-42-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: e71d42e03c60 ("iio: amplifiers: New driver for AD8366 Dual-Digital Variable Gain Amplifier") Signed-off-by: Jonathan Cameron --- drivers/iio/amplifiers/ad8366.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c index 1134ae12e531..8527d8bfc5db 100644 --- a/drivers/iio/amplifiers/ad8366.c +++ b/drivers/iio/amplifiers/ad8366.c @@ -45,10 +45,10 @@ struct ad8366_state { enum ad8366_type type; struct ad8366_info *info; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ - unsigned char data[2] ____cacheline_aligned; + unsigned char data[2] __aligned(IIO_ALIGN); }; static struct ad8366_info ad8366_infos[] = { From patchwork Tue May 3 08:58:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835341 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 270B3C4332F for ; Tue, 3 May 2022 08:58:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232218AbiECJB7 (ORCPT ); Tue, 3 May 2022 05:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232655AbiECJB5 (ORCPT ); Tue, 3 May 2022 05:01:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26CAC36302 for ; Tue, 3 May 2022 01:58:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D1901B81AEC for ; Tue, 3 May 2022 08:58:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90F83C385B2; Tue, 3 May 2022 08:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568303; bh=kH4OfT6BluApA/vIitrHwnr5GXk6JL5ZqnPVVgRO4zY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HnpwsnjjZZlEEra44o/gZM1BWoIiD9cc+BRE35wp3tb7ELjjC/h2glyjcrpHSzMbR ExXj+mRf1qio0paVVOh7WgyqnW8q2f1X99zBofYJuDGs8D3T1h2aykwhTgKkHhWzXT Mt4Klf3ExArNEKdXk7CTkjmZZ9XSJqZYlvX7wd8CVIj0hyfPXH2A1k4kKhvbD/xApb jp2WH2/MSV3sIilfA5OrbCI6LuDQhIGm1XNFAiKLxlc/hBJPFGq/67ET2CoaS7SPvQ vNwph1UcYaZQxOBHdkv+lO0DS9yW0OUtMtzGi/PWoIg0DD8w4M/zrDI1omdz1dOTOp lUMaDY1sPJeuQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 42/92] iio: common: ssp: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:45 +0100 Message-Id: <20220503085935.1533814-43-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 50dd64d57eee ("iio: common: ssp_sensors: Add sensorhub driver") Signed-off-by: Jonathan Cameron --- drivers/iio/common/ssp_sensors/ssp.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/common/ssp_sensors/ssp.h b/drivers/iio/common/ssp_sensors/ssp.h index abb832795619..33927e837022 100644 --- a/drivers/iio/common/ssp_sensors/ssp.h +++ b/drivers/iio/common/ssp_sensors/ssp.h @@ -221,8 +221,7 @@ struct ssp_data { struct iio_dev *sensor_devs[SSP_SENSOR_MAX]; atomic_t enable_refcount; - __le16 header_buffer[SSP_HEADER_BUFFER_SIZE / sizeof(__le16)] - ____cacheline_aligned; + __le16 header_buffer[SSP_HEADER_BUFFER_SIZE / sizeof(__le16)] __aligned(IIO_ALIGN); }; void ssp_clean_pending_list(struct ssp_data *data); From patchwork Tue May 3 08:58:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835342 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4121C433F5 for ; Tue, 3 May 2022 08:58:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233111AbiECJCI (ORCPT ); Tue, 3 May 2022 05:02:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232655AbiECJCG (ORCPT ); Tue, 3 May 2022 05:02:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FB7836154 for ; Tue, 3 May 2022 01:58:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D98CAB81AEC for ; Tue, 3 May 2022 08:58:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B7DFC385B0; Tue, 3 May 2022 08:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568312; bh=JtTgjB6w6OkdDMTiRI0pNpCmNGjjJIdECmYml6sUtcQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TeRed+2byGVB2ORDbtRTgTrzSsb9vvG+qf4qX21/PXnq9ieFkFrwKOCtpSIYXizaT GHI3wSP33SmtTLXyqGRV9QBV0pmXlxfB0j4HFq5jjlLE+v0PRl9hm5IzwQNrMuFyS1 r5wTmciu6yEByGcxtAN45L17bRCHk0QsrAfYgFHx/yPnOQAyFC2F+Iu3a/F8wNPACA MekuQ43HRYlmB3XOgK37VuICVIEXqOu/sTNxrD3iA4V0O3EcbJngB3pFAocGxwrGN3 zeolE0Df29UdhtgC0vmpwwryHeY0qMR5uxQplxrGtqyyKvCev7Iq9rViZUMzk1fVQl LbUfAZlWsDD4Q== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 43/92] iio: dac: ad5064: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:46 +0100 Message-Id: <20220503085935.1533814-44-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: 6a17a0768f77 ("iio:dac:ad5064: Add support for the ad5629r and ad5669r") Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen --- drivers/iio/dac/ad5064.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ad5064.c b/drivers/iio/dac/ad5064.c index 27ee2c63c5d4..daeea263dc6a 100644 --- a/drivers/iio/dac/ad5064.c +++ b/drivers/iio/dac/ad5064.c @@ -115,13 +115,13 @@ struct ad5064_state { struct mutex lock; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ union { u8 i2c[3]; __be32 spi; - } data ____cacheline_aligned; + } data __aligned(IIO_ALIGN); }; enum ad5064_type { From patchwork Tue May 3 08:58:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835343 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30206C433F5 for ; Tue, 3 May 2022 08:58:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233112AbiECJCR (ORCPT ); Tue, 3 May 2022 05:02:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232655AbiECJCO (ORCPT ); Tue, 3 May 2022 05:02:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F70436154 for ; Tue, 3 May 2022 01:58:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C2E316134E for ; Tue, 3 May 2022 08:58:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25962C385B3; Tue, 3 May 2022 08:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568322; bh=6bM43som17ODqz+Zyi6mFxRM7qV3ScdBmkNjiTj7mac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gq6jCt/eTPwfL3452WkElhkpFiTnDkzHgqQJgtQLZmeldv5LgfORzYoxb7Rel1DiD fqnHJrVjFEwq63qjuDxEAgEeYw+Nmd2XddxCEPGaw6SmdWynnRKAzQ8dF33rs/PqAd ZXhYDFhJP/CsfDCTKCK5kESJ6sst1L/AKLIdSsopsWBQEJGclYBxMYecKO/DsWTshm O2mmZch6wCfygxn5DgGk8gtTPSBVi0RUle+nbuIaNy51h1ulBlqI0OyoPhHwgMqZtP 2nBSNlMYCfwBIfjSqFn2CmHAueoO0gp5RDsWQbrJAbN7k74p7+wp0D2+doCi/YW89Q bKmmyKfjIWyrA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 44/92] iio: dac: ad5360: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:47 +0100 Message-Id: <20220503085935.1533814-45-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: a3e2940c24d3 ("staging:iio:dac: Add AD5360 driver") Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen --- drivers/iio/dac/ad5360.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ad5360.c b/drivers/iio/dac/ad5360.c index ecbc6a51d60f..b1f0e29e7526 100644 --- a/drivers/iio/dac/ad5360.c +++ b/drivers/iio/dac/ad5360.c @@ -79,13 +79,13 @@ struct ad5360_state { struct mutex lock; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ union { __be32 d32; u8 d8[4]; - } data[2] ____cacheline_aligned; + } data[2] __aligned(IIO_ALIGN); }; enum ad5360_type { From patchwork Tue May 3 08:58:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835344 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62FACC433F5 for ; Tue, 3 May 2022 08:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233082AbiECJC0 (ORCPT ); Tue, 3 May 2022 05:02:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232655AbiECJC0 (ORCPT ); Tue, 3 May 2022 05:02:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A05F036302 for ; Tue, 3 May 2022 01:58:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 549B8B81BE2 for ; Tue, 3 May 2022 08:58:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE0FAC385B0; Tue, 3 May 2022 08:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568332; bh=L+S6SEplbYu+8Rd1dgvdMo2WXC8htizjfW/0Z07Z0jE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OAcO5aEpaz97LsdbkCkpVHYZwblmN5HY8Rv0gVgxKSO5/39piMPXWaB3KyIEF8Bzz QiFMLU+91CePhr6fauYlJP64QxucFJyNqKqiBtiMbLz8j1PePEPSoA8PlE+WY1M3J3 9el7eo9JSjZvIRKTmXTqY3uCMTng4ClM6IdlDM9q85g5bPB8w/z9kRKdTFfef0KoYF Rthc8vy5oePPxCQ0Ds8e2o34nO3EhlOnJ+dtVNLV1knR+bQObu85XGZ1XKAH6ovaLY xwQ334/FRfZhwCwQJkyXn3IuLHsxUCsu5OO2fQdN53S5zeB5vA+AAJX1glUiBx3l6b /VXs6+NyBxgFg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 45/92] iio: dac: ad5421: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:48 +0100 Message-Id: <20220503085935.1533814-46-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: 5691b23489db ("staging:iio:dac: Add AD5421 driver") Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen --- drivers/iio/dac/ad5421.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ad5421.c b/drivers/iio/dac/ad5421.c index eedf661d32b2..48d36d4a6ff7 100644 --- a/drivers/iio/dac/ad5421.c +++ b/drivers/iio/dac/ad5421.c @@ -72,13 +72,13 @@ struct ad5421_state { struct mutex lock; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ union { __be32 d32; u8 d8[4]; - } data[2] ____cacheline_aligned; + } data[2] __aligned(IIO_ALIGN); }; static const struct iio_event_spec ad5421_current_event[] = { From patchwork Tue May 3 08:58:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835345 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4440AC433EF for ; Tue, 3 May 2022 08:59:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233113AbiECJCe (ORCPT ); Tue, 3 May 2022 05:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232655AbiECJCd (ORCPT ); Tue, 3 May 2022 05:02:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D38836154 for ; Tue, 3 May 2022 01:59:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9D37D61342 for ; Tue, 3 May 2022 08:59:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94B8BC385B1; Tue, 3 May 2022 08:58:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568341; bh=DQEsLTYZRLo/LHrcfOhOhh66E1znizBYQJrWow5iziY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=plo9YT3k2Fh5TxNOvWE4cVLRQcUsbJTBzGE09uQ5NcMgLB9E/0rx/GZCktMw8nkqz CORA3sYxffsf4myxX+4tjERlb7TtIP/XQcqYL5VTPV7kFfzSohZXzP942oodx5Y+xM PnZWqXnikkEchyQ93lsNJXdT3ZItcYcTWUE1P7k3WN8Be7TkAubLlGjh+b8jj/HJ4z Z5hMpCbYQWYtUTBLh+xBSXUlF3Gq4JE7POBUZKqOVyAXbsmgnql98M+SwJbrotyvM/ 31/Aa+jacWE8zYRKzAU5wrZJdumB1IzZQuvgPt4yw5/OK8UA/tcEyhwzxozvFIObhw CVKjH5xC5p9FA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 46/92] iio: dac: ad5449: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:49 +0100 Message-Id: <20220503085935.1533814-47-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: 8341dc04dfb3 ("iio:dac: Add support for the ad5449") Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen --- drivers/iio/dac/ad5449.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ad5449.c b/drivers/iio/dac/ad5449.c index bad9bdaafa94..87307484bd7a 100644 --- a/drivers/iio/dac/ad5449.c +++ b/drivers/iio/dac/ad5449.c @@ -68,10 +68,10 @@ struct ad5449 { uint16_t dac_cache[AD5449_MAX_CHANNELS]; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ - __be16 data[2] ____cacheline_aligned; + __be16 data[2] __aligned(IIO_ALIGN); }; enum ad5449_type { From patchwork Tue May 3 08:58:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835346 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91A60C433EF for ; Tue, 3 May 2022 08:59:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232655AbiECJCn (ORCPT ); Tue, 3 May 2022 05:02:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232391AbiECJCm (ORCPT ); Tue, 3 May 2022 05:02:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4980536154 for ; Tue, 3 May 2022 01:59:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D7A6361342 for ; Tue, 3 May 2022 08:59:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0916C385A9; Tue, 3 May 2022 08:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568350; bh=heQHm8KTpqbh4h+2BcrkvIjP0VF20eKjKx7KZJKIy4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N5ethp4qSI1Hl7nsGJrYjt2/g5O2/hKtTYBHdAIsCKWqfId3E0hOYU2ZQQHmPdqUx ojb+a8/EBxdE4byqm6fFdrsA2BBeUuwtIHD6FtdAineMnUFxAio15g8DMIWiQn3b2i O9ixqs5vK1hwNmVSQfkyVcivmFkmnzc7NLOv2vQIk5oVLpDSnnAelohQf5GuvFb+Yz nfnkumqkLSNG7fAcJ3fipU0AMT+S9qa+ZQ/Lzg7Ewaiqybe2eyn3hqMeA7Dlyv9KI2 de0e8k72uJhj1L1ljZnoP9wPVwNQJAWhRS709nZMRDJUY/JlL1RFRDKGSVi7qD5Xfh 7XyRlHqLjNE8A== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 47/92] iio: dac: ad5504: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:50 +0100 Message-Id: <20220503085935.1533814-48-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 0dbe59c7a788 ("iio:ad5504: Do not store transfer buffers on the stack") Signed-off-by: Jonathan Cameron Cc: Lars-Peter Clausen --- drivers/iio/dac/ad5504.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c index 8507573aa13e..cfbb8335228c 100644 --- a/drivers/iio/dac/ad5504.c +++ b/drivers/iio/dac/ad5504.c @@ -54,7 +54,7 @@ struct ad5504_state { unsigned pwr_down_mask; unsigned pwr_down_mode; - __be16 data[2] ____cacheline_aligned; + __be16 data[2] __aligned(IIO_ALIGN); }; /* From patchwork Tue May 3 08:58:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835347 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B06AC433F5 for ; Tue, 3 May 2022 08:59:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233114AbiECJCz (ORCPT ); Tue, 3 May 2022 05:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232391AbiECJCy (ORCPT ); Tue, 3 May 2022 05:02:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E3E236154 for ; Tue, 3 May 2022 01:59:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B7729B81BE9 for ; Tue, 3 May 2022 08:59:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6F6FC385B1; Tue, 3 May 2022 08:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568360; bh=SCl8qiZgpXu2sclEMxUyO86lmCyIhM5qoVm0Q2Mzlxo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ARyHeE/J/+TpGQ50SIvOOKy2Yk1FuNQiTsZSjBYZ3zbqwmHuegieluxHOPsMH6qwl e7We4OAzRMy2MUmBSdEVnWcIZbpieUAkZm1o7lYGGQMjho57wxQWEmxTM+vteVYTqy 6PSB+pvlsgG6UTjaKJSRI2Eq1DTxoeD6l0lZYxuo/8BN3p3nzIdgQU254BunDmTOmU N59LqnXadjwbblxlxHSrrX2c2bLtwRj7YOXvl2cuBBK6vJXZ8vU/68H7msfq0NQvW5 E/JE19XdS7lFSI9xn1+YiayJ0QvhF2IHeSPOP1p5/bGTgKZAajMIf1rea5PRGLcA2I euSZgkd4kCL3A== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 48/92] iio: dac: ad5592r: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:51 +0100 Message-Id: <20220503085935.1533814-49-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 56ca9db862bf ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs") Signed-off-by: Jonathan Cameron Cc: Paul Cercueil --- drivers/iio/dac/ad5592r-base.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad5592r-base.h b/drivers/iio/dac/ad5592r-base.h index 2a22ef691996..072563c4529b 100644 --- a/drivers/iio/dac/ad5592r-base.h +++ b/drivers/iio/dac/ad5592r-base.h @@ -14,6 +14,8 @@ #include #include +#include + struct device; struct ad5592r_state; @@ -65,7 +67,7 @@ struct ad5592r_state { u8 gpio_in; u8 gpio_val; - __be16 spi_msg ____cacheline_aligned; + __be16 spi_msg __aligned(IIO_ALIGN); __be16 spi_msg_nop; }; From patchwork Tue May 3 08:58:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835348 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62895C433EF for ; Tue, 3 May 2022 08:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233116AbiECJDH (ORCPT ); Tue, 3 May 2022 05:03:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232391AbiECJDC (ORCPT ); Tue, 3 May 2022 05:03:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29B0036154 for ; Tue, 3 May 2022 01:59:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B911160DDD for ; Tue, 3 May 2022 08:59:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8846C385B0; Tue, 3 May 2022 08:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568370; bh=1mgkKsXjZut4cuDU4q0EaTaSVsBY13tW2nehhJA4LLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SgjIf8wALo3swP4qIkPVgVhfb//X1yzTSHlgNNJhe515mVp8Irc9YDAAIhbAcN6/3 4uyb3ifrgQdNBHRh3JevWYPpPNQNZE/Zhe07Bz0NDIOzubu9vFu8OBV7JcdE560U5H 8MMG/xYfgdumZ60/xp7L13W8NEAX+YG/kawNJaw/oa2wX4t5yWqZZ6nD3wX+Vj+nvI wHSuzo2UJYcs7m+cMw7vm1bjZAKCfA4Vv8P6UTw1iCIW5rNoimWAW7IkGc32tFBKSN JyBIgvTbfOdqNA9C+2C397Sa4sUpQongWU3HXTfMZPvp44hfH/Pw9GJYR6r7DqNpeS jK4jyXB0iSxlw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 49/92] iio: dac: ad5686: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:52 +0100 Message-Id: <20220503085935.1533814-50-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: 0357e488b825 ("iio:dac:ad5686: Refactor the driver") Signed-off-by: Jonathan Cameron --- drivers/iio/dac/ad5686.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h index cd5fff9e9d53..e7c0db87791f 100644 --- a/drivers/iio/dac/ad5686.h +++ b/drivers/iio/dac/ad5686.h @@ -13,6 +13,8 @@ #include #include +#include + #define AD5310_CMD(x) ((x) << 12) #define AD5683_DATA(x) ((x) << 4) @@ -137,7 +139,7 @@ struct ad5686_state { struct mutex lock; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ @@ -145,7 +147,7 @@ struct ad5686_state { __be32 d32; __be16 d16; u8 d8[4]; - } data[3] ____cacheline_aligned; + } data[3] __aligned(IIO_ALIGN); }; From patchwork Tue May 3 08:58:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835349 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76953C433EF for ; Tue, 3 May 2022 08:59:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233119AbiECJDM (ORCPT ); Tue, 3 May 2022 05:03:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232391AbiECJDL (ORCPT ); Tue, 3 May 2022 05:03:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A7A36302 for ; Tue, 3 May 2022 01:59:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7FF0061301 for ; Tue, 3 May 2022 08:59:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABAFCC385A9; Tue, 3 May 2022 08:59:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568378; bh=H6c62zie9mcSMOO7m7x5NGfHroZCM0DQttAmMJAV7/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CyDG/Xz1de8f5f/oOm/4RE4gc1b2n4FbelWBDxTs04nneU7j9X+6BkpYYxrgVgo38 +aCaZcTRQq9h8aldtetKVK00Qw2WQRsv8MHfN+W2EVYqcw0jOV4MzX5jqD5u3XYdFN PAExWU5gkkOBS/a39BK0sH7ySGXs/rkDW6Li+avyXk6zqOEZujWVBB954tIYnT86Yk uAznwdfO/jEQE3GzbNhX8SAPbhtwuvaUpNdtc1cLUwTIjc60LG12UDBrk3BURokrXk 0wacASSBXKX6lzIHvhvGLNS8t1duk8odRa6xuE0xRjimmREOWj0GVh9Yu78uxGqSzu 4iY/5yCYgGjXw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 50/92] iio: dac: ad5755: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:53 +0100 Message-Id: <20220503085935.1533814-51-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: c499d029d805 ("iio:dac: Add ad5755 driver") Signed-off-by: Jonathan Cameron --- drivers/iio/dac/ad5755.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c index 7a62e6e1d5f1..90bc293528fb 100644 --- a/drivers/iio/dac/ad5755.c +++ b/drivers/iio/dac/ad5755.c @@ -189,14 +189,14 @@ struct ad5755_state { struct mutex lock; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ union { __be32 d32; u8 d8[4]; - } data[2] ____cacheline_aligned; + } data[2] __aligned(IIO_ALIGN); }; enum ad5755_type { From patchwork Tue May 3 08:58:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835350 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53E15C433EF for ; Tue, 3 May 2022 08:59:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233121AbiECJDX (ORCPT ); Tue, 3 May 2022 05:03:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232391AbiECJDW (ORCPT ); Tue, 3 May 2022 05:03:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C37E036302 for ; Tue, 3 May 2022 01:59:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 79D5DB81BE1 for ; Tue, 3 May 2022 08:59:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95765C385B1; Tue, 3 May 2022 08:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568388; bh=ICG7nvjt5x6/0xEFdj29a04oFurux6LHBiCBMCfHnxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YdFGcvxO3DM1BO7uPcWXTgmrf9TKEg91Ct81IpA6QX/JU6+5nkBEJ9uD+oD0doFnB ojKwhUp6KI4QXt9iscSvmhtrzVfK9T4v8qHhJEzqkBuWw/CfueeMQ+AYzyRc5sWWs8 3jAcKwwsiHTEFUDRm8nWgzrbqL5ohVYkshjhwAnGS610I4Db5sJyC/SNgWezxFab3p KKFnjTt5DCQExE8slCYa5npxHx0hsCeIGaxJl2z+OKbcSZDmGmUHsm35YMmBI6NlK2 mYaQ9fxR6pHvZk2u4G3SdkN/D1B1Mu2VlwC+MBMbpT5iehg4KWl61N/6HjBMdIxl9u RehLy6jw3HS1A== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 51/92] iio: dac: ad5761: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:54 +0100 Message-Id: <20220503085935.1533814-52-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: 131497acd88a ("iio: add ad5761 DAC driver") Signed-off-by: Jonathan Cameron Reviewed-by: Ricardo Ribalda --- drivers/iio/dac/ad5761.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ad5761.c b/drivers/iio/dac/ad5761.c index 4cb8471db81e..2f493f9ae2d2 100644 --- a/drivers/iio/dac/ad5761.c +++ b/drivers/iio/dac/ad5761.c @@ -70,13 +70,13 @@ struct ad5761_state { enum ad5761_voltage_range range; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ union { __be32 d32; u8 d8[4]; - } data[3] ____cacheline_aligned; + } data[3] __aligned(IIO_ALIGN); }; static const struct ad5761_range_params ad5761_range_params[] = { From patchwork Tue May 3 08:58:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B25D7C433F5 for ; Tue, 3 May 2022 09:00:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233125AbiECJDa (ORCPT ); Tue, 3 May 2022 05:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232391AbiECJD3 (ORCPT ); Tue, 3 May 2022 05:03:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E3C036154 for ; Tue, 3 May 2022 01:59:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EE29D612F1 for ; Tue, 3 May 2022 08:59:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3447C385A4; Tue, 3 May 2022 08:59:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568397; bh=f1Y79XJ6pupOpdwPOH3Rx0DMjerRi1w1/NKGJoDsPbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gXdQD0Y5LDmX+P6UWCNaWSjogfAO/UY1MzeFUnrb4481+Y4ZjL6v5uuvtmEsUwY0j RESJCrwJxOCRJc3EAAvr+krur+aSB0dY4CAUvBmb1C98S0IudSFwMStMGavovYAcVs wfcQLUdSfOx3CIcpf6LaswOxbu+09hfduF5xDacAg2XQVD9RQFIyZAIzfvsFzkb0/F 9ycJuhBYwihE/TkbWZg6VDFvoyttrH1zZTyZ/IB1WGRfgIT5jZSeW+x/OonTAixcLq DYooh3OEdqb3hUv1jS2wmQvBvRSU11JFbBihF4Ety0k0P6bAoA7oP8cAkavPrBjWyX Zj0ey1sjqlVng== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 52/92] iio: dac: ad5764: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:55 +0100 Message-Id: <20220503085935.1533814-53-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: 68b14d7ea956 ("staging:iio:dac: Add AD5764 driver") Signed-off-by: Jonathan Cameron --- drivers/iio/dac/ad5764.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ad5764.c b/drivers/iio/dac/ad5764.c index d235a8047ba0..ad14f277add8 100644 --- a/drivers/iio/dac/ad5764.c +++ b/drivers/iio/dac/ad5764.c @@ -56,13 +56,13 @@ struct ad5764_state { struct mutex lock; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ union { __be32 d32; u8 d8[4]; - } data[2] ____cacheline_aligned; + } data[2] __aligned(IIO_ALIGN); }; enum ad5764_type { From patchwork Tue May 3 08:58:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835352 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1942C433EF for ; Tue, 3 May 2022 09:00:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233126AbiECJDj (ORCPT ); Tue, 3 May 2022 05:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232391AbiECJDj (ORCPT ); Tue, 3 May 2022 05:03:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFE253630B for ; Tue, 3 May 2022 02:00:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4C01861266 for ; Tue, 3 May 2022 09:00:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5CEFC385A9; Tue, 3 May 2022 08:59:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568406; bh=foLsiZRjBkBV4+N8jPDxECl4KE6G75BWR+CYIRl/93g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XYHp9yjcx5bDfX9SUUEl88HUJr20rIn6ozFRJRXfwfljvcF7laeHzaCkQ4iQ9zusZ MOx1hEMkfKy6JQAzdoapQ6jFwCB9nnWfQniBhO4CqrSy4hxGY+s26rHdUb337ecuQJ MFZEd+UkaLAeGYYouTLSNDyCmzgvWNXD3Xj/FREiCmeLkeK+H+vpyflN4X/umIDBgX qcmVecglterMuMGdFXqQkcZsLrb2I1k+ZsEhi52308kgt4pCVXKjDLq6lVA0nsp5+3 EF3dpUsnOdEF+Gmf2uQUZBD/9CYnZPN6+dbYy7+QRRiwnhFNMQBDizFP5E1SjOctru AjIAoh5XDb4uA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 53/92] iio: dac: ad5766: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:56 +0100 Message-Id: <20220503085935.1533814-54-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: fd9373e41b9b ("iio: dac: ad5766: add driver support for AD5766") Signed-off-by: Jonathan Cameron Cc: Cristian Pop --- drivers/iio/dac/ad5766.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad5766.c b/drivers/iio/dac/ad5766.c index 43189af2fb1f..71953bc45f8e 100644 --- a/drivers/iio/dac/ad5766.c +++ b/drivers/iio/dac/ad5766.c @@ -123,7 +123,7 @@ struct ad5766_state { u32 d32; u16 w16[2]; u8 b8[4]; - } data[3] ____cacheline_aligned; + } data[3] __aligned(IIO_ALIGN); }; struct ad5766_span_tbl { From patchwork Tue May 3 08:58:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66B12C433EF for ; Tue, 3 May 2022 09:00:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233128AbiECJDu (ORCPT ); Tue, 3 May 2022 05:03:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233130AbiECJDs (ORCPT ); Tue, 3 May 2022 05:03:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0A3125FD for ; Tue, 3 May 2022 02:00:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7C0B060F37 for ; Tue, 3 May 2022 09:00:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F47BC385B3; Tue, 3 May 2022 09:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568415; bh=eHKkrpM+yWFwqYfqSAZpjl93cTn0jRIP16tG9M9FjHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pBWzIOP4Fw9VKxSuGuEZZrSVRDnJCwCEYCTcttpl1kRjAJJiOyeoMDVbalrWdusEs 2DCwUPLtsKA7EWG83INaHzpQyj9r+Y5lwfSnF/vAcC+BCwt1sqDx6A96FXbfNB1gVY Yoo/QWitbQnHcV6WxhgswRlBT6jbmEuiRxokobi4INjA6RlTAX6nMePpwA9fHiBKDR G4BJT/2g+lDqAlkPk73+w+d2tgDcgo0i0phc4/tEvz2KOf8E+sFMg6e9X3+3eI5BYg 0pr2LV6KtFguTE5Jretk7kLkIdqK7LW+Owc0RO9vm8uFQ5yEN8dah5sToUCsyi+jpH LoUgp7ngG20MA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 54/92] iio: dac: ad5770r: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:57 +0100 Message-Id: <20220503085935.1533814-55-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: cbbb819837f6 ("iio: dac: ad5770r: Add AD5770R support") Signed-off-by: Jonathan Cameron Cc: Alexandru Tachici --- drivers/iio/dac/ad5770r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad5770r.c b/drivers/iio/dac/ad5770r.c index 7e2fd32e993a..be5b6331e6d9 100644 --- a/drivers/iio/dac/ad5770r.c +++ b/drivers/iio/dac/ad5770r.c @@ -140,7 +140,7 @@ struct ad5770r_state { bool ch_pwr_down[AD5770R_MAX_CHANNELS]; bool internal_ref; bool external_res; - u8 transf_buf[2] ____cacheline_aligned; + u8 transf_buf[2] __aligned(IIO_ALIGN); }; static const struct regmap_config ad5770r_spi_regmap_config = { From patchwork Tue May 3 08:58:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835354 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 764A0C433EF for ; Tue, 3 May 2022 09:00:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233137AbiECJEC (ORCPT ); Tue, 3 May 2022 05:04:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233131AbiECJEA (ORCPT ); Tue, 3 May 2022 05:04:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74C1817E30 for ; Tue, 3 May 2022 02:00:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6D195B81A96 for ; Tue, 3 May 2022 09:00:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 743BFC385BA; Tue, 3 May 2022 09:00:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568425; bh=5kgMdyqEel+TvcS07AhpBXrcoyxu/dyNHbl4s+HZ+hQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IK5IBMTT0TcjT/4X44+U5Ap0lTD4PiUezk5f36gt3ZQT8xhsMznv7b6jN+bSbnGzp BuZ3pp4fwlyXBZeSd6mTDRWUPOhrUQOGHyetY7KUM391JS9WmWpQvprhF0YPcnaGvV 4U3JV3GdkTO8xzfqu3yZjfS+C+VtGaXoQe69c2E0FcsPiAJTQdL9SupolVtfizit9p 0eubSzLXQretwAQEDFAkI57omwsI1pUgY9o9orbQG2d7LNIoo4ge5+uIXXSt3PTybw RgAFuVSKHnYQJIRNDrbT0Cvv4twM+EAqdiaQrCWqxRTX+0r2VSNG3ZoVJ7NUC27TMd 8Epen0jvcIGKg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 55/92] iio: dac: ad5791: Fix alignment for DMA saftey Date: Tue, 3 May 2022 09:58:58 +0100 Message-Id: <20220503085935.1533814-56-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 791bb52a0cd2 ("iio:ad5791: Do not store transfer buffers on the stack") Signed-off-by: Jonathan Cameron --- drivers/iio/dac/ad5791.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad5791.c b/drivers/iio/dac/ad5791.c index 2b14914b4050..b0fa7bca877b 100644 --- a/drivers/iio/dac/ad5791.c +++ b/drivers/iio/dac/ad5791.c @@ -95,7 +95,7 @@ struct ad5791_state { union { __be32 d32; u8 d8[4]; - } data[3] ____cacheline_aligned; + } data[3] __aligned(IIO_ALIGN); }; enum ad5791_supported_device_ids { From patchwork Tue May 3 08:58:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCBFAC433F5 for ; Tue, 3 May 2022 09:00:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233186AbiECJEP (ORCPT ); Tue, 3 May 2022 05:04:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233149AbiECJEH (ORCPT ); Tue, 3 May 2022 05:04:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67D771A3BA for ; Tue, 3 May 2022 02:00:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 081516135C for ; Tue, 3 May 2022 09:00:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F4C8C385A4; Tue, 3 May 2022 09:00:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568434; bh=dzFwIHmPu33oQMmRRhP+izxTDX3Mte1bSsk4KHwWv3Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JUGM56vPeXtVjOVmqyHODcwVizAM39+Xes1VULa+Udzk1/T2+Iyt0m0ETh4u8k0aN 2sR4K5f3WTvQBlSIay+tCnV3jk749AtgLBhfwflt3ed9t+URc55bNvwJQufDtAodph JNd5ZE2H462TlR1OBAIG8NLRKuAekx5KnWee3VMv4pJEH871oWBpLJsP7lW+ro5xLT npRj6pfpTTaVTzlBZ4ksi6FPHegRUx4IODPgYxPaIL+I17l8agKe16TEpiUlglawRT 3z4RMxm2xulGEBJqJwdjDcuw1aijI4aLSTgKCaK7aL/95ymRKSFEC9/3B3paLiGF5f MlFnkGep+lfng== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 56/92] iio: dac: ad7293: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:58:59 +0100 Message-Id: <20220503085935.1533814-57-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 0bb12606c05f ("iio:dac:ad7293: add support for AD7293") Signed-off-by: Jonathan Cameron Cc: Antoniu Miclaus --- drivers/iio/dac/ad7293.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad7293.c b/drivers/iio/dac/ad7293.c index 59a38ca4c3c7..c2532d431214 100644 --- a/drivers/iio/dac/ad7293.c +++ b/drivers/iio/dac/ad7293.c @@ -144,7 +144,7 @@ struct ad7293_state { struct regulator *reg_avdd; struct regulator *reg_vdrive; u8 page_select; - u8 data[3] ____cacheline_aligned; + u8 data[3] __aligned(IIO_ALIGN); }; static int ad7293_page_select(struct ad7293_state *st, unsigned int reg) From patchwork Tue May 3 08:59:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835356 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64488C433F5 for ; Tue, 3 May 2022 09:00:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233131AbiECJEV (ORCPT ); Tue, 3 May 2022 05:04:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233148AbiECJES (ORCPT ); Tue, 3 May 2022 05:04:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBC8A1C912 for ; Tue, 3 May 2022 02:00:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7111AB81BE1 for ; Tue, 3 May 2022 09:00:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 346FEC385B0; Tue, 3 May 2022 09:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568444; bh=pzVBy2LFFe1hhjptCXaKXdwxdHcXshmyyEK/8jYSAdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O8eP/FGJHWnWnDbMCQXS6XZY2n/Eqe0/Y4UrJV/givjeWAIrpDURBBUOkLyJYoFtC UtRCFfK/hB3xIxExeF3n5FDbOJ0M+OMo11b6WsxmYG0qmceVi24Wo3ihJP/MgI3uyo vXSknjc6RFSTTpQ/upjHGPu4s9zbihul2OUHI2tdsx/4PYstPi8jg7M+eD+RjfLenu sVa5D714WSBOVN5wUBKA8guQlOh5BwO4IIBtFYw2qknx+9TOnHtgsCsR9sSkCF4Ywj HOgN8c1yvOzXqYCXgw2lB0PNKD/PvO/EpstxWckqJY2C4omCYeC2xc45CfsJJdr+gv zzXHRDFXVbs1g== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 57/92] iio: dac: ad7303: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:00 +0100 Message-Id: <20220503085935.1533814-58-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: f83478240e74 ("iio:dac: Add support for the AD7303") Signed-off-by: Jonathan Cameron --- drivers/iio/dac/ad7303.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ad7303.c b/drivers/iio/dac/ad7303.c index 91eaaf793b3e..2a439ea9d1c7 100644 --- a/drivers/iio/dac/ad7303.c +++ b/drivers/iio/dac/ad7303.c @@ -44,10 +44,10 @@ struct ad7303_state { struct mutex lock; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ - __be16 data ____cacheline_aligned; + __be16 data __aligned(IIO_ALIGN); }; static int ad7303_write(struct ad7303_state *st, unsigned int chan, From patchwork Tue May 3 08:59:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF988C433F5 for ; Tue, 3 May 2022 09:00:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231491AbiECJE2 (ORCPT ); Tue, 3 May 2022 05:04:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiECJE1 (ORCPT ); Tue, 3 May 2022 05:04:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D43F26393 for ; Tue, 3 May 2022 02:00:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8C61DB81AEC for ; Tue, 3 May 2022 09:00:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4B1FC385A4; Tue, 3 May 2022 09:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568453; bh=HVlsUZrGNgyE2H1iOfTqqcXNWUuYydWdYumNcPQ0rPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hy3d4t/rEjOwVKFbGXlXWAAe/MbEtJxo2SCG0ULt3HD1E0JJrZMwc/+Q7zZxhdu9g cjYij3C33uN7ZNwg4kCccHmCEBp4DHhceAgP322wTUJLJCRC/NStCiUVBjyh7EmvAF dHP/geWMXRLMwShWRgX4GxsTaYGfLjHEuUqQ4Qsh113u2FkmvdwDlwVt3eihgigoFk ohvqI4hh9jvxhb8L4YmIdJlVS89t9X5AkypxqgC9L2HrNwaDH9TcFJlLSL7Jz3rWLz CZyuAbtQmny6VCeWPCljp60zU7tr4JpquPmEmTZUe9gXfS3S3m7CSCQ9+D5+Zz/Bq6 tuXZwwZ99WnIQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 58/92] iio: dac: ad8801: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:01 +0100 Message-Id: <20220503085935.1533814-59-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 7f270bc9a2d9 ("iio: dac: AD8801: add Analog Devices AD8801/AD8803 support") Signed-off-by: Jonathan Cameron --- drivers/iio/dac/ad8801.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad8801.c b/drivers/iio/dac/ad8801.c index 6be35c92d435..dfe2640d6af2 100644 --- a/drivers/iio/dac/ad8801.c +++ b/drivers/iio/dac/ad8801.c @@ -26,7 +26,7 @@ struct ad8801_state { struct regulator *vrefh_reg; struct regulator *vrefl_reg; - __be16 data ____cacheline_aligned; + __be16 data __aligned(IIO_ALIGN); }; static int ad8801_spi_write(struct ad8801_state *state, From patchwork Tue May 3 08:59:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835358 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01DBCC433EF for ; Tue, 3 May 2022 09:01:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232773AbiECJEe (ORCPT ); Tue, 3 May 2022 05:04:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiECJEd (ORCPT ); Tue, 3 May 2022 05:04:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD0856393 for ; Tue, 3 May 2022 02:01:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4969061301 for ; Tue, 3 May 2022 09:01:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7468C385A9; Tue, 3 May 2022 09:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568461; bh=55dFA8kFw6n0Xj3BLUiH0Qfj3cLt9BDs97Kk0A5LWUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CsDZGcAJzxxiqVHsjlmuyYfd3FhwBhmA8TZ067+Ti7ikcRl2jUYsaLykpssB27KHL 5Aow+GYDubZzZTmb9j/ia/fyKInuFYnJz4KX4OUaIpEBvgiLhqrNos2f4+hbuWiQQF JN48U4gGseKqxNuxEZygNhmGee6oWs2aDQd+ko089vGz02OOkhVY5/dnowaEXCeeIW JFRdOjmA2Xx1QH545ZGJ4/xHs1hOSjRfMDMsptrU+Uct/HdLjhx7BqV0QIEB8Lsvxr VZR3zlnRtNDlzqEqNBpItVRLikhvX0cur6A/MCDHxOeQbXgzDeyZ9LzY3vU9eFF8ze M5IHF5R7YCNKQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 59/92] iio: dac: ltc2688: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:02 +0100 Message-Id: <20220503085935.1533814-60-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Update the comment to include 'may'. Fixes: 832cb9eeb931 ("iio: dac: add support for ltc2688") Signed-off-by: Jonathan Cameron Cc: Nuno Sá --- drivers/iio/dac/ltc2688.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ltc2688.c b/drivers/iio/dac/ltc2688.c index 2f9c384885f4..6bf1ba8bf5f2 100644 --- a/drivers/iio/dac/ltc2688.c +++ b/drivers/iio/dac/ltc2688.c @@ -91,10 +91,10 @@ struct ltc2688_state { struct mutex lock; int vref; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ - u8 tx_data[6] ____cacheline_aligned; + u8 tx_data[6] __aligned(IIO_ALIGN); u8 rx_data[3]; }; From patchwork Tue May 3 08:59:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 871C8C433EF for ; Tue, 3 May 2022 09:01:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233104AbiECJEn (ORCPT ); Tue, 3 May 2022 05:04:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiECJEm (ORCPT ); Tue, 3 May 2022 05:04:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91FE012AAD for ; Tue, 3 May 2022 02:01:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F34A6126D for ; Tue, 3 May 2022 09:01:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CB33C385A4; Tue, 3 May 2022 09:01:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568470; bh=4I/dahFygrwDzrRUni0ggTB50Rl1eibjtsmXJ0NOILA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EiUH5FgF5YwFjF/i8MM6j9dIgcEqoXTIw+f0Hh8HuH5TOwqpQ6z7+idMGT84bsMj7 3k+ra6VbyDsIF8yI/DJBOWRh4ZvuWA6TCwNijzdZXYL5+MAzcZ0suNwHHNjpuQJHGG SpF0kCynuh+sHiKOYnm0AVzmWpfI5icTg2VSrd7UEwxtzl8mS06uLwQqS5uNM4iD0D hertwDl8ayz0GBw/U06yMuVv/YaYnYk2jO4/QmjnYaSKkuP5HBlLRB44V/HXMYngGp +6/Pp7sFAXYxa5Uv6oRQqKmodzK1ApchzMDqktH4wAczM8KkA+raOnEgo/8hBGaA4Q ZMnlXM0rUOBPA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 60/92] iio: dac: mcp3922: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:03 +0100 Message-Id: <20220503085935.1533814-61-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 1b791fadf3a1 ("iio: dac: mcp4902/mcp4912/mcp4922 dac driver") Signed-off-by: Jonathan Cameron Cc: Michael Welling --- drivers/iio/dac/mcp4922.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/mcp4922.c b/drivers/iio/dac/mcp4922.c index cb9e60e71b91..5252cc93f693 100644 --- a/drivers/iio/dac/mcp4922.c +++ b/drivers/iio/dac/mcp4922.c @@ -29,7 +29,7 @@ struct mcp4922_state { unsigned int value[MCP4922_NUM_CHANNELS]; unsigned int vref_mv; struct regulator *vref_reg; - u8 mosi[2] ____cacheline_aligned; + u8 mosi[2] __aligned(IIO_ALIGN); }; #define MCP4922_CHAN(chan, bits) { \ From patchwork Tue May 3 08:59:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835360 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7D43C433F5 for ; Tue, 3 May 2022 09:01:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233130AbiECJEw (ORCPT ); Tue, 3 May 2022 05:04:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiECJEw (ORCPT ); Tue, 3 May 2022 05:04:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBB0E12AAD for ; Tue, 3 May 2022 02:01:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 671BB61351 for ; Tue, 3 May 2022 09:01:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26B20C385B1; Tue, 3 May 2022 09:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568479; bh=wsQzNl/d2vRUhIoGAl+XhH/1Xi5z66pN85zhPqHW3rM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sepDu+B8J86R2JzHgU6fwFlXrPPgqMVdQMcjww8rBGVBGpByS0+EGeP+fYqIlMuNc 7MGQoVtdGUTsV+vbq5Ly9AQ2ifhWBgyx1pt+OfimOBSkTvrDn/XlOwfw87xrGLQIvR S8I3WTsxQLH2r1Wl6UsfxLiFn1+U6SgZrXz+noLUAB/VVJXIPaFT4uy4i+OYsjq3jq LC68D1yorlhlVBeVi1iDwWYRkwrhiGimhKw3BDDa2eTt1bdopDaQ/E5t1ZTEJr4V6q VxdGYQH2PtAQc/Bi2fO5O4J8OAHv9AAsJW4gSaPoJXK5z72oLDOp1h3uDFs71jXMRE fpltapvlME44A== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 61/92] iio: dac: ti-dac082s085: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:04 +0100 Message-Id: <20220503085935.1533814-62-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 61011264c1af ("iio: dac: Add Texas Instruments 8/10/12-bit 2/4-channel DAC driver") Signed-off-by: Jonathan Cameron --- drivers/iio/dac/ti-dac082s085.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/ti-dac082s085.c b/drivers/iio/dac/ti-dac082s085.c index 4e1156e6deb2..f2ae659c4787 100644 --- a/drivers/iio/dac/ti-dac082s085.c +++ b/drivers/iio/dac/ti-dac082s085.c @@ -55,7 +55,7 @@ struct ti_dac_chip { bool powerdown; u8 powerdown_mode; u8 resolution; - u8 buf[2] ____cacheline_aligned; + u8 buf[2] __aligned(IIO_ALIGN); }; #define WRITE_NOT_UPDATE(chan) (0x00 | (chan) << 6) From patchwork Tue May 3 08:59:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76E04C433EF for ; Tue, 3 May 2022 09:01:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233135AbiECJFF (ORCPT ); Tue, 3 May 2022 05:05:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiECJFE (ORCPT ); Tue, 3 May 2022 05:05:04 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9B8712AAD for ; Tue, 3 May 2022 02:01:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 24ED4CE1D7C for ; Tue, 3 May 2022 09:01:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7484AC385B0; Tue, 3 May 2022 09:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568489; bh=WxispHWvlGsxkZ9qEZbGd2XZ74iNBDL72F6E07p6jF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xaic3e63np8XbeSmXvEztE40fG31oBoIpOx48WXT24pxSrL4803/+n2NniXSVnnXY ZVWXzOcngJ53cB1HxyhkYqXEm1hFWEY9g2gptCS8GHuEiQPtQJ2w933RMpT9R9nuc7 JvlYqOkCv3y8ZTNLE9hd7YJKm+ZUb4rrZfcsAQBPKT4zx588zwtHgm/IB4/tp/H8gs EDhXa82yVXl3aZbaW3Fz9D3O2CbnWD6nTYxd5nMA29fiDBj/mue0vrMrcUWXA99XLc cql+DL2BS4Vw+rQuO5ilWpwpDGjBEHejC5D+lJcXan/70AKY+zQaWVv2Zx9ErayIV9 NRYaNwuPbfiUg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 62/92] iio: dac: ti-dac5571: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:05 +0100 Message-Id: <20220503085935.1533814-63-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: df38a4a72a3b ("iio: dac: add TI DAC5571 family support") Signed-off-by: Jonathan Cameron Cc: Sean Nyekjaer --- drivers/iio/dac/ti-dac5571.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c index 0b775f943db3..0a13df8101b4 100644 --- a/drivers/iio/dac/ti-dac5571.c +++ b/drivers/iio/dac/ti-dac5571.c @@ -52,7 +52,7 @@ struct dac5571_data { struct dac5571_spec const *spec; int (*dac5571_cmd)(struct dac5571_data *data, int channel, u16 val); int (*dac5571_pwrdwn)(struct dac5571_data *data, int channel, u8 pwrdwn); - u8 buf[3] ____cacheline_aligned; + u8 buf[3] __aligned(IIO_ALIGN); }; #define DAC5571_POWERDOWN(mode) ((mode) + 1) From patchwork Tue May 3 08:59:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835362 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9479AC433F5 for ; Tue, 3 May 2022 09:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233141AbiECJFL (ORCPT ); Tue, 3 May 2022 05:05:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiECJFK (ORCPT ); Tue, 3 May 2022 05:05:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4279B17067 for ; Tue, 3 May 2022 02:01:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D19E1612CE for ; Tue, 3 May 2022 09:01:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00A1CC385A9; Tue, 3 May 2022 09:01:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568498; bh=vcUS12TWLxDoe20CMHfUnsuZgv3cqLnYged5Mir/6gE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pjjBICTh/b+Yvtz1G5yTJIuUmRNylAJ6zYECEpzZxVlGsJkYQG3exiMpb3bbplwUu KT5H5LGGfYEPzngKqCJq79BtHHyjTGR2U0g5itW+etbvEdRffLnrckfIumOulRcG01 9dhirBFmVRzYkAsB0iMURJmSv1mKK899j/BldlzIZLDvO3lVElfe7nuv8z4NhyqiNU 2y7+mO6kGPKACVUi6gVbcsB2S4Mum+t2RQ5CKyYvyKRS3DRiTlf+scR5nnU6Jj6Ug3 zlYZGPkxNA3+e000B7GAVf2eaG/nvLyOhuNU6UQn/pvN8UyR7WAUReb4dNRt1TwEMR UAEmXX1xn/+GA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 63/92] iio: dac: ti-dac7311: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:06 +0100 Message-Id: <20220503085935.1533814-64-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 7a02ef7907d8 ("iio:dac:ti-dac7311 Add driver for Texas Instrument DAC7311") Signed-off-by: Jonathan Cameron Cc: Charles-Antoine Couret --- drivers/iio/dac/ti-dac7311.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/ti-dac7311.c b/drivers/iio/dac/ti-dac7311.c index e10d17e60ed3..d86567be138a 100644 --- a/drivers/iio/dac/ti-dac7311.c +++ b/drivers/iio/dac/ti-dac7311.c @@ -52,7 +52,7 @@ struct ti_dac_chip { bool powerdown; u8 powerdown_mode; u8 resolution; - u8 buf[2] ____cacheline_aligned; + u8 buf[2] __aligned(IIO_ALIGN); }; static u8 ti_dac_get_power(struct ti_dac_chip *ti_dac, bool powerdown) From patchwork Tue May 3 08:59:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66F49C433F5 for ; Tue, 3 May 2022 09:01:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232995AbiECJFV (ORCPT ); Tue, 3 May 2022 05:05:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiECJFU (ORCPT ); Tue, 3 May 2022 05:05:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E58D12AAD for ; Tue, 3 May 2022 02:01:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BDF3461301 for ; Tue, 3 May 2022 09:01:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 043D0C385A9; Tue, 3 May 2022 09:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568508; bh=vzAIERssUbeu4RCKLbdA/hikDWlcdSLHntt8ptxFeRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RVhGHmsWnLG6SZ8aK8wmyzNtonZIt1CJR3o1xv/Xakjq4VQi4Zy35ajkwJ6KFqTkg jHh20iQ71se/1hYheCO1pApwX5FP9lEYPIjj8TUqkDAPRG7OO8Hy5/nl2P1fIuhufE 4qg44z4FL+fL/QSDnEDju9Bkr7RwmzpkwUH1kj6OLWd1bLR41Fv6a14TUvfBNslEvI mETnQt1x8YbN7cxoiEOnpQKezuzu31W5IPPkXvnDU207Q2KbiSdOEgqcBXJORBxpTO GVfVZZza0k3N3QiqTxyGC+TUTfhXTMierTWSExuMWayOi614J2gyc2hSGy5B+49K1N /KReHq2xLcjtg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 64/92] iio: dac: ti-dac7612: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:07 +0100 Message-Id: <20220503085935.1533814-65-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Updated help text to 'may' require buffers to be in their own cacheline. Fixes: 977724d20584 ("iio:dac:ti-dac7612: Add driver for Texas Instruments DAC7612") Signed-off-by: Jonathan Cameron Cc: Ricardo Ribalda Reviewed-by: Ricardo Ribalda --- drivers/iio/dac/ti-dac7612.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ti-dac7612.c b/drivers/iio/dac/ti-dac7612.c index 4c0f4b5e9ff4..d118df004539 100644 --- a/drivers/iio/dac/ti-dac7612.c +++ b/drivers/iio/dac/ti-dac7612.c @@ -31,10 +31,10 @@ struct dac7612 { struct mutex lock; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ - uint8_t data[2] ____cacheline_aligned; + uint8_t data[2] __aligned(IIO_ALIGN); }; static int dac7612_cmd_single(struct dac7612 *priv, int channel, u16 val) From patchwork Tue May 3 08:59:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835364 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93B47C433F5 for ; Tue, 3 May 2022 09:02:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233142AbiECJFe (ORCPT ); Tue, 3 May 2022 05:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiECJFc (ORCPT ); Tue, 3 May 2022 05:05:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3315E17067 for ; Tue, 3 May 2022 02:02:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D9DC0B81C97 for ; Tue, 3 May 2022 09:01:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4887C385B0; Tue, 3 May 2022 09:01:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568517; bh=rjV60z13GLoX2zO2agSfS7zcEllvYZseVwavPmQLuws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qeu9ArKjVcy+9/6XzJRkvRSeSMwAfMkNNumIQfg5IJaM/pB+oUid0Zrg5rRdC03Nf b2IRd1cbAac6PQF7lInwrIsQ+BUBDRi31Ka3uihqGw+3wkRfsDQa81AyshmtXnOlSn 5ZgcY+OVATHjZ86b1lHjQKCDkUfgkR+3If/80cum7QYJa9xOASe/UPgsMrpqKdFZ6p v2Gt9xqI/uPMh/xy5kstlP+zhmjv53N+cCG82oR65VQdKEXAY1uy+dxK6/CraIKxGD /eFunlQT86lAnTHbfwckvQekq4vmMfLGI7ZNjLw1gxxyKEJq6hYXZKzsrub2Hjdn+h t13zJtMlVVwpw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 65/92] iio: frequency: ad9523: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:08 +0100 Message-Id: <20220503085935.1533814-66-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Updated help text to 'may' require buffers to be in their own cacheline. Fixes: cd1678f96329 ("iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator") Signed-off-by: Jonathan Cameron --- drivers/iio/frequency/ad9523.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c index a0f92c336fc4..d9fd187cb4dd 100644 --- a/drivers/iio/frequency/ad9523.c +++ b/drivers/iio/frequency/ad9523.c @@ -287,13 +287,13 @@ struct ad9523_state { struct mutex lock; /* - * DMA (thus cache coherency maintenance) requires the - * transfer buffers to live in their own cache lines. + * DMA (thus cache coherency maintenance) may require that + * transfer buffers live in their own cache lines. */ union { __be32 d32; u8 d8[4]; - } data[2] ____cacheline_aligned; + } data[2] __aligned(IIO_ALIGN); }; static int ad9523_read(struct iio_dev *indio_dev, unsigned int addr) From patchwork Tue May 3 08:59:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2053C433EF for ; Tue, 3 May 2022 09:02:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230514AbiECJFn (ORCPT ); Tue, 3 May 2022 05:05:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233143AbiECJFl (ORCPT ); Tue, 3 May 2022 05:05:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82B4819C2E for ; Tue, 3 May 2022 02:02:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3F49DB81AEC for ; Tue, 3 May 2022 09:02:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 275AAC385A9; Tue, 3 May 2022 09:01:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568527; bh=oQcmqylFB91K7l0dhVmtsNwaSNmXTk1+DyriF1ZjgJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LilpYdWnFY/S4vfDzcSwZTlVPY8znsn0hmWx2Hp85F5yVCrka1lyDGSZa0LA7fr4s N/5+Yak3NzeKSuasCVrqnf7r+IXZq3OcdNIEFrt1yuwyMjfX3YbPsuZzdSk5OTJl0I YADpTSzO+KVSQsH5PPG2UzOE0wqsp8eIfh1/Zf+VUEP7KvjOXkyVn4eF0FLb2ipuR0 j1GV8SPebSeejm8fX42aSVzflG4XbnqC9XaWFNUB6JcX8l/WYO/UZNWtz9veTZpw0e 8/CGHQjriQLkaUU0SYX4bRuXurp1LB7wiMR80Du0wGwahckdhPETMfEHPhSgWkwDRf lDkIcbETqI4Vw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 66/92] iio: frequency: adf4350: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:09 +0100 Message-Id: <20220503085935.1533814-67-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Updated help text to 'may' require buffers to be in their own cacheline. Fixes: e31166f0fd48 ("iio: frequency: New driver for Analog Devices ADF4350/ADF4351 Wideband Synthesizers") Signed-off-by: Jonathan Cameron --- drivers/iio/frequency/adf4350.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c index be1218d86291..eba8616fc295 100644 --- a/drivers/iio/frequency/adf4350.c +++ b/drivers/iio/frequency/adf4350.c @@ -56,10 +56,10 @@ struct adf4350_state { */ struct mutex lock; /* - * DMA (thus cache coherency maintenance) requires the - * transfer buffers to live in their own cache lines. + * DMA (thus cache coherency maintenance) may require that + * transfer buffers live in their own cache lines. */ - __be32 val ____cacheline_aligned; + __be32 val __aligned(IIO_ALIGN); }; static struct adf4350_platform_data default_pdata = { From patchwork Tue May 3 08:59:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835366 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D00C3C433F5 for ; Tue, 3 May 2022 09:02:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233144AbiECJFt (ORCPT ); Tue, 3 May 2022 05:05:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233143AbiECJFs (ORCPT ); Tue, 3 May 2022 05:05:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 240CA17067 for ; Tue, 3 May 2022 02:02:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B3B6A61301 for ; Tue, 3 May 2022 09:02:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A94B5C385B1; Tue, 3 May 2022 09:02:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568536; bh=yyFaJmfOOnU47KgS6egUp1dbWzXKVMRObEI5wTNLXfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQrfj1eANM1413svHL3dF8n7avGPlT7fAwt8C0khI1avA/ON12K8LVbQXQscfeyQw dm0AwHW6N6lTDiVAB53EopF4ajJYdvBiaFHVQ1z/y+JcRluceOnUR7YoS+2Iw3ssHv v1dE4MmM6vyRl4vgjGkRgZUrdbl83kJkZVPGnJ709JAul+u4artkmRvyFdkWenR1S4 76csta1NVnfhJRbNg/RYj6N1GuYO3RZlC4cLGqwfHRWN+PegIV1yatM7jXZza/bPOM KehiYh7pPCs8wZv7Aow/uOWMFcJNCkkPQspAj6YPt7upX7dwdAgpqCnIkm04Y9o2t1 uzuVxMiAh9c7A== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 67/92] iio: frequency: adf4371: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:10 +0100 Message-Id: <20220503085935.1533814-68-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 7f699bd14913 ("iio: frequency: adf4371: Add support for ADF4371 PLL") Signed-off-by: Jonathan Cameron --- drivers/iio/frequency/adf4371.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/frequency/adf4371.c b/drivers/iio/frequency/adf4371.c index ecd5e18995ad..edc5d1e8b5d7 100644 --- a/drivers/iio/frequency/adf4371.c +++ b/drivers/iio/frequency/adf4371.c @@ -175,7 +175,7 @@ struct adf4371_state { unsigned int mod2; unsigned int rf_div_sel; unsigned int ref_div_factor; - u8 buf[10] ____cacheline_aligned; + u8 buf[10] __aligned(IIO_ALIGN); }; static unsigned long long adf4371_pll_fract_n_get_rate(struct adf4371_state *st, From patchwork Tue May 3 08:59:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835367 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EC12C433F5 for ; Tue, 3 May 2022 09:02:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233143AbiECJF5 (ORCPT ); Tue, 3 May 2022 05:05:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233148AbiECJF4 (ORCPT ); Tue, 3 May 2022 05:05:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B30C18E00 for ; Tue, 3 May 2022 02:02:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 36CB361259 for ; Tue, 3 May 2022 09:02:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C30BFC385B2; Tue, 3 May 2022 09:02:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568544; bh=z/IRfB6/up/UPMChMc52u68EjueXxvBs7nLjBzOO7h4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uOs9VDA26Hx2TiSj6ijukWGWEc/IEl82YKmY9MZu3GQDOE+WJk8/kPWLHOFC/xoP7 lEZnbff4K2YuEpIpn2sGt5xzdvYBpn4F08f85NxnnrD4Y7B24/7j/STJruqbvoLSR8 mKxjIUlzlJW1Yi+3fUvShz4TfOaTIGzRU9c2lvUAGxiRMf7nK0kZX3muHRvxSI+riB KEldPVclYjqpKOLO6HPKTrj7YwG3+969tXc565BLZU+iIZRcGv10iNmRrZXBs/T6VW TYpDoXdWTK/XhZDZOR31O+tSk2py8PgKzsurHf6FPvAx6qJ3qW2A44nMwFItrLoDP9 QtfwdIaQkZdYQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 68/92] iio: frequency: admv1013: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:11 +0100 Message-Id: <20220503085935.1533814-69-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: da35a7b526d9 ("iio: frequency: admv1013: add support for ADMV1013") Signed-off-by: Jonathan Cameron Cc: Antoniu Miclaus --- drivers/iio/frequency/admv1013.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/frequency/admv1013.c b/drivers/iio/frequency/admv1013.c index b0e1f6571afb..caa81b411483 100644 --- a/drivers/iio/frequency/admv1013.c +++ b/drivers/iio/frequency/admv1013.c @@ -100,7 +100,7 @@ struct admv1013_state { unsigned int input_mode; unsigned int quad_se_mode; bool det_en; - u8 data[3] ____cacheline_aligned; + u8 data[3] __aligned(IIO_ALIGN); }; static int __admv1013_spi_read(struct admv1013_state *st, unsigned int reg, From patchwork Tue May 3 08:59:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835368 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E984AC433EF for ; Tue, 3 May 2022 09:02:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232816AbiECJGJ (ORCPT ); Tue, 3 May 2022 05:06:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233188AbiECJGH (ORCPT ); Tue, 3 May 2022 05:06:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC4151CB0A for ; Tue, 3 May 2022 02:02:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6F556B81AEC for ; Tue, 3 May 2022 09:02:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F9EFC385A9; Tue, 3 May 2022 09:02:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568553; bh=rnuIq5OoP2SjKEl0ydnpiWnB1JUxbGKnuTMFiXg9QXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VM1mELF22P70TXUJMfgWwAZj4ccPw8HphaMHxa1OiQTzdvc+vgUWgku+Itjf2cF6B e7bGTcci9bZ5i9sGL57PZ6VNbhWoXaUWVqEEx5Om1RLchQ4iKVn2/c9G48fxXeP4vk anOkIqsgDFj3B51If4MwLzQbwowEfVUdFQYldkYGiOgOhrhiEhkQIqSNGrzk0taR6a u+GZ8ucOJFjoVOajdvwGqcS2Fr3Xev31mlBPVKUymyMbhMIBj8Ox/fgtCEqRb5OmaI eavhfA+xPecGnU9bIp1AetMLTT16fnVzRdMsuO1bt1j0XpLIzDgGmIT5cORVKWlZL3 KNvO8htc89S7Q== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 69/92] iio: frequency: admv1014: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:12 +0100 Message-Id: <20220503085935.1533814-70-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: f4eb9ac7842f ("iio: frequency: admv1014: add support for ADMV1014") Signed-off-by: Jonathan Cameron Cc: Antoniu Miclaus --- drivers/iio/frequency/admv1014.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/frequency/admv1014.c b/drivers/iio/frequency/admv1014.c index a7994f8e6b9b..7eda479d286f 100644 --- a/drivers/iio/frequency/admv1014.c +++ b/drivers/iio/frequency/admv1014.c @@ -127,7 +127,7 @@ struct admv1014_state { unsigned int quad_se_mode; unsigned int p1db_comp; bool det_en; - u8 data[3] ____cacheline_aligned; + u8 data[3] __aligned(IIO_ALIGN); }; static const int mixer_vgate_table[] = {106, 107, 108, 110, 111, 112, 113, 114, From patchwork Tue May 3 08:59:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835369 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28513C433EF for ; Tue, 3 May 2022 09:02:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233187AbiECJGQ (ORCPT ); Tue, 3 May 2022 05:06:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233175AbiECJGP (ORCPT ); Tue, 3 May 2022 05:06:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B24319C2E for ; Tue, 3 May 2022 02:02:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 30B5261307 for ; Tue, 3 May 2022 09:02:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2880C385B0; Tue, 3 May 2022 09:02:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568562; bh=Ysnp6df9y0j0sWUgTd0LRze5Sb22RByTuKGgjtyPgTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dXZBIeyBlPxFv893jDb2lxhw6sWnOZdd1Hysln3MvV+kaoU+LO+3IsVokMOmzfm1t +jXWkCUDWAu4HVJGitv698ZyW5KOHvun/WIYCHfwtxgVZtrfYcfu61fAzYZOkVCocM oRsJvgfMSUP0N/kIjNHt3AAlXwsWF3wXZIhZBB1PfaXd/MNc0v162YsoP43IlwRmcj bYgim4W4GkufC1rcbvFPnZ2A84sUoYK874thoPLdGK7zU/9G5A1TBy9u3oWyuxXepD 0+V1RIehfaFt4TVdCGy1vQ3HIsVI1eaK6nZ8piai4lc+CqOUTlF/0O2Ax4EX2LhcIH 7Z2NWRa4ZIU8g== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 70/92] iio: frequency: admv4420: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:13 +0100 Message-Id: <20220503085935.1533814-71-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: b59c04155901 ("iio: frequency: admv4420.c: Add support for ADMV4420") Signed-off-by: Jonathan Cameron Cc: Cristian Pop --- drivers/iio/frequency/admv4420.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/frequency/admv4420.c b/drivers/iio/frequency/admv4420.c index 51134aee8510..71c1af6fd56b 100644 --- a/drivers/iio/frequency/admv4420.c +++ b/drivers/iio/frequency/admv4420.c @@ -113,7 +113,7 @@ struct admv4420_state { struct admv4420_n_counter n_counter; enum admv4420_mux_sel mux_sel; struct mutex lock; - u8 transf_buf[4] ____cacheline_aligned; + u8 transf_buf[4] __aligned(IIO_ALIGN); }; static const struct regmap_config admv4420_regmap_config = { From patchwork Tue May 3 08:59:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835370 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B89E1C433FE for ; Tue, 3 May 2022 09:02:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233189AbiECJG0 (ORCPT ); Tue, 3 May 2022 05:06:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233182AbiECJG0 (ORCPT ); Tue, 3 May 2022 05:06:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9394D1BE93 for ; Tue, 3 May 2022 02:02:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 45F56B81CA7 for ; Tue, 3 May 2022 09:02:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BFA1C385A4; Tue, 3 May 2022 09:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568572; bh=Fhlt/qW9Zs05subZawmiNh/9N1h+Q4FBt6IzKaoNDdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EKe7+fNUs2JXAtJcicnxwTXj8DbzXwWR+vRT5KgjNYAAWV3yAowi+xHc4bIQQuhWb SkY4izmUlmi1Y5sa8DMDACDLD7mxnNJQWn4LSr9UttJWv4PJV4wJraQ96cVmRkDJ6U OmSywfsaIuLE0WGp/o9jsRvCfZO2VwHJ+2/8prgXOvyAi/5qR5KdmQP1MgznxKoLWw nmBbvqXNItyAoc4EbQ4dnHVWTCfN/zOqbw2UYQ1HUWuynZ7NzHQNutM48i4rfOEeTx v7LNjv7jTIrVM23BrVdbYSZbS78SQaduH7BlNfL1C9QZRnr6n7/KB43XvV9x3FIchp XxOdhk4grygJw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 71/92] iio: frequency: adrf6780: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:14 +0100 Message-Id: <20220503085935.1533814-72-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 63aaf6d06d87 ("iio: frequency: adrf6780: add support for ADRF6780") Signed-off-by: Jonathan Cameron Cc: Antoniu Miclaus --- drivers/iio/frequency/adrf6780.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/frequency/adrf6780.c b/drivers/iio/frequency/adrf6780.c index 8255ffd174f6..788de3b05e3a 100644 --- a/drivers/iio/frequency/adrf6780.c +++ b/drivers/iio/frequency/adrf6780.c @@ -86,7 +86,7 @@ struct adrf6780_state { bool uc_bias_en; bool lo_sideband; bool vdet_out_en; - u8 data[3] ____cacheline_aligned; + u8 data[3] __aligned(IIO_ALIGN); }; static int __adrf6780_spi_read(struct adrf6780_state *st, unsigned int reg, From patchwork Tue May 3 08:59:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835371 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D89E5C433F5 for ; Tue, 3 May 2022 09:03:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233149AbiECJGf (ORCPT ); Tue, 3 May 2022 05:06:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233182AbiECJGe (ORCPT ); Tue, 3 May 2022 05:06:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56E771CB11 for ; Tue, 3 May 2022 02:03:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EFEF7B81A96 for ; Tue, 3 May 2022 09:03:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BC3FC385B0; Tue, 3 May 2022 09:02:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568580; bh=3JlZ4RhBqGxnqjSVxndtfGRlf7WjjrggVdty1EBhmvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=My3tIdPRglz6rD7QgbflQI9CvcJqXqX/M2L1wYsDYNZouUgGw0zPc0IjjS/RmViv6 tREkaRy7RchKNKzAu6a2w1rXBgoZtQDOZFhYhMN8X+IAPbqjw4vHV/u+IDtCocu8id 5yoBZIYuOG3BaXdNiKuQm+5KhLEV9fud19h9XOsnMMYOhg+5LD50ZBKwV9c4AlxMpF ewrrAy19Hi9Zplp8vTZTa1+u9yQgsvAis2O09zZpsnw4x6da9zTtV1h/kjB/9ZfW4C 1X2B2iL5w6fBbvLP0/A2i72CBk5RC9An0+dnUuO8s206eefBWLtO2qndqpeqQPhVbT iqDDGlfau4gOA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 72/92] iio: gyro: adis16080: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:15 +0100 Message-Id: <20220503085935.1533814-73-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes tag is inaccurate but unlikely anyone will backport this beyond that point so I haven't chased the history futher than 2013. Fixes: 3c80372dae17 ("staging:iio:adis16080: be16 cleanups") Signed-off-by: Jonathan Cameron --- drivers/iio/gyro/adis16080.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/gyro/adis16080.c b/drivers/iio/gyro/adis16080.c index acef59d822b1..b97c07f31370 100644 --- a/drivers/iio/gyro/adis16080.c +++ b/drivers/iio/gyro/adis16080.c @@ -45,7 +45,7 @@ struct adis16080_state { const struct adis16080_chip_info *info; struct mutex lock; - __be16 buf ____cacheline_aligned; + __be16 buf __aligned(IIO_ALIGN); }; static int adis16080_read_sample(struct iio_dev *indio_dev, From patchwork Tue May 3 08:59:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835372 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38362C433EF for ; Tue, 3 May 2022 09:03:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233175AbiECJGo (ORCPT ); Tue, 3 May 2022 05:06:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233155AbiECJGn (ORCPT ); Tue, 3 May 2022 05:06:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADBC51A3BA for ; Tue, 3 May 2022 02:03:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4C832612CB for ; Tue, 3 May 2022 09:03:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53B40C385B3; Tue, 3 May 2022 09:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568590; bh=RKOrsZzLR+pxviic4fRfOemi/pxrz18q2sOv6q+vpmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D09vio8j4iQzEEFQLW6eq+EkEBCmqxsxxwLV/+FWCR2cT0U9hA+85LJcfwmKtmMIC 6RkwYog92TsWrMd7/yfG3EMQfEax/GefnDQkvo44+0w+MbcodkwVX6UGn0SCgxesNd IO5wINUZccTpNjmhiJR6p2U/kSG040/VVCIwScT6QQSvLNb08MkpcfsfZgHRAf1B2M dpQYUINpCpbO0yf6z8nqZUV+a3wkeMCVFE6OXwFkas4A+olSA0BxMZIA8nEPStTCiO k2p46xVG5r1SHUvLYFxQdWwvlhTUThL6QlDd5BjI+wgsCI2di9IUTwzyOAo20j40Zu W4iobMW/bKmHA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 73/92] iio: gyro: adis16130: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:16 +0100 Message-Id: <20220503085935.1533814-74-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 8e67875141b2 ("staging:iio:gyro: adis16130 cleanup, move to abi and bug fixes.") Signed-off-by: Jonathan Cameron --- drivers/iio/gyro/adis16130.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/gyro/adis16130.c b/drivers/iio/gyro/adis16130.c index b9c952e65b55..f7de3c415702 100644 --- a/drivers/iio/gyro/adis16130.c +++ b/drivers/iio/gyro/adis16130.c @@ -41,7 +41,7 @@ struct adis16130_state { struct spi_device *us; struct mutex buf_lock; - u8 buf[4] ____cacheline_aligned; + u8 buf[4] __aligned(IIO_ALIGN); }; static int adis16130_spi_read(struct iio_dev *indio_dev, u8 reg_addr, u32 *val) From patchwork Tue May 3 08:59:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835373 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B34F8C433EF for ; Tue, 3 May 2022 09:03:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233208AbiECJGy (ORCPT ); Tue, 3 May 2022 05:06:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233206AbiECJGx (ORCPT ); Tue, 3 May 2022 05:06:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6856A21257 for ; Tue, 3 May 2022 02:03:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1C4B2B81BE9 for ; Tue, 3 May 2022 09:03:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C4B1C385A9; Tue, 3 May 2022 09:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568599; bh=OsrM6aeC3QnvhDXYTKvq1VOdXls2zVTaL843h+/CL0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fDwqEgO0fIycj1c9aIfTPpuoYSrDk9TTq/M8jD6/rkzgwmLgzUujgxcU3AoBaBAGa XVV7sxvc1EY8fJl/7ZoESRJJ9XJ7fHEX8K0kMNO2ZHRnYWoMRkGD3VA5S/245YNPy2 9xB7S6Tl37Fr+OdOOAGoyu50qi/bBbPyzwshgEsBo9boYYGHkk3ugoYsx7HlqLa3rX tDEbCL/4shdawPHD6Ovf6BoUlDu5gEZlLqoJx7nAx4iLRM9frMDSVKnpNHpPzn5g8n FYnaRxoS6awZIN9TvnhgG6dRhxc9d355A7I9bja+m2yJHuBUSSJtN2WZta9B+XDzf5 A8EVCbUDdfHIA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 74/92] iio: gyro: adxrs450: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:17 +0100 Message-Id: <20220503085935.1533814-75-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes tag is inaccurate but unlikely anyone will be interested in backporting beyond that point. Fixes: 53ac8500ba9b ("staging:iio:adxrs450: Move header file contents to main file") Signed-off-by: Jonathan Cameron --- drivers/iio/gyro/adxrs450.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/gyro/adxrs450.c b/drivers/iio/gyro/adxrs450.c index 04f350025215..248841461ac4 100644 --- a/drivers/iio/gyro/adxrs450.c +++ b/drivers/iio/gyro/adxrs450.c @@ -73,7 +73,7 @@ enum { struct adxrs450_state { struct spi_device *us; struct mutex buf_lock; - __be32 tx ____cacheline_aligned; + __be32 tx __aligned(IIO_ALIGN); __be32 rx; }; From patchwork Tue May 3 08:59:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835374 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2E74C433EF for ; Tue, 3 May 2022 09:03:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233206AbiECJHD (ORCPT ); Tue, 3 May 2022 05:07:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233155AbiECJHC (ORCPT ); Tue, 3 May 2022 05:07:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F7AD1BEA4 for ; Tue, 3 May 2022 02:03:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 26EA9B81C66 for ; Tue, 3 May 2022 09:03:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79F5AC385B0; Tue, 3 May 2022 09:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568608; bh=Zxs8Mids82x98KN8r4o3bvEo/bvhEGBR6cbX9VzXJf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kLbe8Rz/iHMaHNUS+sgEpVi4AsSIdey1Hr4F8GSauEf/OHWAmJ3MohJ9BpkpMYsVB 409nfptDcj+dHYGdSpyVafn9Qc+6gih6WuhRgT9fwImRl3DPV0Q0ZjrWKlXNCr5CG3 McEJzPVdSe94Zk2rUZqrrYqwnavQ7ix+Xm9m/7FvOXjIIgUp6Ae+aKmAOEFb39qjfk Mqz/UrAvW0W/O88NaiNJzs+6obGmgbOdU5QsLVMQA7gHxS7+nuwZVDe4WNMycQC2kP kK2QEmD7gDH1MmlxRMJwYrgaJKc/4oz2Gi9OyHCtpTPMBI5sRCL6B3OMcfE9HXqzGl kz5kSbSzpyg+g== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 75/92] iio: gyro: fxas210002c: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:18 +0100 Message-Id: <20220503085935.1533814-76-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Updated the comment to 'may' require. Fixes: a0701b6263ae ("iio: gyro: add core driver for fxas21002c") Signed-off-by: Jonathan Cameron Cc: Rui Miguel Silva Reviewed-by: Rui Miguel Silva --- drivers/iio/gyro/fxas21002c_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/gyro/fxas21002c_core.c b/drivers/iio/gyro/fxas21002c_core.c index 410e5e9f2672..d89dab48956a 100644 --- a/drivers/iio/gyro/fxas21002c_core.c +++ b/drivers/iio/gyro/fxas21002c_core.c @@ -150,10 +150,10 @@ struct fxas21002c_data { struct regulator *vddio; /* - * DMA (thus cache coherency maintenance) requires the - * transfer buffers to live in their own cache lines. + * DMA (thus cache coherency maintenance) may require the + * transfer buffers live in their own cache lines. */ - s16 buffer[8] ____cacheline_aligned; + s16 buffer[8] __aligned(IIO_ALIGN); }; enum fxas21002c_channel_index { From patchwork Tue May 3 08:59:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F232FC433EF for ; Tue, 3 May 2022 09:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233207AbiECJHN (ORCPT ); Tue, 3 May 2022 05:07:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233155AbiECJHM (ORCPT ); Tue, 3 May 2022 05:07:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E9221BE93 for ; Tue, 3 May 2022 02:03:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 59F35B81BE9 for ; Tue, 3 May 2022 09:03:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93D27C385A9; Tue, 3 May 2022 09:03:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568618; bh=FlGFcLP4KxNfJ91DtbtHnXX2Y/L8RpM+poTkCPTUR+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JDmEv54YByLEW2CYUY/X/rroC1nEgBalozJrCp0zt188WSu2txZAR+g43Eas08OOb 0+KnnNe9Bge5C6TCGZOUFpGXmayknCs+GwLF8QugqG9GMEKMSo/Qd7IlCPdBSTy/wN RTYD6RxAaj8zI2O3BlQn5auPIYZ7FmcYlfewatLiuRyjccrmK3brIhwJb8jFmjZkUo +HYt7exePx1l3Caq1RJuZtAnlc2HuspSnvO7JAO1wndyOHd3U/THTYqTvPGVcbhFym TrMJZP3zPypIS2aluzrUAc0qZWRw7uueZ8KkImd6gqZtwEaaZVYPlLb0FMSywOu243 O4DRaL2qlvb5Q== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 76/92] iio: imu: fxos8700: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:19 +0100 Message-Id: <20220503085935.1533814-77-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 84e5ddd5c46e ("iio: imu: Add support for the FXOS8700 IMU") Signed-off-by: Jonathan Cameron Cc: Robert Jones --- drivers/iio/imu/fxos8700_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/imu/fxos8700_core.c b/drivers/iio/imu/fxos8700_core.c index ab288186f36e..8d2a9b9533db 100644 --- a/drivers/iio/imu/fxos8700_core.c +++ b/drivers/iio/imu/fxos8700_core.c @@ -167,7 +167,7 @@ struct fxos8700_data { struct regmap *regmap; struct iio_trigger *trig; - __be16 buf[FXOS8700_DATA_BUF_SIZE] ____cacheline_aligned; + __be16 buf[FXOS8700_DATA_BUF_SIZE] __aligned(IIO_ALIGN); }; /* Regmap info */ From patchwork Tue May 3 08:59:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835376 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E59AC433EF for ; Tue, 3 May 2022 09:03:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233209AbiECJHU (ORCPT ); Tue, 3 May 2022 05:07:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233155AbiECJHT (ORCPT ); Tue, 3 May 2022 05:07:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B684A1BE93 for ; Tue, 3 May 2022 02:03:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 48D5C612CB for ; Tue, 3 May 2022 09:03:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF7CDC385B2; Tue, 3 May 2022 09:03:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568627; bh=hKa55Ep6iyOANvTUBLMyRPtdKam6bEjIVeCJ094aaEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t/h7AImIaqjKu+hHjnM+t7+vWxIu2XlbG05cuGjxEEcVsHws486Ug+ZZIMwham0Sv UGmRm4POqTciQY/MSfTX6GyBydL8U+RQ+aX2jfdiRPhFObmtOcpmyM6T4KKrIJx51U dMQDo5wSZWhU276BGw+lESbnGPEiX67jJrDznuE5J48/01OC3pR49PBwXEB59pcuF9 EtVxKwtR0574slfGWU9pRFRK3gthF36M83sOOmWdA6E/aHabqc/WbjqOJ3WhRKegma Gwn8PnpDS3SHup60UcJY2oEZKP2roUp2fZkojwPHA4UkkQA6b3p7LDoOcM9WKH9mYV ndyC/W0nlI1/A== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 77/92] iio: imu_icm42600: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:20 +0100 Message-Id: <20220503085935.1533814-78-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Partial fix for this driver as a second instance was introduced in a later patch. ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: a095fadb443b ("iio: imu: inv_icm42600: add gyroscope IIO device") Signed-off-by: Jonathan Cameron Cc: Jean-Baptiste Maneyrol Acked-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron --- drivers/iio/imu/inv_icm42600/inv_icm42600.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600.h b/drivers/iio/imu/inv_icm42600/inv_icm42600.h index c0f5059b13b3..5b3740cb364f 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600.h +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600.h @@ -140,7 +140,7 @@ struct inv_icm42600_state { struct inv_icm42600_suspended suspended; struct iio_dev *indio_gyro; struct iio_dev *indio_accel; - uint8_t buffer[2] ____cacheline_aligned; + uint8_t buffer[2] __aligned(IIO_ALIGN); struct inv_icm42600_fifo fifo; struct { int64_t gyro; From patchwork Tue May 3 08:59:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 831B4C433EF for ; Tue, 3 May 2022 09:03:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233184AbiECJH3 (ORCPT ); Tue, 3 May 2022 05:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233155AbiECJH2 (ORCPT ); Tue, 3 May 2022 05:07:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B18F41BEA4 for ; Tue, 3 May 2022 02:03:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 421AE61259 for ; Tue, 3 May 2022 09:03:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B3B3C385B1; Tue, 3 May 2022 09:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568636; bh=w+VfPYd9WkpPK3s+Ftfter3H3ZY22JJBLNLTVx/wEU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aUgDvJVcK6f8KSTutVIO2u+azZ4gaNyj5fJPce350/drgF4JCUfabX5u9xI0IGY2V Vzadp6It0t425h01wL1pYc7hUHBCHwucmFOWwK3V5T/5lzfBzvHwKRhVE+y4hcoaMt cnVE7Cx9HwJJhyHdyfbBksVgJ0qwoOocaki3iTw0rGps5vo5RUwZDMSUxeObz67ZED VezxHm41WYuH0u3clPVPhzjZZ/0l3+pkcniQSX3fYzqxVDfc5M51I2KXj+F7WPehN1 X8r0ArMyOOPxK/G11yaugy1QotFWsR5If6+K1ZWTVilzEl+62UcCrX8TJc0g3AVwv6 zXfdQaSkHVmIA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 78/92] iio: imu: icm42600: Fix alignment for DMA safety in buffer code. Date: Tue, 3 May 2022 09:59:21 +0100 Message-Id: <20220503085935.1533814-79-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Second fix for this driver due to different introducing patches. ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 7f85e42a6c54 ("iio: imu: inv_icm42600: add buffer support in iio devices") Signed-off-by: Jonathan Cameron Cc: Jean-Baptiste Maneyrol Acked-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron --- drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h index de2a3949dcc7..56545638bfcd 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h @@ -39,7 +39,7 @@ struct inv_icm42600_fifo { size_t accel; size_t total; } nb; - uint8_t data[2080] ____cacheline_aligned; + uint8_t data[2080] __aligned(IIO_ALIGN); }; /* FIFO data packet */ From patchwork Tue May 3 08:59:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835378 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2800C433F5 for ; Tue, 3 May 2022 09:04:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233212AbiECJHj (ORCPT ); Tue, 3 May 2022 05:07:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233155AbiECJHi (ORCPT ); Tue, 3 May 2022 05:07:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D8C21BE93 for ; Tue, 3 May 2022 02:04:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DA87F61259 for ; Tue, 3 May 2022 09:04:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E1EDC385B0; Tue, 3 May 2022 09:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568646; bh=MjJjtUvNlgwtIKR33x5mDkH8Sj+HqWf68lmpgd85bfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ank5oFsJghhBMKlBOXkudwm+ulLKe5MLShEXy58WuePWrx1nHS2dHeCWzj5LueL5R yZy8CPECThcWZQCWWA4AapJKsKB9k5Xbm3AhJOGJtaRyUnwy5AgLHdWe53cT8KfdaG Shq4BML1PctERERW6QQ5P2kHYHj57R+d3tEeQS3vU9Eip7qmbpPteD62Gj/4h8mZd0 f8f3WhbsfUhFBdy6ax9P1IlZ+M1T4ViBMzkh1pp3pot2ZntE5mcmLyD3yxrrWvFAl0 nIX1pyagl75STFI1blxUfkMXkD0rmgUVFEPfROGPHxHrOs2T7nnI72tJD7tJMoc/Rr h2NlAuXHglfKQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 79/92] iio: imu: mpu6050: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:22 +0100 Message-Id: <20220503085935.1533814-80-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 6b0cc5dce072 ("iio:imu:inv_mpu6050 Fix dma and ts alignment and data leak issues.") Signed-off-by: Jonathan Cameron Cc: Jean-Baptiste Maneyrol Acked-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron --- drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h index c6aa36ee966a..18bd1a50463c 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h @@ -203,7 +203,7 @@ struct inv_mpu6050_state { s32 magn_raw_to_gauss[3]; struct iio_mount_matrix magn_orient; unsigned int suspended_sensors; - u8 data[INV_MPU6050_OUTPUT_DATA_SIZE] ____cacheline_aligned; + u8 data[INV_MPU6050_OUTPUT_DATA_SIZE] __aligned(IIO_ALIGN); }; /*register and associated bit definition*/ From patchwork Tue May 3 08:59:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3D67C433F5 for ; Tue, 3 May 2022 09:04:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233155AbiECJHw (ORCPT ); Tue, 3 May 2022 05:07:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233215AbiECJHt (ORCPT ); Tue, 3 May 2022 05:07:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 106B81BEA4 for ; Tue, 3 May 2022 02:04:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B9B78B81BE9 for ; Tue, 3 May 2022 09:04:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6D95C385B2; Tue, 3 May 2022 09:04:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568655; bh=VAhpmlMeH2aApDfe/0axsTpA1LC4LtU6ooNWbXK4evE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LmCOOiEMI04eVouaL/RbcjedPW97kPupxhgoebmivqbgoSkAfbq3jW1GlwZzYUUjd ZJcPW+74zF9sKQ0IA7ubrTsEEQlipS7i+QT9aHgOHYgHUHjgIw35AkLbn6bE1kvtDS BxiOx/kL2mjCauXEb5RDKZiVxePxzYmg6Vk8cndbKGHBVRufmO3diqeJ/talla5yXq STtl0Et68yK0OUKIzoktvWbYfLwGjaFGuLifI0nmB3z65NCmpNPxyzy91saWC/ujoD o2ASJtbMuyo0NUmqzARcQJdLWdMFpP9RGiCZPtvhhcu9eFoQXsOr3+ED7njX91f7ED /2XhhdpABa9cA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 80/92] iio: potentiometer: ad5110: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:23 +0100 Message-Id: <20220503085935.1533814-81-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: d03a74bfacce ("iio: potentiometer: Add driver support for AD5110") Signed-off-by: Jonathan Cameron Cc: Mugilraj Dhavachelvan --- drivers/iio/potentiometer/ad5110.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/potentiometer/ad5110.c b/drivers/iio/potentiometer/ad5110.c index d4eeedae56e5..29f9a9037077 100644 --- a/drivers/iio/potentiometer/ad5110.c +++ b/drivers/iio/potentiometer/ad5110.c @@ -63,10 +63,10 @@ struct ad5110_data { struct mutex lock; const struct ad5110_cfg *cfg; /* - * DMA (thus cache coherency maintenance) requires the - * transfer buffers to live in their own cache lines. + * DMA (thus cache coherency maintenance) may require the + * transfer buffers live in their own cache lines. */ - u8 buf[2] ____cacheline_aligned; + u8 buf[2] __aligned(IIO_ALIGN); }; static const struct iio_chan_spec ad5110_channels[] = { From patchwork Tue May 3 08:59:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835380 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FC64C433EF for ; Tue, 3 May 2022 09:04:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233217AbiECJID (ORCPT ); Tue, 3 May 2022 05:08:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233215AbiECJIC (ORCPT ); Tue, 3 May 2022 05:08:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 232471BEA4 for ; Tue, 3 May 2022 02:04:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C06FBB81C97 for ; Tue, 3 May 2022 09:04:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17986C385A4; Tue, 3 May 2022 09:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568665; bh=6ahk6GPr3iG/AnzIywU8mEvEbxtAE4DCjfpABrv1ZQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YSQ9HQoTOeiq8CGsVIcKzrTroxkKlhDiBQtBiK9vooFTFFQi7M3Lh7kgaXKpUdZVq NR5UAwBQSzGjVUVuEBEaQgPFyg/N34Nwdx35W0F5ohGehYckyPBbdWCN6LzEqR18Zg sH5MsCpQZhX5BXLZgwuXkMFq64t+7LW3PTf06sdbLfGhur2XLoVkWgxP59G8/bmqCj +sYR8+pw70Fg0t5MX3AXMYUvzTgWbTBd5iejEn7bjICDHfQMxMsvzBl4Wz6ZkhlYtF kocbEEWqhzAKA6x2/Mll4Nj76GqvqG31SFTqNrW8B3Qv1buIePZHMjFcL0cPhRfZul tkd0NB99cA1Nw== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 81/92] iio: potentiometer: ad5272: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:24 +0100 Message-Id: <20220503085935.1533814-82-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 79e8a32d2aa9 ("iio: ad5272: Add support for Analog Devices digital potentiometers") Signed-off-by: Jonathan Cameron Cc: Phil Reid Reviewed-by: Phil Reid --- drivers/iio/potentiometer/ad5272.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/potentiometer/ad5272.c b/drivers/iio/potentiometer/ad5272.c index d8cbd170262f..e023c0f92242 100644 --- a/drivers/iio/potentiometer/ad5272.c +++ b/drivers/iio/potentiometer/ad5272.c @@ -50,7 +50,7 @@ struct ad5272_data { struct i2c_client *client; struct mutex lock; const struct ad5272_cfg *cfg; - u8 buf[2] ____cacheline_aligned; + u8 buf[2] __aligned(IIO_ALIGN); }; static const struct iio_chan_spec ad5272_channel = { From patchwork Tue May 3 08:59:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF9FCC433EF for ; Tue, 3 May 2022 09:04:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233218AbiECJII (ORCPT ); Tue, 3 May 2022 05:08:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233215AbiECJIG (ORCPT ); Tue, 3 May 2022 05:08:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B5091BEA4 for ; Tue, 3 May 2022 02:04:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 26E4560DDD for ; Tue, 3 May 2022 09:04:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06CB6C385B0; Tue, 3 May 2022 09:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568674; bh=lw4Q44GIAXczIpgvmjS8qZs8g9kqGoU7JkmpwyDTC1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NLbT/bGR4WMzG2VCZTu0S6WqSz3WIxXB2i7lSvj9/DshFAzZwqo7XDfkfAzLVNiRI OrniS1z/oM3kR+CCRYTTiAPbYbcNuhqJuiJqbSUxCfUrIzj7D4S71DGlUXxJFKgcvv NRdndYoRkwtYzO3pWOjtu8vri9Htiqboyn5/UNOHYzyJPbWbo2aqb7MYbbjIp6VS7B AcY7vyN+ewDq3y3iNq3izkEPHRfT7pWkaOJsgVp7PoedXAeLNPRZWhCQPovAQ0uK4m fCsR0xQjE+SYDxHSKlzQ2eLZ06/xENXr5avGP2ujOlgXGV2LhHcvQ9//6kBvXLIAhC psSzdtWJdrGNA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 82/92] iio: potentiometer: max5481: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:25 +0100 Message-Id: <20220503085935.1533814-83-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: df1fd2de118e ("iio: max5481: Add support for Maxim digital potentiometers") Signed-off-by: Jonathan Cameron --- drivers/iio/potentiometer/max5481.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/potentiometer/max5481.c b/drivers/iio/potentiometer/max5481.c index 098d144a8fdd..6e22b31cbe8b 100644 --- a/drivers/iio/potentiometer/max5481.c +++ b/drivers/iio/potentiometer/max5481.c @@ -44,7 +44,7 @@ static const struct max5481_cfg max5481_cfg[] = { struct max5481_data { struct spi_device *spi; const struct max5481_cfg *cfg; - u8 msg[3] ____cacheline_aligned; + u8 msg[3] __aligned(IIO_ALIGN); }; #define MAX5481_CHANNEL { \ From patchwork Tue May 3 08:59:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835382 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B2FFC433EF for ; Tue, 3 May 2022 09:04:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233222AbiECJIU (ORCPT ); Tue, 3 May 2022 05:08:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233215AbiECJIS (ORCPT ); Tue, 3 May 2022 05:08:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C01881BE93 for ; Tue, 3 May 2022 02:04:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5B59860DDD for ; Tue, 3 May 2022 09:04:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CDB8C385B2; Tue, 3 May 2022 09:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568683; bh=LzaPr3OLtbcZBVeLVUs27XEqagu01nF8Iae/GZ+30NM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mI1kDWFVQTOCIFU6kWhl5Maud+JuVYi9l5bgfQq/xzM/tIDv9Hq1no0u7Ff7qi1TR 6iKNdE8jIc/Y969kKQCwkrrNP7jEF42WkJKCcudCCN4sRljd/AQ3BLYzJeCzQwYPuU nLKEsJL+UHNtLhA8Qv37Al1Thw1lc9aXFl1xNMQFFZSCikxgVy5WdPEuUyO55kEg6U vknnkipItGceOj3D2KoZyWchK8HCJx8SdGP/1/8tzlaIvC3BEC2ZvivGt2BnqyvP0t hx2HfILMzSMREt1Ev7el5GOvd2pTufCqO85UJQP97xmEdMcLMuBqjXKdhU7X/FI8kT KcJP2A9dNRRsQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 83/92] iio: potentiometer: mcp41010: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:26 +0100 Message-Id: <20220503085935.1533814-84-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 092cb71a604e ("iio: potentiometer: Add driver for Microchip MCP41xxx/42xxx") Signed-off-by: Jonathan Cameron --- drivers/iio/potentiometer/mcp41010.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/potentiometer/mcp41010.c b/drivers/iio/potentiometer/mcp41010.c index 30a4594d4e11..2726a3b4a782 100644 --- a/drivers/iio/potentiometer/mcp41010.c +++ b/drivers/iio/potentiometer/mcp41010.c @@ -60,7 +60,7 @@ struct mcp41010_data { const struct mcp41010_cfg *cfg; struct mutex lock; /* Protect write sequences */ unsigned int value[MCP41010_MAX_WIPERS]; /* Cache wiper values */ - u8 buf[2] ____cacheline_aligned; + u8 buf[2] __aligned(IIO_ALIGN); }; #define MCP41010_CHANNEL(ch) { \ From patchwork Tue May 3 08:59:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BE63C433FE for ; Tue, 3 May 2022 09:04:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233216AbiECJI2 (ORCPT ); Tue, 3 May 2022 05:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233215AbiECJI1 (ORCPT ); Tue, 3 May 2022 05:08:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A97E1BE93 for ; Tue, 3 May 2022 02:04:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3D75BB81CE1 for ; Tue, 3 May 2022 09:04:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70ABFC385B1; Tue, 3 May 2022 09:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568693; bh=I1IY52sl8lN/v+ykoXcSXuMo7I51HXZeB+kaBz8ukYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=etSKErtbrgRF2k9l2XQQOEEe5CR2Z3QyqJyXtzMHr9SWFMCz9VTtv3rmayfKIBnn2 5sijl4ZGYDQqzGLhPaVR5NOBc9IXKF6EUJ6zHEXgppoBTInUZb49LQyCEMcoOKAAJw JIMxB8f/Kra/JS0q2SHTSLXLSnsuYsJeC5jWcts9ZEaOHrmvinAjsYfZ1gU84c9Bkh 3YpTcw3S8LTKInerh+UPmHMJQH+FkJzovtmWiZQsU83KbypxRFXQNEosEh/NLclEEb k0GX/Xgw4Emm89jUYXpPpATWK/9dihZrXjXdPaYzi5qMJ/WVU5azsS7QGRbIOudKsd EdUXPteJIBFIA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 84/92] iio: potentiometer: mcp4131: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:27 +0100 Message-Id: <20220503085935.1533814-85-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 22d199a53910 ("iio: potentiometer: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X") Signed-off-by: Jonathan Cameron --- drivers/iio/potentiometer/mcp4131.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/potentiometer/mcp4131.c b/drivers/iio/potentiometer/mcp4131.c index 7c8c18ab8764..f0dfac60fc8c 100644 --- a/drivers/iio/potentiometer/mcp4131.c +++ b/drivers/iio/potentiometer/mcp4131.c @@ -129,7 +129,7 @@ struct mcp4131_data { struct spi_device *spi; const struct mcp4131_cfg *cfg; struct mutex lock; - u8 buf[2] ____cacheline_aligned; + u8 buf[2] __aligned(IIO_ALIGN); }; #define MCP4131_CHANNEL(ch) { \ From patchwork Tue May 3 08:59:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835384 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41A9BC433EF for ; Tue, 3 May 2022 09:05:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233215AbiECJIi (ORCPT ); Tue, 3 May 2022 05:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233226AbiECJIh (ORCPT ); Tue, 3 May 2022 05:08:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 061BD1D30B for ; Tue, 3 May 2022 02:05:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A6EA0B81BE1 for ; Tue, 3 May 2022 09:05:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C58CC385A9; Tue, 3 May 2022 09:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568702; bh=dTReXVHK7ChxtUh/hkSF98LAOU+2/MibHJLS4urHYYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sYyWYQCAIaDfC88KrdX1FVSDakdYKvAUqHCX77O920CDbTw5LGIQHOyiYLNoVUYRt f7yZdXWSTqQRz/OgmkiVZj6Z1/twIQYvafoGnVwZ10xGzfb41/HTm6Aee0skswjpad DXwYRGallkmPKSpPMX5Fcw4wFKC5qZNwCqUCeRcpPRFeiA/oLPTW4cAqVuEQHUqL4k cCDyhEgVFb6/OpE/Z+FvvDptwEGKenYAL1PSPTnRQlkaU+RJ+f2wujvLbrGSQFskdE 5mWPC6ExgHrtEfqBo2Rf2MuGtiROT2ppDt3SH1a/fcAJGjxpbxu0BP1pP17xeAVdDp tjfha40hnPsoQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 85/92] iio: pressure: dlhl60d: Drop unnecessary alignment forcing. Date: Tue, 3 May 2022 09:59:28 +0100 Message-Id: <20220503085935.1533814-86-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron I2C doesn't use the buffers directly for DMA so there is no need to enforce alignment. Signed-off-by: Jonathan Cameron Cc: Tomislav Denis --- drivers/iio/pressure/dlhl60d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/pressure/dlhl60d.c b/drivers/iio/pressure/dlhl60d.c index ade73267d5eb..5f6bb3603a8b 100644 --- a/drivers/iio/pressure/dlhl60d.c +++ b/drivers/iio/pressure/dlhl60d.c @@ -47,7 +47,7 @@ struct dlh_state { struct dlh_info info; bool use_interrupt; struct completion completion; - u8 rx_buf[DLH_NUM_READ_BYTES] ____cacheline_aligned; + u8 rx_buf[DLH_NUM_READ_BYTES]; }; static struct dlh_info dlh_info_tbl[] = { From patchwork Tue May 3 08:59:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECE0CC433FE for ; Tue, 3 May 2022 09:05:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233303AbiECJJF (ORCPT ); Tue, 3 May 2022 05:09:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233240AbiECJIr (ORCPT ); Tue, 3 May 2022 05:08:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80198DE4 for ; Tue, 3 May 2022 02:05:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0792D61357 for ; Tue, 3 May 2022 09:05:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 183EBC385B1; Tue, 3 May 2022 09:05:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568711; bh=jY2MaLUibDxv+r82/k9lqoRPwb6qIHU86LKAoM7J2zg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N9NcUuXW0TSHf/euVgIkGSdPYGlPzz2QO2vT3jZDifAFV8p4mBaB1R2itmi9GBRDi f56zWtB/6C54F2EyKniKN3KLHkUIPGY3ytlev3LgVXGM+k9PBG35AZ0Zf8J09RIz9l KyseEZXK5XKDJR0DhHELqV23yMAFekmUIOIsZeqErNAP0MtPoIYiqW3a+Dh9t/xHTv tv4eDbKlyoBofxjgqkjzSmTYAuWrv6je8QcUSxb5U65T1M+q9Ds9yOKPr+nfQ5RZRJ Vf+Ppk4OY1DcirCs/0DPtikm7OCkuI8IW3LZw4yncFzwhEhPLsr31yO7C9Wun8HP5L oHKxA6KZs/7hA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 86/92] iio: proximity: as3935: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:29 +0100 Message-Id: <20220503085935.1533814-87-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: 24ddb0e4bba4 ("iio: Add AS3935 lightning sensor support") Signed-off-by: Jonathan Cameron Cc: Matt Ranostay --- drivers/iio/proximity/as3935.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c index 67891ce2bd09..e4a6d0de47f4 100644 --- a/drivers/iio/proximity/as3935.c +++ b/drivers/iio/proximity/as3935.c @@ -65,7 +65,7 @@ struct as3935_state { u8 chan; s64 timestamp __aligned(8); } scan; - u8 buf[2] ____cacheline_aligned; + u8 buf[2] __aligned(IIO_ALIGN); }; static const struct iio_chan_spec as3935_channels[] = { From patchwork Tue May 3 08:59:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4485FC4332F for ; Tue, 3 May 2022 09:05:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233203AbiECJJG (ORCPT ); Tue, 3 May 2022 05:09:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233294AbiECJI7 (ORCPT ); Tue, 3 May 2022 05:08:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD6F122B03 for ; Tue, 3 May 2022 02:05:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 73137B81C97 for ; Tue, 3 May 2022 09:05:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01C40C385A4; Tue, 3 May 2022 09:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568721; bh=qU0ktlzZKkPQeJ/knCRThD7oesOqnuxEnesVQiJ1yIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mdcjw8IEflCJi8NV+z4fNYyeOuUyGRxs06JKtcETOKpue87PmPDMeNy5FsnykIEJd ol8gFIOA9duXQDmp5r2ZarKzHccM3QFGRj/C6bJI0SjGBmi7QevvlNZvpwFno1lDAS TCgqB229TG0PytHD/c53bJD93v+zfNtJRJEY8nZxKzewF0+lQzF0H9LvW3srk5/6Cu MBLziGQyW2SXOj7DY0DDafcQxyZMzLt1fTuW9KVfvTNg3DvphE4NtXpQgFnIWMT1QU SLToMe+nDim3kH53mFaqf1cjtDWH0RItUwmEIvrY1lXdo8rbtPmki0VA4sCscM7qGN lStbSLi5V5qtQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 87/92] iio: proximity: vcnl3020: Drop unnecessary alignment requirement for i2c device Date: Tue, 3 May 2022 09:59:30 +0100 Message-Id: <20220503085935.1533814-88-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron I2C does not by default use buffers directly for DMA so there is no need to ensure they are DMA safe. Signed-off-by: Jonathan Cameron Cc: Ivan Mikhaylov --- drivers/iio/proximity/vcnl3020.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/proximity/vcnl3020.c b/drivers/iio/proximity/vcnl3020.c index ff83638db16f..cbc8400c773c 100644 --- a/drivers/iio/proximity/vcnl3020.c +++ b/drivers/iio/proximity/vcnl3020.c @@ -71,14 +71,14 @@ static const int vcnl3020_prox_sampling_frequency[][2] = { * @dev: vcnl3020 device. * @rev: revision id. * @lock: lock for protecting access to device hardware registers. - * @buf: DMA safe __be16 buffer. + * @buf: __be16 buffer. */ struct vcnl3020_data { struct regmap *regmap; struct device *dev; u8 rev; struct mutex lock; - __be16 buf ____cacheline_aligned; + __be16 buf; }; /** From patchwork Tue May 3 08:59:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CFE8C433F5 for ; Tue, 3 May 2022 09:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233240AbiECJJH (ORCPT ); Tue, 3 May 2022 05:09:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233302AbiECJJF (ORCPT ); Tue, 3 May 2022 05:09:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1595122BF0 for ; Tue, 3 May 2022 02:05:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A678E61357 for ; Tue, 3 May 2022 09:05:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B36B7C385B2; Tue, 3 May 2022 09:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568731; bh=VE/2SA4W7Q33z2InonY83WkwktFvl38di5S6fuYRKBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EtYk1Bbm5i7wSMis7vpZVResWuDG7SIldRJKrz2zLwFrCZhg0uolct+w2GaswD59P OJRRnmgmIVPkeAdssyvdoGH0F+75wuaHmQ99R9Mcf+JJWBnPMYVuTxHQwvGGQbBXHu E201+bYPL5JOId8Dir5xdPqyByTRo6l7u1UXntzjqhML+SMpOIyfLIfLtdhM1uMhVW SQk5i7rNSJw1f4BX8+oQiN2okeDWgtGX2MzpWuCxKVR6jwkmUNYOMlX4DnCocmiS3z cpio16XxaSYSrf7oaccK7sK+Zq86Be3f25OGlDmktxUmlZIBR8wqlKZfGM/LnPLzTr 82FK7WpyJ5zsg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 88/92] iio: resolver: ad2s1200: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:31 +0100 Message-Id: <20220503085935.1533814-89-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes tag is probably not where the issue was first introduced, but is likely to be as far as anyone considers backporting this fix. Fixes: 0bd3d338f61b ("staging: iio: ad2s1200: Improve readability with be16_to_cpup") Signed-off-by: Jonathan Cameron --- drivers/iio/resolver/ad2s1200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/resolver/ad2s1200.c b/drivers/iio/resolver/ad2s1200.c index 9746bd935628..c568d2990141 100644 --- a/drivers/iio/resolver/ad2s1200.c +++ b/drivers/iio/resolver/ad2s1200.c @@ -41,7 +41,7 @@ struct ad2s1200_state { struct spi_device *sdev; struct gpio_desc *sample; struct gpio_desc *rdvel; - __be16 rx ____cacheline_aligned; + __be16 rx __aligned(IIO_ALIGN); }; static int ad2s1200_read_raw(struct iio_dev *indio_dev, From patchwork Tue May 3 08:59:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7C68C433EF for ; Tue, 3 May 2022 09:05:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233228AbiECJJS (ORCPT ); Tue, 3 May 2022 05:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233254AbiECJJP (ORCPT ); Tue, 3 May 2022 05:09:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BE7734672 for ; Tue, 3 May 2022 02:05:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EFB93B81BE2 for ; Tue, 3 May 2022 09:05:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A32EAC385B0; Tue, 3 May 2022 09:05:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568740; bh=TJBL/IC0Y9IQSbI/bBwnIf2Jacmcgs1MDK2TXBfiuBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yft/t0WfhwAyK/Hk1gMonwGKEZBIRlBx2NKdB6oa1fBrUL41Uy4BruA3Qo6LK5o63 F6okdwSRIWOTMHpXUbFEjuz30BviPUnvjYnom8GqWaahDFSIsXzwuL8OtkmT0Aor/v jReB/17tsjbHSDBLtlP0rFB9HyhQqGX2vuMsN37vN7zfHI7y3JPaDTb5A1DFto8nAN Oa6H7MqfLYAoUKCfQ8tQ9wdYupc/TcQLfRnTyE7PMFfm9JchO0l1CM4e5QB+KlSy4/ eEipl8ODtRZuCgTDryVgvRsiRoukWOdsLQ8R3czVUJbUjr9bifC3blNt4JXUgvi0MT ZIl+lEXytvRbg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 89/92] iio: resolver: ad2s90: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:32 +0100 Message-Id: <20220503085935.1533814-90-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes tag is probably not where the issue was first introduced, but is likely to be far beyond the point where anyone considers backporting this fix. Fixes: 58f08b0af857 ("staging:iio:resolver:ad2s90 general cleanup") Signed-off-by: Jonathan Cameron --- drivers/iio/resolver/ad2s90.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/resolver/ad2s90.c b/drivers/iio/resolver/ad2s90.c index d6a91f137e13..d8850e6cf911 100644 --- a/drivers/iio/resolver/ad2s90.c +++ b/drivers/iio/resolver/ad2s90.c @@ -24,7 +24,7 @@ struct ad2s90_state { struct mutex lock; /* lock to protect rx buffer */ struct spi_device *sdev; - u8 rx[2] ____cacheline_aligned; + u8 rx[2] __aligned(IIO_ALIGN); }; static int ad2s90_read_raw(struct iio_dev *indio_dev, From patchwork Tue May 3 08:59:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94758C433F5 for ; Tue, 3 May 2022 09:05:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233252AbiECJJ1 (ORCPT ); Tue, 3 May 2022 05:09:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233253AbiECJJX (ORCPT ); Tue, 3 May 2022 05:09:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 335672FFEA for ; Tue, 3 May 2022 02:05:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E6078B81BE2 for ; Tue, 3 May 2022 09:05:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47CC3C385A4; Tue, 3 May 2022 09:05:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568749; bh=wZoWv7dlXHVtEOIav7wJinD1bL6C9ELcXdYwh2HpiMA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uc0QDEm8eSlhxZA1XX0P2cNBD1JcRFpWpIsWTjmlJ0PEfKx5+VG6sTM9YIpUWT/TW U+/L3RkrldimXNSt/P9jA9WY+MoH4bb3ePUWOyoeBpxM01MzGGiYfnNrjt+PC3ALKe imW2ena3APjH34EzmAmsVH8D3DYYiTmlrAh9EOFOAKPjj1Iw1GEc81660jM2V6wRKT zGAebMBdkB+uxYsNZ6f8lDe3lIuO9EvRrNKUSxWiy/YbmUhM1B46BxwhwJiesF7qNa Z8wAGo1BvLYUxmwFmzt5IjNJxdFZifG++cgeizMi+N22d/c1opqPUSFNw1YL0zjxlI Xu114K3hmPHiQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 90/92] iio: temp: ltc2983: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:33 +0100 Message-Id: <20220503085935.1533814-91-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes: f110f3188e56 ("iio: temperature: Add support for LTC2983") Signed-off-by: Jonathan Cameron Cc: Nuno Sá --- drivers/iio/temperature/ltc2983.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index 301c3f13fb26..cc90a4abdf3d 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -200,11 +200,11 @@ struct ltc2983_data { u8 num_channels; u8 iio_channels; /* - * DMA (thus cache coherency maintenance) requires the - * transfer buffers to live in their own cache lines. + * DMA (thus cache coherency maintenance) may require the + * transfer buffers live in their own cache lines. * Holds the converted temperature */ - __be32 temp ____cacheline_aligned; + __be32 temp __aligned(IIO_ALIGN); }; struct ltc2983_sensor { From patchwork Tue May 3 08:59:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29DB7C433F5 for ; Tue, 3 May 2022 09:06:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233224AbiECJJe (ORCPT ); Tue, 3 May 2022 05:09:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231558AbiECJJd (ORCPT ); Tue, 3 May 2022 05:09:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF2DA22BF0 for ; Tue, 3 May 2022 02:06:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 83730B81CA7 for ; Tue, 3 May 2022 09:06:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AA01C385B2; Tue, 3 May 2022 09:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568759; bh=OMXv4W90qHtgOaXeSLQQJLpz4PychbUbHGw5M9Mzm8o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ESHHJHUYv7S07nkA4QsllWinnzeJrX97x/S51PkgPBN+JjOkSNXCuz7NcWM5GeBBq pb9Wdc9a9taSQ4jc1hQdHXyxLuzhPgpV8mLSYkjRTq/SUpFBwLXYxaXE737A+XB4X8 c9Zozrw1AdUgJjSr8MYylBoDjdsEUJv255quVu7G1yPEq6J3gF9BwYf9AxelyUdJw+ F+6s0aqAZxDd5YYQu/okLZNp1E7pD+da7AG8vZPgEmTwnNs12IgLmnz1obrTuSlhHF PRET5Xz23DZWqUeMCx+Z2X2V71qhsaIByikHHNbQaExNJZZxpW2yCzTYvxZPM9ukk/ AuYPx07AogAIA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 91/92] iio: temp: max31865: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:34 +0100 Message-Id: <20220503085935.1533814-92-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition Fixes: e112dc4e18ea ("iio: temperature: Add MAX31865 RTD Support") Signed-off-by: Jonathan Cameron Cc: Navin Sankar Velliangiri --- drivers/iio/temperature/max31865.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/temperature/max31865.c b/drivers/iio/temperature/max31865.c index 86c3f3509a26..e68cda4d25dc 100644 --- a/drivers/iio/temperature/max31865.c +++ b/drivers/iio/temperature/max31865.c @@ -53,7 +53,7 @@ struct max31865_data { struct mutex lock; bool filter_50hz; bool three_wire; - u8 buf[2] ____cacheline_aligned; + u8 buf[2] __aligned(IIO_ALIGN); }; static int max31865_read(struct max31865_data *data, u8 reg, From patchwork Tue May 3 08:59:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FB31C433F5 for ; Tue, 3 May 2022 09:06:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233253AbiECJJm (ORCPT ); Tue, 3 May 2022 05:09:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233251AbiECJJl (ORCPT ); Tue, 3 May 2022 05:09:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 644E52B256 for ; Tue, 3 May 2022 02:06:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F3800612CB for ; Tue, 3 May 2022 09:06:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA3EAC385B1; Tue, 3 May 2022 09:05:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568768; bh=RJ86wOJXZafnq4Uf8EC3MIljeq2hlox/JxqTdfI4+ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=df1FweNfVZJGZW95rs7ZM6DFRiiYardSmXH6T2VfkxWtcDzsrZXWzkxzN/cFAMuBq bG6IK0xZw2I4B+pdhHpPsFC6NO4704P0UyzHTl2zwR2bQGZkxhUqEcoO7PPJvTkwiL clGyOkL4WPFOt49vd1k5kKydi876/zeETxd+24+QknycvgHr2BYopGLc3R1IG87r3N s8dkWA0no0Q0udG33epEwVkRqxAkT+lDqeKc6ibRwmpZXtotQHAHgVRFXBaWg2McTE SQGkfSVvNmDawxTn2j5iwq/mPXjMDI/UMqnNw8Dik950g+6lkcGr+c2OKLkKZj83Td +S2jyGvw5q5aA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 92/92] iio: temp: maxim_thermocouple: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:35 +0100 Message-Id: <20220503085935.1533814-93-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition Fixes: 1f25ca11d84a ("iio: temperature: add support for Maxim thermocouple chips") Signed-off-by: Jonathan Cameron Cc: Matt Ranostay --- drivers/iio/temperature/maxim_thermocouple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/temperature/maxim_thermocouple.c b/drivers/iio/temperature/maxim_thermocouple.c index 98c41cddc6f0..03f561af6dba 100644 --- a/drivers/iio/temperature/maxim_thermocouple.c +++ b/drivers/iio/temperature/maxim_thermocouple.c @@ -122,7 +122,7 @@ struct maxim_thermocouple_data { struct spi_device *spi; const struct maxim_thermocouple_chip *chip; - u8 buffer[16] ____cacheline_aligned; + u8 buffer[16] __aligned(IIO_ALIGN); char tc_type; };