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 11:17:00 +0000 (13:17 +0200)
commit12547ecbc8832a27dfdcbe3ec88702ba5cfba6f6
treeefde8be625056759412f89eb06353da71747d885
parent0fbbe6ac4ddb31232912bc516bce98a72c7f1065
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