Linux-ARM-MSM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral
@ 2020-09-01 15:27 Krzysztof Kozlowski
  2020-09-01 15:27 ` [PATCH 02/11] spi: sprd: Simplify with dev_err_probe() Krzysztof Kozlowski
                   ` (11 more replies)
  0 siblings, 12 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Nicolas Saenz Julienne, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Andy Gross,
	Bjorn Andersson, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Maxime Coquelin, Alexandre Torgue, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi,
	linux-arm-kernel, linux-kernel, linux-rpi-kernel, linux-arm-msm,
	linux-stm32, linux-tegra
  Cc: Krzysztof Kozlowski, stable

If dma_request_chan() for TX channel fails with EPROBE_DEFER, the RX
channel would not be released and on next re-probe it would be requested
second time.

Fixes: 386119bc7be9 ("spi: sprd: spi: sprd: Add DMA mode support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/spi/spi-sprd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c
index 6678f1cbc566..0443fec3a6ab 100644
--- a/drivers/spi/spi-sprd.c
+++ b/drivers/spi/spi-sprd.c
@@ -563,11 +563,11 @@ static int sprd_spi_dma_request(struct sprd_spi *ss)
 
 	ss->dma.dma_chan[SPRD_SPI_TX]  = dma_request_chan(ss->dev, "tx_chn");
 	if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_TX])) {
+		dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]);
 		if (PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]) == -EPROBE_DEFER)
 			return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
 
 		dev_err(ss->dev, "request TX DMA channel failed!\n");
-		dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]);
 		return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
 	}
 
-- 
2.17.1


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

end of thread, back to index

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01 15:27 [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 02/11] spi: sprd: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-08  7:27   ` Chunyan Zhang
2020-09-08 13:22   ` Mark Brown
2020-09-01 15:27 ` [PATCH 03/11] spi: atmel: " Krzysztof Kozlowski
2020-09-01 19:12   ` Alexandre Belloni
2020-09-01 15:27 ` [PATCH 04/11] spi: bcm2835: " Krzysztof Kozlowski
2020-09-01 16:08   ` Florian Fainelli
2020-09-01 15:27 ` [PATCH 05/11] spi: cadence-quadspi: " Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 06/11] spi: spi-mux: " Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 07/11] spi: qcom-qspi: " Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 08/11] spi: stm32: " Krzysztof Kozlowski
2020-09-08 13:53   ` Alain Volmat
2020-09-01 15:27 ` [PATCH 09/11] spi: synquacer: " Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 10/11] spi: tegra114: " Krzysztof Kozlowski
2020-09-01 15:27 ` [PATCH 11/11] spi: tegra20: " Krzysztof Kozlowski
2020-09-08  7:27 ` [PATCH 01/11] spi: sprd: Release DMA channel also on probe deferral Chunyan Zhang
2020-09-08 17:21 ` Mark Brown

Linux-ARM-MSM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-msm/0 linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ https://lore.kernel.org/linux-arm-msm \
		linux-arm-msm@vger.kernel.org
	public-inbox-index linux-arm-msm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arm-msm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git