Skip to contentSkip to conversation

spi: cadence-quadspi: fix cleanup of rx_chan on failure paths

PATCH Superseded [email protected] 4 participants 6 messages Jun 30, 2025 – Jul 1, 2025 1 message not in the archive SPI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 spi: cadence-quadspi: fix cleanup of rx_chan on failure paths

From: Khairul Anuar Romli <[email protected]>

Remove incorrect checks on cqspi->rx_chan that cause driver breakage during failure cleanup. Ensure proper resource freeing on the success path when operating in cqspi->use_direct_mode, preventing leaks and improving stability.

---
 drivers/spi/spi-cadence-quadspi.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/spi/spi-cadence-quadspi.c +0 -5
index aa1932ba17cb..d3c78f59b22c 100644
@@ -1960,11 +1960,6 @@ static int cqspi_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(dev);
 
-	if (cqspi->rx_chan) {
-		dma_release_channel(cqspi->rx_chan);
-		goto probe_setup_failed;
-	}
-
 	pm_runtime_set_autosuspend_delay(dev, CQSPI_AUTOSUSPEND_TIMEOUT);
 	pm_runtime_use_autosuspend(dev);
 	pm_runtime_get_noresume(dev);
Signature · 1 line
2.35.3
#2 lore raw

Hello Khairul,

Quoted 8 lines · On 30/06/25 14:41, [email protected] wrote:

From: Khairul Anuar Romli <[email protected]>

Remove incorrect checks on cqspi->rx_chan that cause driver breakage during failure cleanup. Ensure proper resource freeing on the success path when operating in cqspi->use_direct_mode, preventing leaks and improving stability.

Please add 'Fixes' tag and add stable in cc.

Regards,
Santhosh.

Quoted 20 lines
---
  drivers/spi/spi-cadence-quadspi.c | 5 -----
  1 file changed, 5 deletions(-)
drivers/spi/spi-cadence-quadspi.c +0 -5
index aa1932ba17cb..d3c78f59b22c 100644
@@ -1960,11 +1960,6 @@ static int cqspi_probe(struct platform_device *pdev)
 
  	pm_runtime_enable(dev);
 
-	if (cqspi->rx_chan) {
-		dma_release_channel(cqspi->rx_chan);
-		goto probe_setup_failed;
-	}
-
  	pm_runtime_set_autosuspend_delay(dev, CQSPI_AUTOSUSPEND_TIMEOUT);
  	pm_runtime_use_autosuspend(dev);
  	pm_runtime_get_noresume(dev);
Reviewed-by on v1 1/1
#3 lore raw
In reply to [email protected]
Quoted 8 lines · On Mon, Jun 30, 2025 at 05:11:56PM +0800, [email protected] wrote:

From: Khairul Anuar Romli <[email protected]>

Remove incorrect checks on cqspi->rx_chan that cause driver breakage during failure cleanup. Ensure proper resource freeing on the success path when operating in cqspi->use_direct_mode, preventing leaks and improving stability.

Thanks.

Mark asked me to fix this and I wrote a fix but apparently I didn't hit send because it's still in my outbox. Sorry about that. :(

regards,
dan carpenter

#4 lore raw
Quoted 13 lines
Quoted 8 lines · On Mon, Jun 30, 2025 at 05:11:56PM +0800, [email protected] wrote:

From: Khairul Anuar Romli <[email protected]>

Remove incorrect checks on cqspi->rx_chan that cause driver breakage during failure cleanup. Ensure proper resource freeing on the success path when operating in cqspi->use_direct_mode, preventing leaks and improving stability.

Thanks.

Quoted 7 lines

Mark asked me to fix this and I wrote a fix but apparently I didn't hit send because it's still in my outbox. Sorry about that. :(

regards,
dan carpenter

Sorry for sending the fix on your behalf.

#5 lore raw
Quoted 15 lines · Khairul Anuar
Quoted 15 lines
Quoted 8 lines · On Mon, Jun 30, 2025 at 05:11:56PM +0800, [email protected] wrote:

From: Khairul Anuar Romli <[email protected]>

Remove incorrect checks on cqspi->rx_chan that cause driver breakage during failure cleanup. Ensure proper resource freeing on the success path when operating in cqspi->use_direct_mode, preventing leaks and improving stability.

Thanks.

Quoted 7 lines
Quoted 5 lines

Mark asked me to fix this and I wrote a fix but apparently I didn't hit send because it's still in my outbox. Sorry about that. :(

regards,
dan carpenter

Sorry for sending the fix on your behalf.

No no. You did the right thing. It's me who messed up.

regards,
dan carpenter

maintainer
#6 lore raw
In reply to [email protected]
Quoted 6 lines · On Mon, 30 Jun 2025 17:11:56 +0800, [email protected] wrote:

Remove incorrect checks on cqspi->rx_chan that cause driver breakage during failure cleanup. Ensure proper resource freeing on the success path when operating in cqspi->use_direct_mode, preventing leaks and improving stability.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: cadence-quadspi: fix cleanup of rx_chan on failure paths

      commit: 04a8ff1bc3514808481ddebd454342ad902a3f60

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark