IIO: Fix alignment of buffers for DMA
Subsystems (23)
Jonathan Cameron
maintainerv2 cover IIO: Fix alignment of buffers for DMA
From: Jonathan Cameron <[email protected]>
Changes since v1:
- Rename IIO_ALIGN to more specific IIO_DMA_MINALIGN
- Fix a few patch descriptions (wrong drive names and such like)
- Fixed a bunch of typos in the intro text in this email (I clearly forgot to spell check that!)
- Stopped removing 'to' in some comment updates. The English is fine either way and this reduces the patch set size.
- Pick up tags (thanks all!)
A few bits of feedback I haven't acted on:
- Use of a general kernel define with a generic name. ARCH_DMA_MINALIGN isn't yet available on all architectures, so the use of IIO_DMA_MINALIGN provides a good path to fix this now in a fashion that can be easily back ported.
- Adding a define for __aligned(IIO_DMA_MINALIGN). I think that such a define would obscure what was going a little. I couldn't think of a reason we'd want to add anything else across all these locations (which is the other reason we might want such a define).
- Dropping some unnecessary marking of second buffers. I left these alone because explaining why they aren't needed would require additional commentary and is a separate cleanup that can wait for another time.#
Many years ago, IIO started using ____cacheline_aligned to ensure that buffers that might be used for DMA were not sharing a cacheline with other data that might lead to DMA safety issues.
As it turns out, that was fine at the time, but not based on the correct alignment requirement (though I believe it was a conservative choice at the time). Note that on many architectures this was introducing unnecessary padding. We should have been using ARCH_KMALLOC_MINALIGN as other subsystems such as crypto have done for a long time.
Patch 1 description contains more information but in short, there are ARM64 SoCs out their that have a larger cacheline size for caches beyond L1. In many cases they maintain coherency for all DMA devices attached and so this isn't a problem, but there are exceptions that do not.
So, this is a rather large patch set and just covers those drivers that are in the last kernel release and in drivers/iio.
Many of these drivers are somewhat old so I haven't specifically cc'd anyone so will be relying on those kind enough to sanity check patches on drivers that are beyond their own.
Given there is ongoing discussion around reducing the alignment requirements where possible, I've adopted the existing IIO_ALIGN define throughout. That way we have a single point to update if that becomes relevant in future.
Jonathan Cameron (92):
iio: core: Fix IIO_ALIGN and rename as it was not sufficiently large
iio: accel: adxl313: Fix alignment for DMA safety
iio: accel: adxl355: Fix alignment for DMA safety
iio: accel: adxl367: Fix alignment for DMA safety
iio: accel: bma220: Fix alignment for DMA safety
iio: accel: bmi088: Fix alignment for DMA safety
iio: accel: sca3000: Fix alignment for DMA safety
iio: accel: sca3300: Fix alignment for DMA safety
iio: adc: ad7266: Fix alignment for DMA safety
iio: adc: ad7280a: Fix alignment for DMA safety
iio: adc: ad7292: Fix alignment for DMA safety
iio: adc: ad7298: Fix alignment for DMA safety
iio: adc: ad7476: Fix alignment for DMA safety
iio: adc: ad7606: Fix alignment for DMA safety
iio: adc: ad7766: Fix alignment for DMA safety
iio: adc: ad7768-1: Fix alignment for DMA safety
iio: adc: ad7887: Fix alignment for DMA safety
iio: adc: ad7923: Fix alignment for DMA safety
iio: adc: ad7949: Fix alignment for DMA safety
iio: adc: hi8435: Fix alignment for DMA safety
iio: adc: ltc2496: Fix alignment for DMA safety
iio: adc: ltc2497: Fix alignment for DMA safety
iio: adc: max1027: Fix alignment for DMA safety
iio: adc: max11100: Fix alignment for DMA safety
iio: adc: max1118: Fix alignment for DMA safety
iio: adc: max1241: Fix alignment for DMA safety
iio: adc: mcp320x: Fix alignment for DMA safety
iio: adc: ti-adc0832: Fix alignment for DMA safety
iio: adc: ti-adc084s021: Fix alignment for DMA safety
iio: adc: ti-adc108s102: Fix alignment for DMA safety
iio: adc: ti-adc12138: Fix alignment for DMA safety
iio: adc: ti-adc128s052: Fix alignment for DMA safety
iio: adc: ti-adc161s626: Fix alignment for DMA safety
iio: adc: ti-ads124s08: Fix alignment for DMA safety
iio: adc: ti-ads131e08: Fix alignment for DMA safety
iio: adc: ti-ads7950: Fix alignment for DMA safety
iio: adc: ti-ads8344: Fix alignment for DMA safety
iio: adc: ti-ads8688: Fix alignment for DMA safety
iio: adc: ti-tlc4541: Fix alignment for DMA safety
iio: addac: ad74413r: Fix alignment for DMA safety
iio: amplifiers: ad8366: Fix alignment for DMA safety
iio: common: ssp: Fix alignment for DMA safety
iio: dac: ad5064: Fix alignment for DMA safety
iio: dac: ad5360: Fix alignment for DMA safety
iio: dac: ad5421: Fix alignment for DMA safety
iio: dac: ad5449: Fix alignment for DMA safety
iio: dac: ad5504: Fix alignment for DMA safety
iio: dac: ad5592r: Fix alignment for DMA safety
iio: dac: ad5686: Fix alignment for DMA safety
iio: dac: ad5755: Fix alignment for DMA safety
iio: dac: ad5761: Fix alignment for DMA safety
iio: dac: ad5764: Fix alignment for DMA safety
iio: dac: ad5766: Fix alignment for DMA safety
iio: dac: ad5770r: Fix alignment for DMA safety
iio: dac: ad5791: Fix alignment for DMA saftey
iio: dac: ad7293: Fix alignment for DMA safety
iio: dac: ad7303: Fix alignment for DMA safety
iio: dac: ad8801: Fix alignment for DMA safety
iio: dac: ltc2688: Fix alignment for DMA safety
iio: dac: mcp4922: Fix alignment for DMA safety
iio: dac: ti-dac082s085: Fix alignment for DMA safety
iio: dac: ti-dac5571: Fix alignment for DMA safety
iio: dac: ti-dac7311: Fix alignment for DMA safety
iio: dac: ti-dac7612: Fix alignment for DMA safety
iio: frequency: ad9523: Fix alignment for DMA safety
iio: frequency: adf4350: Fix alignment for DMA safety
iio: frequency: adf4371: Fix alignment for DMA safety
iio: frequency: admv1013: Fix alignment for DMA safety
iio: frequency: admv1014: Fix alignment for DMA safety
iio: frequency: admv4420: Fix alignment for DMA safety
iio: frequency: adrf6780: Fix alignment for DMA safety
iio: gyro: adis16080: Fix alignment for DMA safety
iio: gyro: adis16130: Fix alignment for DMA safety
iio: gyro: adxrs450: Fix alignment for DMA safety
iio: gyro: fxas210002c: Fix alignment for DMA safety
iio: imu: fxos8700: Fix alignment for DMA safety
iio: imu: inv_icm42600: Fix alignment for DMA safety
iio: imu: inv_icm42600: Fix alignment for DMA safety in buffer code.
iio: imu: mpu6050: Fix alignment for DMA safety
iio: potentiometer: ad5110: Fix alignment for DMA safety
iio: potentiometer: ad5272: Fix alignment for DMA safety
iio: potentiometer: max5481: Fix alignment for DMA safety
iio: potentiometer: mcp41010: Fix alignment for DMA safety
iio: potentiometer: mcp4131: Fix alignment for DMA safety
iio: pressure: dlhl60d: Drop unnecessary alignment forcing.
iio: proximity: as3935: Fix alignment for DMA safety
iio: proximity: vcnl3020: Drop unnecessary alignment requirement for
i2c device
iio: resolver: ad2s1200: Fix alignment for DMA safety
iio: resolver: ad2s90: Fix alignment for DMA safety
iio: temp: ltc2983: Fix alignment for DMA safety
iio: temp: max31865: Fix alignment for DMA safety
iio: temp: maxim_thermocouple: Fix alignment for DMA safety
drivers/iio/accel/adxl313_core.c | 2 +- drivers/iio/accel/adxl355_core.c | 2 +- drivers/iio/accel/adxl367.c | 2 +- drivers/iio/accel/adxl367_spi.c | 8 +++++--- drivers/iio/accel/bma220_spi.c | 2 +- drivers/iio/accel/bmi088-accel-core.c | 2 +- drivers/iio/accel/sca3000.c | 4 ++-- drivers/iio/accel/sca3300.c | 2 +- drivers/iio/adc/ad7266.c | 4 ++-- drivers/iio/adc/ad7280a.c | 2 +- drivers/iio/adc/ad7292.c | 2 +- drivers/iio/adc/ad7298.c | 2 +- drivers/iio/adc/ad7476.c | 5 ++--- drivers/iio/adc/ad7606.h | 4 ++-- drivers/iio/adc/ad7766.c | 5 ++--- drivers/iio/adc/ad7768-1.c | 4 ++-- drivers/iio/adc/ad7887.c | 5 ++--- drivers/iio/adc/ad7923.c | 4 ++-- drivers/iio/adc/ad7949.c | 2 +- drivers/iio/adc/adi-axi-adc.c | 7 ++++--- drivers/iio/adc/hi8435.c | 2 +- drivers/iio/adc/ltc2496.c | 4 ++-- drivers/iio/adc/ltc2497.c | 4 ++-- drivers/iio/adc/max1027.c | 2 +- drivers/iio/adc/max11100.c | 4 ++-- drivers/iio/adc/max1118.c | 2 +- drivers/iio/adc/max1241.c | 2 +- drivers/iio/adc/mcp320x.c | 2 +- drivers/iio/adc/ti-adc0832.c | 2 +- drivers/iio/adc/ti-adc084s021.c | 4 ++-- drivers/iio/adc/ti-adc108s102.c | 4 ++-- drivers/iio/adc/ti-adc12138.c | 2 +- drivers/iio/adc/ti-adc128s052.c | 2 +- drivers/iio/adc/ti-adc161s626.c | 2 +- drivers/iio/adc/ti-ads124s08.c | 2 +- drivers/iio/adc/ti-ads131e08.c | 2 +- drivers/iio/adc/ti-ads7950.c | 4 ++-- drivers/iio/adc/ti-ads8344.c | 2 +- drivers/iio/adc/ti-ads8688.c | 2 +- drivers/iio/adc/ti-tlc4541.c | 4 ++-- drivers/iio/addac/ad74413r.c | 4 ++-- drivers/iio/amplifiers/ad8366.c | 4 ++-- drivers/iio/common/ssp_sensors/ssp.h | 3 +-- drivers/iio/dac/ad5064.c | 4 ++-- drivers/iio/dac/ad5360.c | 4 ++-- drivers/iio/dac/ad5421.c | 4 ++-- drivers/iio/dac/ad5449.c | 4 ++-- drivers/iio/dac/ad5504.c | 2 +- drivers/iio/dac/ad5592r-base.h | 4 +++- drivers/iio/dac/ad5686.h | 6 ++++-- drivers/iio/dac/ad5755.c | 4 ++-- drivers/iio/dac/ad5761.c | 4 ++-- drivers/iio/dac/ad5764.c | 4 ++-- drivers/iio/dac/ad5766.c | 2 +- drivers/iio/dac/ad5770r.c | 2 +- drivers/iio/dac/ad5791.c | 2 +- drivers/iio/dac/ad7293.c | 2 +- drivers/iio/dac/ad7303.c | 4 ++-- drivers/iio/dac/ad8801.c | 2 +- drivers/iio/dac/ltc2688.c | 4 ++-- drivers/iio/dac/mcp4922.c | 2 +- drivers/iio/dac/ti-dac082s085.c | 2 +- drivers/iio/dac/ti-dac5571.c | 2 +- drivers/iio/dac/ti-dac7311.c | 2 +- drivers/iio/dac/ti-dac7612.c | 4 ++-- drivers/iio/frequency/ad9523.c | 6 +++--- drivers/iio/frequency/adf4350.c | 6 +++--- drivers/iio/frequency/adf4371.c | 2 +- drivers/iio/frequency/admv1013.c | 2 +- drivers/iio/frequency/admv1014.c | 2 +- drivers/iio/frequency/admv4420.c | 2 +- drivers/iio/frequency/adrf6780.c | 2 +- drivers/iio/gyro/adis16080.c | 2 +- drivers/iio/gyro/adis16130.c | 2 +- drivers/iio/gyro/adxrs450.c | 2 +- drivers/iio/gyro/fxas21002c_core.c | 6 +++--- drivers/iio/imu/fxos8700_core.c | 2 +- drivers/iio/imu/inv_icm42600/inv_icm42600.h | 2 +- drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h | 2 +- drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 2 +- drivers/iio/industrialio-core.c | 4 ++-- drivers/iio/potentiometer/ad5110.c | 4 ++-- drivers/iio/potentiometer/ad5272.c | 2 +- drivers/iio/potentiometer/max5481.c | 2 +- drivers/iio/potentiometer/mcp41010.c | 2 +- drivers/iio/potentiometer/mcp4131.c | 2 +- drivers/iio/pressure/dlhl60d.c | 2 +- drivers/iio/proximity/as3935.c | 2 +- drivers/iio/proximity/vcnl3020.c | 4 ++-- drivers/iio/resolver/ad2s1200.c | 2 +- drivers/iio/resolver/ad2s90.c | 2 +- drivers/iio/temperature/ltc2983.c | 4 ++-- drivers/iio/temperature/max31865.c | 2 +- drivers/iio/temperature/maxim_thermocouple.c | 2 +- include/linux/iio/iio.h | 10 ++++++++-- 95 files changed, 151 insertions(+), 142 deletions(-)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 1/92 iio: core: Fix IIO_ALIGN and rename as it was not sufficiently large
From: Jonathan Cameron <[email protected]>
Discussion of the series:
https://lore.kernel.org/all/[email protected]/
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.
Rename the define to make it's purpose more explicit. It will be used much more widely going forwards (to replace incorrect ____cacheline_aligned markings.
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.
--- drivers/iio/adc/adi-axi-adc.c | 7 ++++--- drivers/iio/industrialio-core.c | 4 ++-- include/linux/iio/iio.h | 10 ++++++++-- 3 files changed, 14 insertions(+), 7 deletions(-)
drivers/iio/adc/adi-axi-adc.c +4 -3
@@ -84,7 +84,8 @@ void *adi_axi_adc_conv_priv(struct adi_axi_adc_conv *conv) {struct adi_axi_adc_client *cl =conv_to_client (conv); -return (char *)cl +ALIGN (sizeof (struct adi_axi_adc_client ),IIO_ALIGN ); +return (char *)cl +ALIGN (sizeof (struct adi_axi_adc_client ), +IIO_DMA_MINALIGN ); }EXPORT_SYMBOL_GPL (adi_axi_adc_conv_priv);
@@ -169,9 +170,9 @@ static struct adi_axi_adc_conv *adi_axi_adc_conv_register(struct device *dev,struct adi_axi_adc_client *cl;size_t alloc_size; - alloc_size =ALIGN (sizeof (struct adi_axi_adc_client ),IIO_ALIGN ); + alloc_size =ALIGN (sizeof (struct adi_axi_adc_client ),IIO_DMA_MINALIGN );if (sizeof_priv) - alloc_size +=ALIGN (sizeof_priv,IIO_ALIGN ); + alloc_size +=ALIGN (sizeof_priv,IIO_DMA_MINALIGN ); cl =kzalloc (alloc_size,GFP_KERNEL );if (!cl)
drivers/iio/industrialio-core.c +2 -2
@@ -1640,7 +1640,7 @@ struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv) alloc_size =sizeof (struct iio_dev_opaque );if (sizeof_priv) { - alloc_size =ALIGN (alloc_size,IIO_ALIGN ); + alloc_size =ALIGN (alloc_size,IIO_DMA_MINALIGN ); alloc_size += sizeof_priv; }
@@ -1650,7 +1650,7 @@ struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv) indio_dev = &iio_dev_opaque->indio_dev; indio_dev->priv = (char *)iio_dev_opaque + -ALIGN (sizeof (struct iio_dev_opaque ),IIO_ALIGN ); +ALIGN (sizeof (struct iio_dev_opaque ),IIO_DMA_MINALIGN ); indio_dev->dev.parent = parent; indio_dev->dev.type = &iio_device_type;
include/linux/iio/iio.h +8 -2
@@ -9,6 +9,7 @@#include <linux/device.h> #include <linux/cdev.h> +#include <linux/slab.h> #include <linux/iio/types.h> #include <linux/of.h> /* 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_DMA_MINALIGN'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_DMA_MINALIGN ARCH_KMALLOC_MINALIGNstruct iio_dev *iio_device_alloc (struct device *parent,int sizeof_priv);/* The information at the returned address is guaranteed to be cacheline aligned */
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerRe: [PATCH v2 01/92] iio: core: Fix IIO_ALIGN and rename as it was not sufficiently large
Quoted 30 lines · On Sun, 8 May 2022 18:55:41 +0100 Jonathan Cameron <[email protected]> wrote:
From: Jonathan Cameron <[email protected]>
Discussion of the series:
https://lore.kernel.org/all/[email protected]/
mm, arm64: ReduceARCH_KMALLOC_MINALIGNbrought to my attention that our current IIO usage ofL1CACHE_ALIGNis insufficient as their are Arm platforms out their with non coherent DMA and larger cache lines at at higher levels of their cache hierarchy.Rename the define to make it's purpose more explicit. It will be used much more widely going forwards (to replace incorrect
____cacheline_alignedmarkings.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_MINALIGNviaARCH_DMA_MINALIGNon 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.
c1132702c71fRevert "arm64: cache: LowerARCH_DMA_MINALIGNto 64 (L1_CACHE_BYTES)" That reverts:65688d2a05dearm64: cache: LowerARCH_DMA_MINALIGNto 64 (L1_CACHE_BYTES) which refers to the change originally being motivated by Thunder x1 performance rather than correctness.
Quoted 3 lines
Fixes 6f7c8ee585e9d ("staging:iio: Add ability to allocate private data space to iio_allocate_device")Signed-off-by Jonathan Cameron <[email protected]>Acked-by Nuno Sá <[email protected]>
This crossed with a patch adding another use of IIO_ALIGN in bma400. I've fixed that rename up whilst applying.
Thanks,
Jonathan
Quoted 82 lines
--- drivers/iio/adc/adi-axi-adc.c | 7 ++++--- drivers/iio/industrialio-core.c | 4 ++-- include/linux/iio/iio.h | 10 ++++++++-- 3 files changed, 14 insertions(+), 7 deletions(-)drivers/iio/adc/adi-axi-adc.c +4
-3@@ -84,7 +84,8 @@ void *adi_axi_adc_conv_priv(struct adi_axi_adc_conv *conv) {struct adi_axi_adc_client *cl =conv_to_client (conv); -return (char *)cl +ALIGN (sizeof (struct adi_axi_adc_client ),IIO_ALIGN ); +return (char *)cl +ALIGN (sizeof (struct adi_axi_adc_client ), +IIO_DMA_MINALIGN ); }EXPORT_SYMBOL_GPL (adi_axi_adc_conv_priv);@@ -169,9 +170,9 @@ static struct adi_axi_adc_conv *adi_axi_adc_conv_register(struct device *dev,struct adi_axi_adc_client *cl;size_t alloc_size; - alloc_size =ALIGN (sizeof (struct adi_axi_adc_client ),IIO_ALIGN ); + alloc_size =ALIGN (sizeof (struct adi_axi_adc_client ),IIO_DMA_MINALIGN );if (sizeof_priv) - alloc_size +=ALIGN (sizeof_priv,IIO_ALIGN ); + alloc_size +=ALIGN (sizeof_priv,IIO_DMA_MINALIGN ); cl =kzalloc (alloc_size,GFP_KERNEL );if (!cl)drivers/iio/industrialio-core.c +2
-2@@ -1640,7 +1640,7 @@ struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv) alloc_size =sizeof (struct iio_dev_opaque );if (sizeof_priv) { - alloc_size =ALIGN (alloc_size,IIO_ALIGN ); + alloc_size =ALIGN (alloc_size,IIO_DMA_MINALIGN ); alloc_size += sizeof_priv; }@@ -1650,7 +1650,7 @@ struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv) indio_dev = &iio_dev_opaque->indio_dev; indio_dev->priv = (char *)iio_dev_opaque + -ALIGN (sizeof (struct iio_dev_opaque ),IIO_ALIGN ); +ALIGN (sizeof (struct iio_dev_opaque ),IIO_DMA_MINALIGN ); indio_dev->dev.parent = parent; indio_dev->dev.type = &iio_device_type;include/linux/iio/iio.h +8
-2@@ -9,6 +9,7 @@#include <linux/device.h> #include <linux/cdev.h> +#include <linux/slab.h> #include <linux/iio/types.h> #include <linux/of.h> /* 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_DMA_MINALIGN'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_DMA_MINALIGN ARCH_KMALLOC_MINALIGNstruct iio_dev *iio_device_alloc (struct device *parent,int sizeof_priv);/* The information at the returned address is guaranteed to be cacheline aligned */
Jonathan Cameron
maintainerPATCH v2 2/92 iio: accel: adxl313: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/accel/adxl313_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/adxl313_core.c +1 -1
@@ -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_DMA_MINALIGN) ; };static const int adxl313_odr_freqs[][2 ] = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 3/92 iio: accel: adxl355: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is insufficient guarantee for non-coherent DMA.
Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/accel/adxl355_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/adxl355_core.c +1 -1
@@ -177,7 +177,7 @@ struct adxl355_data {u8 buf[14 ];s64 ts; } buffer; - }____cacheline_aligned ; + }__aligned(IIO_DMA_MINALIGN) ; }; static int adxl355_set_op_mode(struct adxl355_data *data,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 4/92 iio: accel: adxl367: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_DMA_MINALIGN definition.
Update comment to reflect that DMA safety may require separate cachelines.
--- drivers/iio/accel/adxl367.c | 2 +- drivers/iio/accel/adxl367_spi.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/iio/accel/adxl367.c +1 -1
@@ -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_DMA_MINALIGN) ;__be16 sample_buf;u8 act_threshold_buf[2 ];u8 inact_time_buf[2 ];
drivers/iio/accel/adxl367_spi.c +5 -3
@@ -9,6 +9,8 @@#include <linux/regmap.h> #include <linux/spi/spi.h> +#include <linux/iio/iio.h> +#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_DMA_MINALIGN) ;u8 reg_read_tx_buf[2 ];u8 fifo_tx_buf[1 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 5/92 iio: accel: bma220: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/accel/bma220_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/bma220_spi.c +1 -1
@@ -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_DMA_MINALIGN) ; };static const struct iio_chan_spec bma220_channels[] = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 6/92 iio: accel: bmi088: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/accel/bmi088-accel-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/bmi088-accel-core.c +1 -1
@@ -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_DMA_MINALIGN) ;/* shared DMA safe buffer */ };static const struct regmap_range bmi088_volatile_ranges[] = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 7/92 iio: accel: sca3000: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_DMA_MINALIGN definition.
The second alignment marking is left in place to avoid doing more than the simple fix in this patch.
--- drivers/iio/accel/sca3000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/accel/sca3000.c +2 -2
@@ -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_DMA_MINALIGN) ; +u8 tx[6 ]__aligned(IIO_DMA_MINALIGN) ; };/**
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 8/92 iio: accel: sca3300: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is insufficient guarantee for non-coherent DMA. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/accel/sca3300.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/sca3300.c +1 -1
@@ -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_DMA_MINALIGN) ;u8 rxbuf[4 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 9/92 iio: adc: ad7266: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to reflect that DMA safety 'may' require separate cachelines.
--- drivers/iio/adc/ad7266.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ad7266.c +2 -2
@@ -37,7 +37,7 @@ struct ad7266_state {struct gpio_desc *gpios[3 ];/* -* DMA (thus cache coherency maintenance) requires the +* DMA (thus cache coherency maintenance) may require the * transfer buffers to 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).
@@ -45,7 +45,7 @@ struct ad7266_state {struct {__be16 sample[2 ];s64 timestamp; - } data____cacheline_aligned ; + } data__aligned(IIO_DMA_MINALIGN) ; };static int ad7266_wakeup (struct ad7266_state *st)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 10/92 iio: adc: ad7280a: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/ad7280a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7280a.c +1 -1
@@ -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_DMA_MINALIGN) ;__be32 rx; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 11/92 iio: adc: ad7292: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/ad7292.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7292.c +1 -1
@@ -80,7 +80,7 @@ struct ad7292_state {struct regulator *reg;unsigned short vref_mv; -__be16 d16____cacheline_aligned ; +__be16 d16__aligned(IIO_DMA_MINALIGN) ;u8 d8[2 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 12/92 iio: adc: ad7298: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/ad7298.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7298.c +1 -1
@@ -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_DMA_MINALIGN) ;__be16 tx_buf[2 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 13/92 iio: adc: ad7476: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN 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.
--- drivers/iio/adc/ad7476.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/iio/adc/ad7476.c +2 -3
@@ -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_DMA_MINALIGN) ; };enum ad7476_supported_device_ids {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 14/92 iio: adc: ad7606: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____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.
--- drivers/iio/adc/ad7606.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ad7606.h +2 -2
@@ -116,11 +116,11 @@ struct ad7606_state {struct completion completion;/* -* DMA (thus cache coherency maintenance) requires the +* DMA (thus cache coherency maintenance) may require the * transfer buffers to 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_DMA_MINALIGN) ;__be16 d16[2 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 15/92 iio: adc: ad7766: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to reflect the fact DMA safety 'may' require separate cachelines.
--- drivers/iio/adc/ad7766.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/iio/adc/ad7766.c +2 -3
@@ -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_DMA_MINALIGN) ; };/*
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 16/92 iio: adc: ad7768-1: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to reflect that separate cachelines 'may' be required.
--- drivers/iio/adc/ad7768-1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ad7768-1.c +2 -2
@@ -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_DMA_MINALIGN) ; }; static int ad7768_spi_reg_read(struct ad7768_state *st, unsigned int addr,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 17/92 iio: adc: ad7887: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN 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.
--- drivers/iio/adc/ad7887.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/iio/adc/ad7887.c +2 -3
@@ -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_DMA_MINALIGN) ; };enum ad7887_supported_device_ids {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 18/92 iio: adc: ad7923: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
Note that some other fixes have applied to this line of code that may complicate automated backporting.
--- drivers/iio/adc/ad7923.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ad7923.c +2 -2
@@ -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_DMA_MINALIGN) ;__be16 tx_buf[4 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 19/92 iio: adc: ad7949: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Note the fixes tag predates some changes to this line of code so automated application of this fix may fail.
--- drivers/iio/adc/ad7949.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7949.c +1 -1
@@ -86,7 +86,7 @@ struct ad7949_adc_chip {u8 resolution;u16 cfg;unsigned int current_channel; -u16 buffer____cacheline_aligned ; +u16 buffer__aligned(IIO_DMA_MINALIGN) ;__be16 buf8b; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 20/92 iio: adc: hi8435: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/hi8435.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/hi8435.c +1 -1
@@ -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_DMA_MINALIGN) ; };static int hi8435_readb (struct hi8435_priv *priv,u8 reg,u8 *val)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 21/92 iio: adc: ltc2496: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/adc/ltc2496.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ltc2496.c +2 -2
@@ -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_DMA_MINALIGN) ;unsigned char txbuf[3 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 22/92 iio: adc: ltc2497: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/adc/ltc2497.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ltc2497.c +2 -2
@@ -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_DMA_MINALIGN) ; }; static int ltc2497_result_and_measure(struct ltc2497core_driverdata *ddata,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 23/92 iio: adc: max1027: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/max1027.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/max1027.c +1 -1
@@ -272,7 +272,7 @@ struct max1027_state {struct mutex lock;struct completion complete; -u8 reg____cacheline_aligned ; +u8 reg__aligned(IIO_DMA_MINALIGN) ; };static int max1027_wait_eoc (struct iio_dev *indio_dev)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 24/92 iio: adc: max11100: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/adc/max11100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/max11100.c +2 -2
@@ -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_DMA_MINALIGN) ; };static const struct iio_chan_spec max11100_channels[] = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 25/92 iio: adc: max1118: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/max1118.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/max1118.c +1 -1
@@ -42,7 +42,7 @@ struct max1118 {s64 ts__aligned(8) ; } scan; -u8 data____cacheline_aligned ; +u8 data__aligned(IIO_DMA_MINALIGN) ; };#define MAX1118_CHANNEL (ch) \
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 26/92 iio: adc: max1241: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/max1241.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/max1241.c +1 -1
@@ -26,7 +26,7 @@ struct max1241 {struct regulator *vref;struct gpio_desc *shutdown; -__be16 data____cacheline_aligned ; +__be16 data__aligned(IIO_DMA_MINALIGN) ; };static const struct iio_chan_spec max1241_channels[] = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 27/92 iio: adc: mcp320x: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Worth noting the fixes tag refers to the same issue being observed on a platform that probably had only 64 byte cachelines.
--- drivers/iio/adc/mcp320x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/mcp320x.c +1 -1
@@ -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_DMA_MINALIGN) ;u8 rx_buf[4 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 28/92 iio: adc: ti-adc0832: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/ti-adc0832.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-adc0832.c +1 -1
@@ -36,7 +36,7 @@ struct adc0832 {*/ u8 data[24 ]__aligned(8) ; -u8 tx_buf[2 ]____cacheline_aligned ; +u8 tx_buf[2 ]__aligned(IIO_DMA_MINALIGN) ;u8 rx_buf[2 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 29/92 iio: adc: ti-adc084s021: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/adc/ti-adc084s021.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ti-adc084s021.c +2 -2
@@ -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_DMA_MINALIGN) ;__be16 rx_buf[5 ];/* First 16-bits are trash */ };
Signature · 1 line
2.36.0
Re: [PATCH v2 29/92] iio: adc: ti-adc084s021: Fix alignment for DMA safety
Quoted 6 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
____cacheline_alignedis an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updatedIIO_DMA_MINALIGNdefinition.
Quoted 6 lines
Update the comment to include 'may'.
Fixes 3691e5a69449 ("iio: adc: add driver for the ti-adc084s021 chip")Signed-off-by Jonathan Cameron <[email protected]>Cc Mårten Lindahl <[email protected]>Acked-by Nuno Sá <[email protected]>
Quoted 24 lines
--- drivers/iio/adc/ti-adc084s021.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/iio/adc/ti-adc084s021.c +2
-2@@ -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_DMA_MINALIGN) ;__be16 rx_buf[5 ];/* First 16-bits are trash */ };Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 30/92 iio: adc: ti-adc108s102: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN 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.
Note the second alignment marking is likely to be unnecessary, but is left for now to keep this fix simple.
--- drivers/iio/adc/ti-adc108s102.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ti-adc108s102.c +2 -2
@@ -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_DMA_MINALIGN) ; +__be16 tx_buf[9 ]__aligned(IIO_DMA_MINALIGN) ; };#define ADC108S102_V_CHAN (index) \
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 31/92 iio: adc: ti-adc12138: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/ti-adc12138.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-adc12138.c +1 -1
@@ -55,7 +55,7 @@ struct adc12138 {*/ __be16 data[20 ]__aligned(8) ; -u8 tx_buf[2 ]____cacheline_aligned ; +u8 tx_buf[2 ]__aligned(IIO_DMA_MINALIGN) ;u8 rx_buf[2 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 32/92 iio: adc: ti-adc128s052: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/ti-adc128s052.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-adc128s052.c +1 -1
@@ -29,7 +29,7 @@ struct adc128 {struct regulator *reg;struct mutex lock; -u8 buffer[2 ]____cacheline_aligned ; +u8 buffer[2 ]__aligned(IIO_DMA_MINALIGN) ; };static int adc128_adc_conversion (struct adc128 *adc,u8 channel)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 33/92 iio: adc: ti-adc161s626: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/ti-adc161s626.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-adc161s626.c +1 -1
@@ -71,7 +71,7 @@ struct ti_adc_data {u8 read_size;u8 shift; -u8 buffer[16 ]____cacheline_aligned ; +u8 buffer[16 ]__aligned(IIO_DMA_MINALIGN) ; }; static int ti_adc_read_measurement(struct ti_adc_data *data,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 34/92 iio: adc: ti-ads124s08: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/ti-ads124s08.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-ads124s08.c +1 -1
@@ -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_DMA_MINALIGN) ; };#define ADS124S08_CHAN (index) \
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 35/92 iio: adc: ti-ads131e08: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/ti-ads131e08.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-ads131e08.c +1 -1
@@ -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_DMA_MINALIGN) ;/* * Add extra one padding byte to be able to access the last channel * value using u32 pointer
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 36/92 iio: adc: ti-ads7950: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/adc/ti-ads7950.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ti-ads7950.c +2 -2
@@ -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_DMA_MINALIGN) ;u16 tx_buf[TI_ADS7950_MAX_CHAN +2 ];u16 single_tx;u16 single_rx;
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 37/92 iio: adc: ti-ads8344: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/ti-ads8344.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-ads8344.c +1 -1
@@ -28,7 +28,7 @@ struct ads8344 {*/ struct mutex lock; -u8 tx_buf____cacheline_aligned ; +u8 tx_buf__aligned(IIO_DMA_MINALIGN) ;u8 rx_buf[3 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 38/92 iio: adc: ti-ads8688: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/adc/ti-ads8688.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-ads8688.c +1 -1
@@ -71,7 +71,7 @@ struct ads8688_state {union {__be32 d32;u8 d8[4 ]; - } data[2 ]____cacheline_aligned ; + } data[2 ]__aligned(IIO_DMA_MINALIGN) ; };enum ads8688_id {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 39/92 iio: adc: ti-tlc4541: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/adc/ti-tlc4541.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ti-tlc4541.c +2 -2
@@ -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_DMA_MINALIGN) ; };struct tlc4541_chip_info {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 40/92 iio: addac: ad74413r: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/addac/ad74413r.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/addac/ad74413r.c +2 -2
@@ -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_DMA_MINALIGN) ;u8 adc_samples_tx_buf[AD74413R_FRAME_SIZE *AD74413R_CHANNEL_MAX ];u8 reg_tx_buf[AD74413R_FRAME_SIZE ];
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 41/92 iio: amplifiers: ad8366: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/amplifiers/ad8366.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/amplifiers/ad8366.c +2 -2
@@ -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_DMA_MINALIGN) ; };static struct ad8366_info ad8366_infos[] = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 42/92 iio: common: ssp: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/common/ssp_sensors/ssp.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iio/common/ssp_sensors/ssp.h +1 -2
@@ -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_DMA_MINALIGN) ; };void ssp_clean_pending_list (struct ssp_data *data);
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 43/92 iio: dac: ad5064: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/dac/ad5064.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5064.c +2 -2
@@ -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_DMA_MINALIGN) ; };enum ad5064_type {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 44/92 iio: dac: ad5360: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/dac/ad5360.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5360.c +2 -2
@@ -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_DMA_MINALIGN) ; };enum ad5360_type {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 45/92 iio: dac: ad5421: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/dac/ad5421.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5421.c +2 -2
@@ -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_DMA_MINALIGN) ; };static const struct iio_event_spec ad5421_current_event[] = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 46/92 iio: dac: ad5449: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/dac/ad5449.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5449.c +2 -2
@@ -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_DMA_MINALIGN) ; };enum ad5449_type {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 47/92 iio: dac: ad5504: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/dac/ad5504.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5504.c +1 -1
@@ -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_DMA_MINALIGN) ; };/*
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 48/92 iio: dac: ad5592r: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/dac/ad5592r-base.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5592r-base.h +3 -1
@@ -14,6 +14,8 @@#include <linux/mutex.h> #include <linux/gpio/driver.h> +#include <linux/iio/iio.h> +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_DMA_MINALIGN) ;__be16 spi_msg_nop; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 49/92 iio: dac: ad5686: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/dac/ad5686.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5686.h +4 -2
@@ -13,6 +13,8 @@#include <linux/mutex.h> #include <linux/kernel.h> +#include <linux/iio/iio.h> +#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_DMA_MINALIGN) ; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 50/92 iio: dac: ad5755: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/dac/ad5755.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5755.c +2 -2
@@ -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_DMA_MINALIGN) ; };enum ad5755_type {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 51/92 iio: dac: ad5761: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/dac/ad5761.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5761.c +2 -2
@@ -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_DMA_MINALIGN) ; };static const struct ad5761_range_params ad5761_range_params[] = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 52/92 iio: dac: ad5764: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/dac/ad5764.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5764.c +2 -2
@@ -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_DMA_MINALIGN) ; };enum ad5764_type {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 53/92 iio: dac: ad5766: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/dac/ad5766.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5766.c +1 -1
@@ -123,7 +123,7 @@ struct ad5766_state {u32 d32;u16 w16[2 ];u8 b8[4 ]; - } data[3 ]____cacheline_aligned ; + } data[3 ]__aligned(IIO_DMA_MINALIGN) ; };struct ad5766_span_tbl {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 54/92 iio: dac: ad5770r: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/dac/ad5770r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5770r.c +1 -1
@@ -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_DMA_MINALIGN) ; };static const struct regmap_config ad5770r_spi_regmap_config = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 55/92 iio: dac: ad5791: Fix alignment for DMA saftey
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/dac/ad5791.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5791.c +1 -1
@@ -95,7 +95,7 @@ struct ad5791_state {union {__be32 d32;u8 d8[4 ]; - } data[3 ]____cacheline_aligned ; + } data[3 ]__aligned(IIO_DMA_MINALIGN) ; };enum ad5791_supported_device_ids {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 56/92 iio: dac: ad7293: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/dac/ad7293.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad7293.c +1 -1
@@ -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_DMA_MINALIGN) ; };static int ad7293_page_select (struct ad7293_state *st,unsigned int reg)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 57/92 iio: dac: ad7303: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/dac/ad7303.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ad7303.c +2 -2
@@ -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_DMA_MINALIGN) ; }; static int ad7303_write(struct ad7303_state *st, unsigned int chan,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 58/92 iio: dac: ad8801: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/dac/ad8801.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad8801.c +1 -1
@@ -26,7 +26,7 @@ struct ad8801_state {struct regulator *vrefh_reg;struct regulator *vrefl_reg; -__be16 data____cacheline_aligned ; +__be16 data__aligned(IIO_DMA_MINALIGN) ; }; static int ad8801_spi_write(struct ad8801_state *state,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 59/92 iio: dac: ltc2688: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
--- drivers/iio/dac/ltc2688.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ltc2688.c +2 -2
@@ -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_DMA_MINALIGN) ;u8 rx_data[3 ]; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 60/92 iio: dac: mcp4922: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/dac/mcp4922.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/mcp4922.c +1 -1
@@ -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_DMA_MINALIGN) ; };#define MCP4922_CHAN (chan, bits) { \
Signature · 1 line
2.36.0
Re: [PATCH v2 60/92] iio: dac: mcp4922: Fix alignment for DMA safety
Quoted 20 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
____cacheline_alignedis an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updatedIIO_DMA_MINALIGNdefinition.Fixes 1b791fadf3a1 ("iio: dac: mcp4902/mcp4912/mcp4922 dac driver")Signed-off-by Jonathan Cameron <[email protected]>Cc Michael Welling <[email protected]>Acked-by Nuno Sá <[email protected]>--- drivers/iio/dac/mcp4922.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/dac/mcp4922.c +0
-0
drivers/iio/dac/mcp4922.c struct mcp4922_state { · line 32
Quoted 5 lines
drivers/iio/dac/mcp4922.c +1
-1@@ -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_DMA_MINALIGN) ;
Quoted 6 lines
drivers/iio/dac/mcp4922.c +0
-1};#define MCP4922_CHAN (chan, bits) { \ --2.36.0
Jonathan Cameron
maintainerPATCH v2 61/92 iio: dac: ti-dac082s085: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/dac/ti-dac082s085.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ti-dac082s085.c +1 -1
@@ -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_DMA_MINALIGN) ; };#define WRITE_NOT_UPDATE (chan) (0x00 | (chan) << 6)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 62/92 iio: dac: ti-dac5571: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/dac/ti-dac5571.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ti-dac5571.c +1 -1
@@ -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_DMA_MINALIGN) ; };#define DAC5571_POWERDOWN (mode) ((mode) + 1)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 63/92 iio: dac: ti-dac7311: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/dac/ti-dac7311.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ti-dac7311.c +1 -1
@@ -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_DMA_MINALIGN) ; };static u8 ti_dac_get_power (struct ti_dac_chip *ti_dac,bool powerdown)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 64/92 iio: dac: ti-dac7612: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Updated help text to 'may' require buffers to be in their own cacheline.
--- drivers/iio/dac/ti-dac7612.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ti-dac7612.c +2 -2
@@ -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_DMA_MINALIGN) ; };static int dac7612_cmd_single (struct dac7612 *priv,int channel,u16 val)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 65/92 iio: frequency: ad9523: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Updated help text to 'may' require buffers to be in their own cacheline.
--- drivers/iio/frequency/ad9523.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/frequency/ad9523.c +3 -3
@@ -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_DMA_MINALIGN) ; };static int ad9523_read (struct iio_dev *indio_dev,unsigned int addr)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 66/92 iio: frequency: adf4350: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Updated help text to 'may' require buffers to be in their own cacheline.
--- drivers/iio/frequency/adf4350.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/frequency/adf4350.c +3 -3
@@ -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_DMA_MINALIGN) ; };static struct adf4350_platform_data default_pdata = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 67/92 iio: frequency: adf4371: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/frequency/adf4371.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/frequency/adf4371.c +1 -1
@@ -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_DMA_MINALIGN) ; }; static unsigned long long adf4371_pll_fract_n_get_rate(struct adf4371_state *st,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 68/92 iio: frequency: admv1013: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/frequency/admv1013.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/frequency/admv1013.c +1 -1
@@ -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_DMA_MINALIGN) ; }; static int __admv1013_spi_read(struct admv1013_state *st, unsigned int reg,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 69/92 iio: frequency: admv1014: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/frequency/admv1014.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/frequency/admv1014.c +1 -1
@@ -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_DMA_MINALIGN) ; };static const int mixer_vgate_table[] = {106 ,107 ,108 ,110 ,111 ,112 ,113 ,114 ,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 70/92 iio: frequency: admv4420: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/frequency/admv4420.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/frequency/admv4420.c +1 -1
@@ -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_DMA_MINALIGN) ; };static const struct regmap_config admv4420_regmap_config = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 71/92 iio: frequency: adrf6780: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/frequency/adrf6780.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/frequency/adrf6780.c +1 -1
@@ -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_DMA_MINALIGN) ; }; static int __adrf6780_spi_read(struct adrf6780_state *st, unsigned int reg,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 72/92 iio: gyro: adis16080: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Fixes tag is inaccurate but unlikely anyone will backport this beyond that point so I haven't chased the history futher than 2013.
--- drivers/iio/gyro/adis16080.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/gyro/adis16080.c +1 -1
@@ -45,7 +45,7 @@ struct adis16080_state {const struct adis16080_chip_info *info;struct mutex lock; -__be16 buf____cacheline_aligned ; +__be16 buf__aligned(IIO_DMA_MINALIGN) ; }; static int adis16080_read_sample(struct iio_dev *indio_dev,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 73/92 iio: gyro: adis16130: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/gyro/adis16130.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/gyro/adis16130.c +1 -1
@@ -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_DMA_MINALIGN) ; };static int adis16130_spi_read (struct iio_dev *indio_dev,u8 reg_addr,u32 *val)
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 74/92 iio: gyro: adxrs450: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Fixes tag is inaccurate but unlikely anyone will be interested in backporting beyond that point.
--- drivers/iio/gyro/adxrs450.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/gyro/adxrs450.c +1 -1
@@ -73,7 +73,7 @@ enum {struct adxrs450_state {struct spi_device *us;struct mutex buf_lock; -__be32 tx____cacheline_aligned ; +__be32 tx__aligned(IIO_DMA_MINALIGN) ;__be32 rx; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 75/92 iio: gyro: fxas210002c: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
Updated the comment to 'may' require.
--- drivers/iio/gyro/fxas21002c_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/gyro/fxas21002c_core.c +3 -3
@@ -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_DMA_MINALIGN) ; };enum fxas21002c_channel_index {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 76/92 iio: imu: fxos8700: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/imu/fxos8700_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/imu/fxos8700_core.c +1 -1
@@ -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_DMA_MINALIGN) ; };/* Regmap info */
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 77/92 iio: imu: inv_icm42600: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
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_DMA_MINALIGN definition.
--- drivers/iio/imu/inv_icm42600/inv_icm42600.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/imu/inv_icm42600/inv_icm42600.h +1 -1
@@ -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_DMA_MINALIGN) ;struct inv_icm42600_fifo fifo;struct {int64_t gyro;
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 78/92 iio: imu: inv_icm42600: Fix alignment for DMA safety in buffer code.
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
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_DMA_MINALIGN definition.
--- drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h +1 -1
@@ -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_DMA_MINALIGN) ; };/* FIFO data packet */
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 79/92 iio: imu: mpu6050: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +1 -1
@@ -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_DMA_MINALIGN) ; };/*register and associated bit definition*/
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 80/92 iio: potentiometer: ad5110: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/potentiometer/ad5110.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/potentiometer/ad5110.c +2 -2
@@ -63,10 +63,10 @@ struct ad5110_data {struct mutex lock;const struct ad5110_cfg *cfg;/* -* 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 buf[2 ]____cacheline_aligned ; +u8 buf[2 ]__aligned(IIO_DMA_MINALIGN) ; };static const struct iio_chan_spec ad5110_channels[] = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 81/92 iio: potentiometer: ad5272: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/potentiometer/ad5272.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/potentiometer/ad5272.c +1 -1
@@ -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_DMA_MINALIGN) ; };static const struct iio_chan_spec ad5272_channel = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 82/92 iio: potentiometer: max5481: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/potentiometer/max5481.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/potentiometer/max5481.c +1 -1
@@ -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_DMA_MINALIGN) ; };#define MAX5481_CHANNEL { \
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 83/92 iio: potentiometer: mcp41010: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/potentiometer/mcp41010.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/potentiometer/mcp41010.c +1 -1
@@ -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_DMA_MINALIGN) ; };#define MCP41010_CHANNEL (ch) { \
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 84/92 iio: potentiometer: mcp4131: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/potentiometer/mcp4131.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/potentiometer/mcp4131.c +1 -1
@@ -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_DMA_MINALIGN) ; };#define MCP4131_CHANNEL (ch) { \
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 85/92 iio: pressure: dlhl60d: Drop unnecessary alignment forcing.
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
I2C doesn't use the buffers directly for DMA so there is no need to enforce alignment.
--- drivers/iio/pressure/dlhl60d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/pressure/dlhl60d.c +1 -1
@@ -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[] = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 86/92 iio: proximity: as3935: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/proximity/as3935.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/proximity/as3935.c +1 -1
@@ -65,7 +65,7 @@ struct as3935_state {u8 chan;s64 timestamp__aligned(8) ; } scan; -u8 buf[2 ]____cacheline_aligned ; +u8 buf[2 ]__aligned(IIO_DMA_MINALIGN) ; };static const struct iio_chan_spec as3935_channels[] = {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 87/92 iio: proximity: vcnl3020: Drop unnecessary alignment requirement for i2c device
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
I2C does not by default use buffers directly for DMA so there is no need to ensure they are DMA safe.
--- drivers/iio/proximity/vcnl3020.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/proximity/vcnl3020.c +2 -2
@@ -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; };/**
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 88/92 iio: resolver: ad2s1200: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN 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.
--- drivers/iio/resolver/ad2s1200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/resolver/ad2s1200.c +1 -1
@@ -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_DMA_MINALIGN) ; }; static int ad2s1200_read_raw(struct iio_dev *indio_dev,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 89/92 iio: resolver: ad2s90: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN 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.
--- drivers/iio/resolver/ad2s90.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/resolver/ad2s90.c +1 -1
@@ -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_DMA_MINALIGN) ; }; static int ad2s90_read_raw(struct iio_dev *indio_dev,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 90/92 iio: temp: ltc2983: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition.
--- drivers/iio/temperature/ltc2983.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/temperature/ltc2983.c +2 -2
@@ -200,11 +200,11 @@ struct ltc2983_data {u8 num_channels;u8 iio_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. * Holds the converted temperature */ -__be32 temp____cacheline_aligned ; +__be32 temp__aligned(IIO_DMA_MINALIGN) ; };struct ltc2983_sensor {
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 91/92 iio: temp: max31865: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition
--- drivers/iio/temperature/max31865.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/temperature/max31865.c +1 -1
@@ -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_DMA_MINALIGN) ; }; static int max31865_read(struct max31865_data *data, u8 reg,
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerPATCH v2 92/92 iio: temp: maxim_thermocouple: Fix alignment for DMA safety
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition
--- drivers/iio/temperature/maxim_thermocouple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/temperature/maxim_thermocouple.c +1 -1
@@ -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_DMA_MINALIGN) ;char tc_type; };
Signature · 1 line
2.36.0
Jonathan Cameron
maintainerQuoted 1 line · On Sun, 8 May 2022 18:55:40 +0100 Jonathan Cameron <[email protected]> wrote:
From: Jonathan Cameron <[email protected]>
+CC Greg as a heads up.
So I had a little debate with myself on 'how' to apply these and in the end decided to take the slow path on the basis:
1) We haven't actually had a bug report and the problem is only known to be relevant directly to a very small set of platforms (those QC Kryo parts). (I've also so far not applied a Stable cc).
2) I'm nervous about such wide spread changes touching many drivers going in as fixes.
3) Churn and resulting delay to normal patch flow given this will create noise in a lot of drivers.
Anyhow, for now applied to the togreg branch of iio.git which I've pushed out as testing for 0-day to play with it. I'll almost certainly rebase that branch of rc1 once available rather than it's current base of where Linus' tree was when I started today (which happened to have char-misc merged).
All comments welcome as for a few days at least it's easy to modify how these go upstream.
Thanks (particularly to Nuno for going through all these!),
Jonathan
p.s. I'll get around to the same fixes for the few drivers still in staging
sometime in next few weeks.
Quoted 244 lines
Changes since v1:
- RenameIIO_ALIGNto more specificIIO_DMA_MINALIGN
- Fix a few patch descriptions (wrong drive names and such like)
- Fixed a bunch of typos in the intro text in this email (I clearly forgot to spell check that!)
- Stopped removing 'to' in some comment updates. The English is fine either way and this reduces the patch set size.
- Pick up tags (thanks all!)A few bits of feedback I haven't acted on:
- Use of a general kernel define with a generic name.ARCH_DMA_MINALIGNisn't yet available on all architectures, so the use ofIIO_DMA_MINALIGNprovides a good path to fix this now in a fashion that can be easily back ported.
- Adding a define for__aligned(IIO_DMA_MINALIGN). I think that such a define would obscure what was going a little. I couldn't think of a reason we'd want to add anything else across all these locations (which is the other reason we might want such a define).
- Dropping some unnecessary marking of second buffers. I left these alone because explaining why they aren't needed would require additional commentary and is a separate cleanup that can wait for another time.#Many years ago, IIO started using
____cacheline_alignedto ensure that buffers that might be used for DMA were not sharing a cacheline with other data that might lead to DMA safety issues.As it turns out, that was fine at the time, but not based on the correct alignment requirement (though I believe it was a conservative choice at the time). Note that on many architectures this was introducing unnecessary padding. We should have been using
ARCH_KMALLOC_MINALIGNas other subsystems such as crypto have done for a long time.Patch 1 description contains more information but in short, there are ARM64 SoCs out their that have a larger cacheline size for caches beyond L1. In many cases they maintain coherency for all DMA devices attached and so this isn't a problem, but there are exceptions that do not.
So, this is a rather large patch set and just covers those drivers that are in the last kernel release and in
drivers/iio.Many of these drivers are somewhat old so I haven't specifically cc'd anyone so will be relying on those kind enough to sanity check patches on drivers that are beyond their own.
Given there is ongoing discussion around reducing the alignment requirements where possible, I've adopted the existing
IIO_ALIGNdefine throughout. That way we have a single point to update if that becomes relevant in future.Jonathan Cameron (92):
iio: core: FixIIO_ALIGNand rename as it was not sufficiently large
iio: accel: adxl313: Fix alignment for DMA safety
iio: accel: adxl355: Fix alignment for DMA safety
iio: accel: adxl367: Fix alignment for DMA safety
iio: accel: bma220: Fix alignment for DMA safety
iio: accel: bmi088: Fix alignment for DMA safety
iio: accel: sca3000: Fix alignment for DMA safety
iio: accel: sca3300: Fix alignment for DMA safety
iio: adc: ad7266: Fix alignment for DMA safety
iio: adc: ad7280a: Fix alignment for DMA safety
iio: adc: ad7292: Fix alignment for DMA safety
iio: adc: ad7298: Fix alignment for DMA safety
iio: adc: ad7476: Fix alignment for DMA safety
iio: adc: ad7606: Fix alignment for DMA safety
iio: adc: ad7766: Fix alignment for DMA safety
iio: adc: ad7768-1: Fix alignment for DMA safety
iio: adc: ad7887: Fix alignment for DMA safety
iio: adc: ad7923: Fix alignment for DMA safety
iio: adc: ad7949: Fix alignment for DMA safety
iio: adc: hi8435: Fix alignment for DMA safety
iio: adc: ltc2496: Fix alignment for DMA safety
iio: adc: ltc2497: Fix alignment for DMA safety
iio: adc: max1027: Fix alignment for DMA safety
iio: adc: max11100: Fix alignment for DMA safety
iio: adc: max1118: Fix alignment for DMA safety
iio: adc: max1241: Fix alignment for DMA safety
iio: adc: mcp320x: Fix alignment for DMA safety
iio: adc: ti-adc0832: Fix alignment for DMA safety
iio: adc: ti-adc084s021: Fix alignment for DMA safety
iio: adc: ti-adc108s102: Fix alignment for DMA safety
iio: adc: ti-adc12138: Fix alignment for DMA safety
iio: adc: ti-adc128s052: Fix alignment for DMA safety
iio: adc: ti-adc161s626: Fix alignment for DMA safety
iio: adc: ti-ads124s08: Fix alignment for DMA safety
iio: adc: ti-ads131e08: Fix alignment for DMA safety
iio: adc: ti-ads7950: Fix alignment for DMA safety
iio: adc: ti-ads8344: Fix alignment for DMA safety
iio: adc: ti-ads8688: Fix alignment for DMA safety
iio: adc: ti-tlc4541: Fix alignment for DMA safety
iio: addac: ad74413r: Fix alignment for DMA safety
iio: amplifiers: ad8366: Fix alignment for DMA safety
iio: common: ssp: Fix alignment for DMA safety
iio: dac: ad5064: Fix alignment for DMA safety
iio: dac: ad5360: Fix alignment for DMA safety
iio: dac: ad5421: Fix alignment for DMA safety
iio: dac: ad5449: Fix alignment for DMA safety
iio: dac: ad5504: Fix alignment for DMA safety
iio: dac: ad5592r: Fix alignment for DMA safety
iio: dac: ad5686: Fix alignment for DMA safety
iio: dac: ad5755: Fix alignment for DMA safety
iio: dac: ad5761: Fix alignment for DMA safety
iio: dac: ad5764: Fix alignment for DMA safety
iio: dac: ad5766: Fix alignment for DMA safety
iio: dac: ad5770r: Fix alignment for DMA safety
iio: dac: ad5791: Fix alignment for DMA saftey
iio: dac: ad7293: Fix alignment for DMA safety
iio: dac: ad7303: Fix alignment for DMA safety
iio: dac: ad8801: Fix alignment for DMA safety
iio: dac: ltc2688: Fix alignment for DMA safety
iio: dac: mcp4922: Fix alignment for DMA safety
iio: dac: ti-dac082s085: Fix alignment for DMA safety
iio: dac: ti-dac5571: Fix alignment for DMA safety
iio: dac: ti-dac7311: Fix alignment for DMA safety
iio: dac: ti-dac7612: Fix alignment for DMA safety
iio: frequency: ad9523: Fix alignment for DMA safety
iio: frequency: adf4350: Fix alignment for DMA safety
iio: frequency: adf4371: Fix alignment for DMA safety
iio: frequency: admv1013: Fix alignment for DMA safety
iio: frequency: admv1014: Fix alignment for DMA safety
iio: frequency: admv4420: Fix alignment for DMA safety
iio: frequency: adrf6780: Fix alignment for DMA safety
iio: gyro: adis16080: Fix alignment for DMA safety
iio: gyro: adis16130: Fix alignment for DMA safety
iio: gyro: adxrs450: Fix alignment for DMA safety
iio: gyro: fxas210002c: Fix alignment for DMA safety
iio: imu: fxos8700: Fix alignment for DMA safety
iio: imu:inv_icm42600: Fix alignment for DMA safety
iio: imu:inv_icm42600: Fix alignment for DMA safety in buffer code.
iio: imu: mpu6050: Fix alignment for DMA safety
iio: potentiometer: ad5110: Fix alignment for DMA safety
iio: potentiometer: ad5272: Fix alignment for DMA safety
iio: potentiometer: max5481: Fix alignment for DMA safety
iio: potentiometer: mcp41010: Fix alignment for DMA safety
iio: potentiometer: mcp4131: Fix alignment for DMA safety
iio: pressure: dlhl60d: Drop unnecessary alignment forcing.
iio: proximity: as3935: Fix alignment for DMA safety
iio: proximity: vcnl3020: Drop unnecessary alignment requirement for
i2c device
iio: resolver: ad2s1200: Fix alignment for DMA safety
iio: resolver: ad2s90: Fix alignment for DMA safety
iio: temp: ltc2983: Fix alignment for DMA safety
iio: temp: max31865: Fix alignment for DMA safety
iio: temp:maxim_thermocouple: Fix alignment for DMA safetydrivers/iio/accel/adxl313_core.c | 2 +- drivers/iio/accel/adxl355_core.c | 2 +- drivers/iio/accel/adxl367.c | 2 +- drivers/iio/accel/adxl367_spi.c | 8 +++++--- drivers/iio/accel/bma220_spi.c | 2 +- drivers/iio/accel/bmi088-accel-core.c | 2 +- drivers/iio/accel/sca3000.c | 4 ++-- drivers/iio/accel/sca3300.c | 2 +- drivers/iio/adc/ad7266.c | 4 ++-- drivers/iio/adc/ad7280a.c | 2 +- drivers/iio/adc/ad7292.c | 2 +- drivers/iio/adc/ad7298.c | 2 +- drivers/iio/adc/ad7476.c | 5 ++--- drivers/iio/adc/ad7606.h | 4 ++-- drivers/iio/adc/ad7766.c | 5 ++--- drivers/iio/adc/ad7768-1.c | 4 ++-- drivers/iio/adc/ad7887.c | 5 ++--- drivers/iio/adc/ad7923.c | 4 ++-- drivers/iio/adc/ad7949.c | 2 +- drivers/iio/adc/adi-axi-adc.c | 7 ++++--- drivers/iio/adc/hi8435.c | 2 +- drivers/iio/adc/ltc2496.c | 4 ++-- drivers/iio/adc/ltc2497.c | 4 ++-- drivers/iio/adc/max1027.c | 2 +- drivers/iio/adc/max11100.c | 4 ++-- drivers/iio/adc/max1118.c | 2 +- drivers/iio/adc/max1241.c | 2 +- drivers/iio/adc/mcp320x.c | 2 +- drivers/iio/adc/ti-adc0832.c | 2 +- drivers/iio/adc/ti-adc084s021.c | 4 ++-- drivers/iio/adc/ti-adc108s102.c | 4 ++-- drivers/iio/adc/ti-adc12138.c | 2 +- drivers/iio/adc/ti-adc128s052.c | 2 +- drivers/iio/adc/ti-adc161s626.c | 2 +- drivers/iio/adc/ti-ads124s08.c | 2 +- drivers/iio/adc/ti-ads131e08.c | 2 +- drivers/iio/adc/ti-ads7950.c | 4 ++-- drivers/iio/adc/ti-ads8344.c | 2 +- drivers/iio/adc/ti-ads8688.c | 2 +- drivers/iio/adc/ti-tlc4541.c | 4 ++-- drivers/iio/addac/ad74413r.c | 4 ++-- drivers/iio/amplifiers/ad8366.c | 4 ++-- drivers/iio/common/ssp_sensors/ssp.h | 3 +-- drivers/iio/dac/ad5064.c | 4 ++-- drivers/iio/dac/ad5360.c | 4 ++-- drivers/iio/dac/ad5421.c | 4 ++-- drivers/iio/dac/ad5449.c | 4 ++-- drivers/iio/dac/ad5504.c | 2 +- drivers/iio/dac/ad5592r-base.h | 4 +++- drivers/iio/dac/ad5686.h | 6 ++++-- drivers/iio/dac/ad5755.c | 4 ++-- drivers/iio/dac/ad5761.c | 4 ++-- drivers/iio/dac/ad5764.c | 4 ++-- drivers/iio/dac/ad5766.c | 2 +- drivers/iio/dac/ad5770r.c | 2 +- drivers/iio/dac/ad5791.c | 2 +- drivers/iio/dac/ad7293.c | 2 +- drivers/iio/dac/ad7303.c | 4 ++-- drivers/iio/dac/ad8801.c | 2 +- drivers/iio/dac/ltc2688.c | 4 ++-- drivers/iio/dac/mcp4922.c | 2 +- drivers/iio/dac/ti-dac082s085.c | 2 +- drivers/iio/dac/ti-dac5571.c | 2 +- drivers/iio/dac/ti-dac7311.c | 2 +- drivers/iio/dac/ti-dac7612.c | 4 ++-- drivers/iio/frequency/ad9523.c | 6 +++--- drivers/iio/frequency/adf4350.c | 6 +++--- drivers/iio/frequency/adf4371.c | 2 +- drivers/iio/frequency/admv1013.c | 2 +- drivers/iio/frequency/admv1014.c | 2 +- drivers/iio/frequency/admv4420.c | 2 +- drivers/iio/frequency/adrf6780.c | 2 +- drivers/iio/gyro/adis16080.c | 2 +- drivers/iio/gyro/adis16130.c | 2 +- drivers/iio/gyro/adxrs450.c | 2 +- drivers/iio/gyro/fxas21002c_core.c | 6 +++--- drivers/iio/imu/fxos8700_core.c | 2 +- drivers/iio/imu/inv_icm42600/inv_icm42600.h | 2 +- drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h | 2 +- drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 2 +- drivers/iio/industrialio-core.c | 4 ++-- drivers/iio/potentiometer/ad5110.c | 4 ++-- drivers/iio/potentiometer/ad5272.c | 2 +- drivers/iio/potentiometer/max5481.c | 2 +- drivers/iio/potentiometer/mcp41010.c | 2 +- drivers/iio/potentiometer/mcp4131.c | 2 +- drivers/iio/pressure/dlhl60d.c | 2 +- drivers/iio/proximity/as3935.c | 2 +- drivers/iio/proximity/vcnl3020.c | 4 ++-- drivers/iio/resolver/ad2s1200.c | 2 +- drivers/iio/resolver/ad2s90.c | 2 +- drivers/iio/temperature/ltc2983.c | 4 ++-- drivers/iio/temperature/max31865.c | 2 +- drivers/iio/temperature/maxim_thermocouple.c | 2 +- include/linux/iio/iio.h | 10 ++++++++-- 95 files changed, 151 insertions(+), 142 deletions(-)