Re: [RFC PATCH] mmc: tmio: disable dma_issue work before releasing DMA
From: Wolfram Sang
Date: Wed Nov 11 2026 - 06:59:46 EST
On Sun, Nov 01, 2026 at 02:37:39PM +0800, BeaCox wrote:
> tmio_mmc_host_remove() drains done and delayed_reset_work, but leaves
> dma_issue pending or running when it releases the DMA resources. Its
> backend callback accesses the host, controller registers and DMA state.
>
> Disable dma_issue synchronously before releasing DMA. This also rejects
> late queue attempts from an interrupt handler that is still running;
> cancel_work_sync() alone does not provide that guarantee.
>
> Some DMA backends fall back to PIO before initializing dma_issue. Move
> their work initialization ahead of the fallible setup so the work is
> always initialized when a DMA backend is present. Skip the disable call
> when no DMA backend is configured.
>
> The analysis, patch and validation were assisted by OpenAI Codex.
>
> Fixes: 85683fb39d9b ("mmc: sdhi: Convert from tasklet to BH workqueue")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: BeaCox <0xbeac@xxxxxxxxx>
Real name, please.