[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFq0a9VjRFQsk=kU63ULwHtZqmq5ocBFj5=GfHhBo8F5DA@mail.gmail.com>
Date: Thu, 22 Jan 2026 19:03:14 +0100
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Ahmet Sezgin Duran <ahmet@...ginduran.net>
Cc: linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mmc: pxamci: do not complete requests under host spinlock
On Sat, 10 Jan 2026 at 15:44, Ahmet Sezgin Duran <ahmet@...ginduran.net> wrote:
>
> 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@...ginduran.net>
Applied for next and by adding a stable-tag, thanks!
Kind regards
Uffe
> ---
> 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
>
Powered by blists - more mailing lists