Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1dbe7dad authored by Alexander Stein's avatar Alexander Stein Committed by Dmitry Torokhov
Browse files

Input: ads7846 - make transfer buffers DMA safe



req.sample needs its own cacheline otherwise accessing req.msg fetches
it in again.

Note: This effect doesn't occur if the underlying SPI driver doesn't use
DMA at all.

Signed-off-by: default avatarAlexander Stein <alexander.stein@systec-electronic.com>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent bf283707
Loading
Loading
Loading
Loading
+10 −2
Original line number Original line Diff line number Diff line
@@ -281,17 +281,25 @@ struct ser_req {
	u8			command;
	u8			command;
	u8			ref_off;
	u8			ref_off;
	u16			scratch;
	u16			scratch;
	__be16			sample;
	struct spi_message	msg;
	struct spi_message	msg;
	struct spi_transfer	xfer[6];
	struct spi_transfer	xfer[6];
	/*
	 * DMA (thus cache coherency maintenance) requires the
	 * transfer buffers to live in their own cache lines.
	 */
	__be16 sample ____cacheline_aligned;
};
};


struct ads7845_ser_req {
struct ads7845_ser_req {
	u8			command[3];
	u8			command[3];
	u8			pwrdown[3];
	u8			pwrdown[3];
	u8			sample[3];
	struct spi_message	msg;
	struct spi_message	msg;
	struct spi_transfer	xfer[2];
	struct spi_transfer	xfer[2];
	/*
	 * DMA (thus cache coherency maintenance) requires the
	 * transfer buffers to live in their own cache lines.
	 */
	u8 sample[3] ____cacheline_aligned;
};
};


static int ads7846_read12_ser(struct device *dev, unsigned command)
static int ads7846_read12_ser(struct device *dev, unsigned command)