spi: stm32: fix fifo threshold level in case of short transfer
authorAmelie Delaunay <amelie.delaunay@st.com>
Mon, 10 Aug 2020 07:12:35 +0000 (09:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:31 +0000 (11:29 +0200)
commit0e92f6b422dbf8e82e08f60f16cd1197318769e6
treecca953e1fb75fd2bff84f27808d0c1ca8e3887b5
parent87fb6c0331bc1823af332df2fdad3224312838b9
spi: stm32: fix fifo threshold level in case of short transfer

[ Upstream commit 3373e9004acc0603242622b4378c64bc01d21b5f ]

When transfer is shorter than half of the fifo, set the data packet size
up to transfer size instead of up to half of the fifo.
Check also that threshold is set at least to 1 data frame.

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
Signed-off-by: Alain Volmat <alain.volmat@st.com>
Link: https://lore.kernel.org/r/1597043558-29668-3-git-send-email-alain.volmat@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-stm32.c