All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: sun6i: Release TX DMA channel when RX is unavailable
@ 2026-11-20 16:05 Felix Gu
  2026-11-20 16:10 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Gu @ 2026-11-20 16:05 UTC (permalink / raw)
  To: Mark Brown, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
  Cc: linux-spi, linux-arm-kernel, linux-sunxi, Felix Gu

If requesting the RX DMA channel fails, the controller falls back to PIO
because DMA is enabled only when both channels are available.

Release the TX channel acquired earlier so it is not held unused until
driver removal

Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/spi/spi-sun6i.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c
index e9fce8618299..f6d1699f1116 100644
--- a/drivers/spi/spi-sun6i.c
+++ b/drivers/spi/spi-sun6i.c
@@ -709,6 +709,10 @@ static int sun6i_spi_probe(struct platform_device *pdev)
 		}
 		dev_warn(&pdev->dev, "Failed to request RX DMA channel\n");
 		host->dma_rx = NULL;
+		if (host->dma_tx) {
+			dma_release_channel(host->dma_tx);
+			host->dma_tx = NULL;
+		}
 	}
 
 	if (host->dma_tx && host->dma_rx) {

---
base-commit: adcad7f4e6332cff3d6d7165f41584899f598534
change-id: 20261120-sun6i-53e85a74bce0

Best regards,
--  
Felix Gu <ustc.gu@gmail.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: sun6i: Release TX DMA channel when RX is unavailable
  2026-11-20 16:05 [PATCH] spi: sun6i: Release TX DMA channel when RX is unavailable Felix Gu
@ 2026-11-20 16:10 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-20 16:10 UTC (permalink / raw)
  To: Felix Gu; +Cc: linux-sunxi

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] spi: sun6i: missing Fixes trailer for commit 345980a3a5e5
--

commit a53da7aef94b96fc56cacd8a1daf4ca007f993f9
Author: Felix Gu <ustc.gu@gmail.com>

> spi: sun6i: Release TX DMA channel when RX is unavailable
>
> If requesting the RX DMA channel fails, the controller falls back to PIO
> because DMA is enabled only when both channels are available.
>
> Release the TX channel acquired earlier so it is not held unused until
> driver removal
>
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>

[Severity: Low]
This fixes the PIO fallback path in sun6i_spi_probe().  Should this
include:

  Fixes: 345980a3a5e5 ("spi: spi-sun6i: implement DMA-based transfer mode")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261121-sun6i-v1-1-ce211aace0e8@gmail.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-20 16:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 16:05 [PATCH] spi: sun6i: Release TX DMA channel when RX is unavailable Felix Gu
2026-11-20 16:10 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.