kernel_optimize_test/include/linux/iio
Lars-Peter Clausen 067d9120a3 iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack
commit 0fb6ee8d0b5e90b72f870f76debc8bd31a742014 upstream.

Use a heap allocated memory for the SPI transfer buffer. Using stack memory
can corrupt stack memory when using DMA on some systems.

This change moves the buffer from the stack of the trigger handler call to
the heap of the buffer of the state struct. The size increases takes into
account the alignment for the timestamp, which is 8 bytes.

The 'data' buffer is split into 'tx_buf' and 'rx_buf', to make a clearer
separation of which part of the buffer should be used for TX & RX.

Fixes: af3008485e ("iio:adc: Add common code for ADI Sigma Delta devices")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201124123807.19717-1-alexandru.ardelean@analog.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:54:19 +01:00
..
accel
adc iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack 2020-12-30 11:54:19 +01:00
common iio: cros_ec: unify hw fifo attributes into the core file 2020-09-29 17:27:07 +01:00
dac
frequency
gyro
imu iio: adis. Drop adis_burst struct 2020-09-21 20:01:45 +01:00
timer
buffer_impl.h
buffer-dma.h
buffer-dmaengine.h iio: buffer-dmaengine: remove non managed alloc/free 2020-09-29 17:27:06 +01:00
buffer.h
configfs.h
consumer.h
driver.h
events.h
hw-consumer.h
iio-opaque.h
iio.h Staging / IIO driver updates for 5.10-rc1 2020-10-15 09:46:23 -07:00
kfifo_buf.h
machine.h
sw_device.h
sw_trigger.h
sysfs.h
trigger_consumer.h iio: Add __printf() attributes to various allocation functions 2020-09-21 18:54:18 +01:00
trigger.h
triggered_buffer.h
triggered_event.h
types.h iio: temperature: mlx90632: Interface to change object ambient temperature 2020-09-13 10:21:37 +01:00