mbox series

[0/2] spi: sun6i: fix RX data corruption in DMA mode

Message ID 20230827152558.5368-1-t.schramm@manjaro.org (mailing list archive)
Headers show
Series spi: sun6i: fix RX data corruption in DMA mode | expand

Message

Tobias Schramm Aug. 27, 2023, 3:25 p.m. UTC
Hey folks,

this set of patches fixes two bugs in the sun6i SPI driver that result in
corruption of received data in DMA RX mode.

The first bug seems to be related to an incompatibility of the SPI RX FIFO
with wider than single byte read accesses during SPI transfers. I'm not
sure if this bug affects all types of SPI controllers found in Allwinner
SoCs supported by this driver. However reducing the access width should
always be safe. I've tested this change on a V3s SoC. Further testing to
narrow down the set of affected SoCs in the future would be welcome.

The second bug is a race between SPI RX DMA and FIFO drain logic for
interrupt-based SPI operation. This bug affects all SPI controllers
supported by this driver. Once again this change has been tested on the
Allwinner V3s SoC.

Tobias Schramm (2):
  spi: sun6i: reduce DMA RX transfer width to single byte
  spi: sun6i: fix race between DMA RX transfer completion and RX FIFO
    drain

 drivers/spi/spi-sun6i.c | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

Comments

Mark Brown Sept. 4, 2023, 6:52 p.m. UTC | #1
On Sun, 27 Aug 2023 17:25:56 +0200, Tobias Schramm wrote:
> Hey folks,
> 
> this set of patches fixes two bugs in the sun6i SPI driver that result in
> corruption of received data in DMA RX mode.
> 
> The first bug seems to be related to an incompatibility of the SPI RX FIFO
> with wider than single byte read accesses during SPI transfers. I'm not
> sure if this bug affects all types of SPI controllers found in Allwinner
> SoCs supported by this driver. However reducing the access width should
> always be safe. I've tested this change on a V3s SoC. Further testing to
> narrow down the set of affected SoCs in the future would be welcome.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/2] spi: sun6i: reduce DMA RX transfer width to single byte
      commit: 171f8a49f212e87a8b04087568e1b3d132e36a18
[2/2] spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain
      commit: 1f11f4202caf5710204d334fe63392052783876d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark