[PATCH] mmc: pxamci: do not complete requests under host spinlock

From: Ahmet Sezgin Duran

Date: Sat Jan 10 2026 - 09:52:00 EST


pxamci_dma_irq calls pxamci_data_done while holding host->lock, but
pxamci_data_done is also called from the IRQ handler without the
lock held and completes MMC requests.

Calling into the MMC core under a spinlock breaks the locking contract
and may lead to re-entrancy issues.

Drop the host lock before completing the request in the DMA error path.

Found by Coverity: CID#1658802

Signed-off-by: Ahmet Sezgin Duran <ahmet@xxxxxxxxxxxxxxx>
---
drivers/mmc/host/pxamci.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index b5ea058ed467..6cf65aca2449 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -551,7 +551,9 @@ static void pxamci_dma_irq(void *param)
pr_err("%s: DMA error on %s channel\n", mmc_hostname(host->mmc),
host->data->flags & MMC_DATA_READ ? "rx" : "tx");
host->data->error = -EIO;
+ spin_unlock_irqrestore(&host->lock, flags);
pxamci_data_done(host, 0);
+ return;
}

out_unlock:
--
2.52.0