* [PATCH] spi: spi-qpic-snand: fix DMA unmapping on probe failure
@ 2026-11-14 17:48 Felix Gu
2026-11-23 18:59 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Felix Gu @ 2026-11-14 17:48 UTC (permalink / raw)
To: Mark Brown, Sricharan Ramabadhran, Varadarajan Narayanan, Md Sadre Alam
Cc: linux-spi, linux-kernel, Felix Gu
The probe error path passes the physical MMIO address to
dma_unmap_resource(). This can differ from the DMA address returned
by dma_map_resource(), causing cleanup to unmap the wrong range
and leave the original mapping allocated.
Use snandc->base_dma to unmap the resource, matching the remove path.
Fixes: 7304d1909080 ("spi: spi-qpic: add driver for QCOM SPI NAND flash Interface")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
drivers/spi/spi-qpic-snand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c
index b03e2e4f0f0b..6cb6e02d2498 100644
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -1668,7 +1668,7 @@ static int qcom_spi_probe(struct platform_device *pdev)
err_spi_init:
qcom_nandc_unalloc(snandc);
err_snand_alloc:
- dma_unmap_resource(dev, res->start, resource_size(res),
+ dma_unmap_resource(dev, snandc->base_dma, resource_size(res),
DMA_BIDIRECTIONAL, 0);
return ret;
}
---
base-commit: 793807ca13bf3072fc6d16ce6d90e9ab9beff2a5
change-id: 20261115-qpic-snand-e9f3ef0a9ca5
Best regards,
--
Felix Gu <ustc.gu@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] spi: spi-qpic-snand: fix DMA unmapping on probe failure
2026-11-14 17:48 [PATCH] spi: spi-qpic-snand: fix DMA unmapping on probe failure Felix Gu
@ 2026-11-23 18:59 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-11-23 18:59 UTC (permalink / raw)
To: Sricharan Ramabadhran, Varadarajan Narayanan, Md Sadre Alam, Felix Gu
Cc: linux-spi, linux-kernel
On Sun, 15 Nov 2026 01:48:42 +0800, Felix Gu wrote:
> spi: spi-qpic-snand: fix DMA unmapping on probe failure
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.5
Thanks!
[1/1] spi: spi-qpic-snand: fix DMA unmapping on probe failure
https://git.kernel.org/broonie/spi/c/4021b62d6f88
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-24 12:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-14 17:48 [PATCH] spi: spi-qpic-snand: fix DMA unmapping on probe failure Felix Gu
2026-11-23 18:59 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®