iio: mcp320x: Fix occasional incorrect readings
PATCH 1/1 iio: mcp320x: Fix occasional incorrect readings
Without the cacheline alignment, the readings will occasionally incorrectly return 0.
Signed-off-by Michael Welling <[email protected]>
--- drivers/iio/adc/mcp320x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/mcp320x.c +1 -1
@@ -60,7 +60,7 @@ struct mcp320x {struct spi_message msg;struct spi_transfer transfer[2 ]; -u8 tx_buf; +u8 tx_buf____cacheline_aligned ;u8 rx_buf[2 ];struct regulator *reg;
Signature · 1 line
1.7.9.5
Quoted 13 lines · Michael Welling
Without the cacheline alignment, the readings will occasionally incorrectly return 0.
Signed-off-by Michael Welling <[email protected]>--- drivers/iio/adc/mcp320x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/adc/mcp320x.c +0
-0
drivers/iio/adc/mcp320x.c struct mcp320x { · line 64
Quoted 6 lines
drivers/iio/adc/mcp320x.c +1
-1@@ -60,7 +60,7 @@ struct mcp320x {struct spi_message msg;struct spi_transfer transfer[2 ]; -u8 tx_buf; +u8 tx_buf____cacheline_aligned ;u8 rx_buf[2 ];
The buffers should probably be moved at the end, e.g. reg will still be on the same cacheline.
Quoted 2 lines
drivers/iio/adc/mcp320x.c +0
-0struct regulator *reg;