Patch "iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp()" has been added to the 5.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

to the 5.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iio-adc-mxs-lradc-fix-buffer-alignment-in-iio_push_t.patch
and it can be found in the queue-5.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d2f31d1b290f32336437fb051571bd8cb181a7ec
Author: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
Date:   Sun Jun 13 16:22:56 2021 +0100

    iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
    
    [ Upstream commit 6a6be221b8bd561b053f0701ec752a5ed9007f69 ]
    
    To make code more readable, use a structure to express the channel
    layout and ensure the timestamp is 8 byte aligned.
    Add a comment on why the buffer is the size it is as not immediately
    obvious.
    
    Found during an audit of all calls of this function.
    
    Fixes: 6dd112b9f85e ("iio: adc: mxs-lradc: Add support for ADC driver")
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
    Cc: Andreas Klinger <ak@xxxxxxxxxxxxx>
    Reviewed-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210613152301.571002-4-jic23@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c
index 30e29f44ebd2..c480cb489c1a 100644
--- a/drivers/iio/adc/mxs-lradc-adc.c
+++ b/drivers/iio/adc/mxs-lradc-adc.c
@@ -115,7 +115,8 @@ struct mxs_lradc_adc {
 	struct device		*dev;
 
 	void __iomem		*base;
-	u32			buffer[10];
+	/* Maximum of 8 channels + 8 byte ts */
+	u32			buffer[10] __aligned(8);
 	struct iio_trigger	*trig;
 	struct completion	completion;
 	spinlock_t		lock;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux