All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Gu <ustc.gu@gmail.com>
To: Mark Brown <broonie@kernel.org>, Chen-Yu Tsai <wens@kernel.org>,
	 Jernej Skrabec <jernej.skrabec@gmail.com>,
	 Samuel Holland <samuel@sholland.org>
Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	 linux-sunxi@lists.linux.dev, Felix Gu <ustc.gu@gmail.com>
Subject: [PATCH] spi: sun6i: Release TX DMA channel when RX is unavailable
Date: Sat, 21 Nov 2026 00:05:02 +0800	[thread overview]
Message-ID: <20261121-sun6i-v1-1-ce211aace0e8@gmail.com> (raw)

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>


             reply	other threads:[~2026-11-20 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 16:05 Felix Gu [this message]
2026-11-20 16:10 ` [PATCH] spi: sun6i: Release TX DMA channel when RX is unavailable sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261121-sun6i-v1-1-ce211aace0e8@gmail.com \
    --to=ustc.gu@gmail.com \
    --cc=broonie@kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=samuel@sholland.org \
    --cc=wens@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.