All of lore.kernel.org
 help / color / mirror / Atom feed
* hda codec unbind refcount hang
@ 2022-09-09 15:45 Ville Syrjälä
  2022-09-09 15:59 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Ville Syrjälä @ 2022-09-09 15:45 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Hi Takashi,

commit 7206998f578d ("ALSA: hda: Fix potential deadlock at codec
unbinding") introduced a problem on at least one of my older machines.

The problem happens when hda_codec_driver_remove() encounters a
codec without any pcms (and thus the refcount is 1) and tries to
call refcount_dec(). Turns out refcount_dec() doesn't like to be
used for dropping the refcount to 0, and instead if spews a warning
and does its saturate thing. The subsequent wait_event() is then
permanently stuck waiting on the saturated refcount.

I've definitely seen the same kind of pattern used elsewhere
in the kernel as well, so the fact that refcount_t can't be used
to implement it is a bit of surprise to me. I guess most other
places still use atomic_t instead.

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-10 11:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-09 15:45 hda codec unbind refcount hang Ville Syrjälä
2022-09-09 15:59 ` Takashi Iwai
2022-09-09 19:39   ` Ville Syrjälä
2022-09-10 10:22     ` Takashi Iwai
2022-09-10 11:54       ` Ville Syrjälä

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.