Patch "iio: magn: rm3100: Fix alignment of buffer 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: magn: rm3100: Fix alignment of buffer 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-magn-rm3100-fix-alignment-of-buffer-in-iio_push_.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 422c39a2fc017a5898f2c77981cf135ee59b5622
Author: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
Date:   Sun Jun 13 16:22:58 2021 +0100

    iio: magn: rm3100: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()
    
    [ Upstream commit b8f939fd20690623cb24845a563e7bc1e4a21482 ]
    
    Add __aligned(8) to ensure the buffer passed to
    iio_push_to_buffers_with_timestamp() is suitable for the naturally
    aligned timestamp that will be inserted.
    
    Here an explicit structure is not used, because this buffer is used in
    a non-trivial way for data repacking.
    
    Fixes: 121354b2eceb ("iio: magnetometer: Add driver support for PNI RM3100")
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
    Cc: Song Qiang <songqiang1304521@xxxxxxxxx>
    Reviewed-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210613152301.571002-6-jic23@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iio/magnetometer/rm3100-core.c b/drivers/iio/magnetometer/rm3100-core.c
index dd811da9cb6d..934da20781bb 100644
--- a/drivers/iio/magnetometer/rm3100-core.c
+++ b/drivers/iio/magnetometer/rm3100-core.c
@@ -78,7 +78,8 @@ struct rm3100_data {
 	bool use_interrupt;
 	int conversion_time;
 	int scale;
-	u8 buffer[RM3100_SCAN_BYTES];
+	/* Ensure naturally aligned timestamp */
+	u8 buffer[RM3100_SCAN_BYTES] __aligned(8);
 	struct iio_trigger *drdy_trig;
 
 	/*



[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