spi: s3c64xx: Fix large transfers with DMA
authorVincent Whitchurch <vincent.whitchurch@axis.com>
Tue, 27 Sep 2022 11:21:17 +0000 (13:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:34:47 +0000 (12:34 +0200)
commit432eecffcf1ba5b1a379dbb651d3e820e4ddb928
treea7a9b853cc246e6e7bc6561b47d4e5f3d70fc06b
parent1454a26cb1ab4388dc828a5a6a9abd594372ef40
spi: s3c64xx: Fix large transfers with DMA

[ Upstream commit 1224e29572f655facfcd850cf0f0a4784f36a903 ]

The COUNT_VALUE in the PACKET_CNT register is 16-bit so the maximum
value is 65535.  Asking the driver to transfer a larger size currently
leads to the DMA transfer timing out.  Implement ->max_transfer_size()
and have the core split the transfer as needed.

Fixes: 230d42d422e7 ("spi: Add s3c64xx SPI Controller driver")
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20220927112117.77599-5-vincent.whitchurch@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-s3c64xx.c