Re: [PATCH] ALSA: hda: intel: Don't free card in the probe work

From: Ali Ahmet Memiş

Date: Mon Oct 12 2026 - 10:39:59 EST


On Mon, 12 Oct 2026 09:19:36 +0200, Takashi Iwai wrote:
> For avoiding the card free, can it be the refcounting like below
> instead?

I tried it in QEMU and it hangs on every failed delayed probe even
without a remove. snd_card_free() waits for the release of card_dev,
but the reference taken in azx_probe_work() is dropped only after
azx_probe_continue() returns, so the work never finishes:

kworker/1:1+events:
[<0>] snd_card_free+0x107/0x160
[<0>] azx_probe_work+0x57d/0x1fa0
[<0>] process_one_work+0x937/0x1800
[<0>] worker_thread+0x4ba/0xd20
[<0>] kthread+0x331/0x420

It also doesn't help azx_remove() which reads the card without a
reference before cancel_delayed_work_sync() and frees it again after
the work.

Which user-visible change did you mean? The card now stays until the
device is removed instead of being freed in the work.