aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-loopback-test.c
diff options
context:
space:
mode:
authorVincent Whitchurch <[email protected]>2022-09-16 11:39:48 +0000
committerMark Brown <[email protected]>2022-09-19 14:44:19 +0000
commitb85ad8a54e0a446b3daa7f526e4996ddb6d4373f (patch)
treec32716b46a38be47b3ed776804c0eca3a87cad3e /drivers/spi/spi-loopback-test.c
parentspi: omap2-mcspi: Switch to use dev_err_probe() helper (diff)
downloadkernel-b85ad8a54e0a446b3daa7f526e4996ddb6d4373f.tar.gz
kernel-b85ad8a54e0a446b3daa7f526e4996ddb6d4373f.zip
spi: spi-loopback-test: Add test to trigger DMA/PIO mixing
Add a test where a small and a large transfer in a message hit the same cache line. This test currently fails on spi-s3c64xx on in DMA mode since it ends up mixing DMA and PIO without proper cache maintenance. Signed-off-by: Vincent Whitchurch <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'drivers/spi/spi-loopback-test.c')
-rw-r--r--drivers/spi/spi-loopback-test.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c
index 4d4f77a186a9..dd7de8fa37d0 100644
--- a/drivers/spi/spi-loopback-test.c
+++ b/drivers/spi/spi-loopback-test.c
@@ -313,6 +313,33 @@ static struct spi_test spi_tests[] = {
},
},
},
+ {
+ .description = "three tx+rx transfers with overlapping cache lines",
+ .fill_option = FILL_COUNT_8,
+ /*
+ * This should be large enough for the controller driver to
+ * choose to transfer it with DMA.
+ */
+ .iterate_len = { 512, -1 },
+ .iterate_transfer_mask = BIT(1),
+ .transfer_count = 3,
+ .transfers = {
+ {
+ .len = 1,
+ .tx_buf = TX(0),
+ .rx_buf = RX(0),
+ },
+ {
+ .tx_buf = TX(1),
+ .rx_buf = RX(1),
+ },
+ {
+ .len = 1,
+ .tx_buf = TX(513),
+ .rx_buf = RX(513),
+ },
+ },
+ },
{ /* end of tests sequence */ }
};