Unverified Commit b85ad8a5 authored by Vincent Whitchurch's avatar Vincent Whitchurch Committed by Mark Brown
Browse files

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: default avatarVincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20220916113951.228398-2-vincent.whitchurch@axis.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f4ca8c88
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -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 */ }
};