Re: [RESEND] mmc: core: Fix system shutdown hang in mmc_bus_shutdown
From: Linus Walleij
Date: Wed Oct 15 2025 - 02:30:26 EST
Hi Michael,
thanks for your patch!
On Wed, Oct 15, 2025 at 8:07 AM Michael Wu <michael@xxxxxxxxxxxxxxxxx> wrote:
> During system shutdown, mmc_bus_shutdown() calls __mmc_stop_host() which
> uses cancel_delayed_work_sync(). This can block indefinitely if the work
> queue is stuck, causing the system to hang during shutdown.
>
> This patch introduces a new function __mmc_stop_host_no_sync() that skips
> the synchronous work cancellation, preventing potential shutdown hangs.
> The function is used in mmc_bus_shutdown() where blocking is not
> acceptable during system shutdown.
>
> Changes:
> - Add __mmc_stop_host_no_sync() function that avoids cancel_delayed_work_sync()
Why is this function prefixed with __two underscores? The
__mmc_stop_host is named like that because there is another
function with the same name, but here is no mmc_stop_host_no_sync()
so just name it without underscores.
Yours,
Linus Walleij