Skip to contentSkip to conversation

mmc: Synchronization of in-band SDIO IRQ

DISCUSSION Nemanov, Michael 2 participants 2 messages May 20, 2025 – Jun 19, 2025 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

Hi,

I'm working on a WLAN driver that will use SDIO transport and will support both GPIO and SDIO IRQ sources (only 1 source will be selected at runtime).
During driver cleanup there is a need to synchronize the IRQ handler and guarantee it is no longer running. For GPIO IRQs is trivial via synchronize_irq(). For SDIO IRQs I see no similar option and thinking about possible solution.

Is calling flush_work(host->sdio_irq_work) a reasonable approach here? This can be done either directly from my driver or added as an API in mmc/host.h.

Another solution might be registering with MMC core a minimal handler that only triggers a driver-local work item which can be easily flushed by the driver. Though in that case handling IRQs that are already "in-flight" is a bit more tricky.

Any guidance is much appreciated.

Thanks you and best regards,
Michael.

#1 lore raw
Quoted 10 lines · Michael

Hi,

I'm working on a WLAN driver that will use SDIO transport and will support both GPIO and SDIO IRQ sources (only 1 source will be selected at runtime).
During driver cleanup there is a need to synchronize the IRQ handler and guarantee it is no longer running. For GPIO IRQs is trivial via synchronize_irq(). For SDIO IRQs I see no similar option and thinking about possible solution.

At SDIO func driver (WLAN driver) cleanup?

Quoted 11 lines

Is calling flush_work(host->sdio_irq_work) a reasonable approach here? This can be done either directly from my driver or added as an API in mmc/host.h.

Another solution might be registering with MMC core a minimal handler that only triggers a driver-local work item which can be easily flushed by the driver. Though in that case handling IRQs that are already "in-flight" is a bit more tricky.

Any guidance is much appreciated.

I think the best option to move forward is just to propose something (including a complete solution, not just a change to the mmc core) that seems reasonable to you. Post it to linux-mmc, then we will get the discussion going more easily.

Quoted 3 lines

Thanks you and best regards,
Michael.

Kind regards
Uffe