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

From: Antonio Quartulli

Date: Thu Feb 26 2026 - 18:15:28 EST


On 26/02/2026 17:46, Alain Volmat wrote:
Hi,

On Tue, Feb 24, 2026 at 04:25:14PM +0100, Antonio Quartulli wrote:
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@xxxxxxxxxxx>
---
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.

I agree that those lines can be removed. However my feeling is that this
is not part of this fix since this is more about removing useless lines.
If this is ok for you I will propose another patch on top of the current
one for that purpose and without the Fixes on it.

I agree.

This fix gets my

Acked-by: Antonio Quartulli <antonio@xxxxxxxxxxxxx>

However, I'd let Mark (the maintainer) decide.

Regards,


--
Antonio Quartulli

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