RE: [PATCH] spi: rzv2h-rspi: Fix DMA transfer error handling for signal interruption
From: Cosmin-Gabriel Tanislav
Date: Mon Jun 29 2026 - 10:33:43 EST
> From: wsa+renesas <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> Sent: Monday, June 29, 2026 1:33 PM
>
>
> > I also think the patch is correct and should be accepted for now.
>
> To bring a broken state into a less but still broken state? I don't
> agree.
I tested what happens both in the timeout case and in the interrupt
case:
In the timeout case, the SPI controller and the DMA controller recover
fine.
In the interrupt case, the SPI controller recovers fine but the DMA
controller does not, because dmaengine_terminate_sync() is not called
and a large DMA transfer does not complete within the 100ms timeout
found inside rz_dmac_device_synchronize().
With this patch applied, interrupt case ends up in the same branch
as the timeout case, which correctly aborts the transfer.
By the way, the mechanism for recovering the SPI controller is handled
by the SPI core, as it calls the .unprepare_message() callback even in
the error case, and the next message re-setups everything correctly.
Please let me know if you still have doubts or if I should go more
in-depth with the explanations.
Reviewed-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@xxxxxxxxxxx>
Tested-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@xxxxxxxxxxx>