Skip to contentSkip to conversation

spi: sun6i: Release TX DMA channel when RX is unavailable

PATCH New Felix Gu 2 participants 2 messages Nov 20

Subsystems (2)
lore
Share & tools
lore

Felix Gu

author
#0 lore raw

PATCH 1/1 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

---
 drivers/spi/spi-sun6i.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/spi/spi-sun6i.c +4 -0
index e9fce8618299..f6d1699f1116 100644
@@ -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,

Signature · 1 line
Felix Gu <[email protected]>
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] spi: sun6i: missing Fixes trailer for commit 345980a3a5e5 --

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 <[email protected]>

Quoted 9 lines

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

[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")
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1