[PATCH] spi: stm32: fix missing pointer assignment in case of dma chaining

Antonio Quartulli antonio at mandelbit.com
Tue Feb 24 07:25:14 PST 2026


Hi,

On 24/02/2026 16:09, Alain Volmat wrote:
> Commit c4f2c05ab029 ("spi: stm32: fix pointer-to-pointer variables usage")
> introduced a regression since dma descriptors generated as part of the
> stm32_spi_prepare_rx_dma_mdma_chaining function are not well propagated
> to the caller function, leading to mdma-dma chaining being no more
> functional.
> 
> Fixes: c4f2c05ab029 ("spi: stm32: fix pointer-to-pointer variables usage")
> Signed-off-by: Alain Volmat <alain.volmat at foss.st.com>
> ---
>   drivers/spi/spi-stm32.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index b99de8c4cc99..33f211e159ef 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -1625,6 +1625,9 @@ static int stm32_spi_prepare_rx_dma_mdma_chaining(struct stm32_spi *spi,
>   		return -EINVAL;
>   	}
>   
> +	*rx_mdma_desc = _mdma_desc;
> +	*rx_dma_desc = _dma_desc;
> +

Thanks for catching this!

Indeed my fix lost the pointer-to-pointer logic, which was needed to 
pass back the computed values.

This patch looks good, but at this point I think you can also remove the 
lines:

	_dma_desc = NULL;

in the error paths above? Setting them to NULL makes no sense as they 
are not going anywhere.

Regards,



-- 
Antonio Quartulli

CEO and Co-Founder
Mandelbit Srl
https://www.mandelbit.com




More information about the linux-arm-kernel mailing list