Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > muc.lists.freebsd.multimedia > #13532

[Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change

From bugzilla-noreply@freebsd.org
Newsgroups muc.lists.freebsd.multimedia
Subject [Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change
Date 2026-10-10 09:09 +0000
Organization Newsgate at muc.de e.V.
Message-ID <bug-299272-12827@https.bugs.freebsd.org/bugzilla/> (permalink)

Show all headers | View raw


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299272

            Bug ID: 299272
           Summary: snd_hda: devctl_notify() called with HDA driver mutex
                    held on jack change
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: david@crap.solutions
                CC: christos@freebsd.org, multimedia@FreeBSD.org

Created attachment 275549
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=275549&action=edit
snd_hda: drop the driver lock around jack devctl notifications

hdaa_presence_handler() sends the SND CONN devctl notification while holding
the HDA driver mutex. With sysevent loaded, devctl_notify() can sleep (M_WAITOK
allocation, genetlink sx lock), so WITNESS complains when headphones are
plugged
in or out:

  uma_zalloc_debug: zone "malloc-16" with the following non-sleepable locks
held:
  exclusive sleep mutex hdac1 (HDA driver mutex) r = 0 locked @
sys/dev/sound/pci/hda/hdac.c:1131
  lock order reversal: (sleepable after non-sleepable)
   1st hdac1 (HDA driver mutex, sleep mutex) @
sys/dev/sound/pci/hda/hdac.c:1131
   2nd genetlink lock (genetlink lock, sx) @ sys/netlink/netlink_generic.c:483
  ...
  devctl_notify+0x5e
  hdaa_presence_handler+0x2a0
  hdaa_unsol_intr+0xcd
  hdac_unsolq_task+0x99

Seen on FreeBSD 16.0-CURRENT (GENERIC with WITNESS), ThinkPad T14 Gen 1,
Realtek ALC257, when plugging headphones into the laptop jack.

Fix: drop the driver lock around devctl_notify(), as hdaa_autorecsrc_handler()
already does around mix_setrecsrc(). Patch attached. Tested on the same
machine:
the notifications are still sent (SND CONN OUT cdev=dsp3 / dsp4) and WITNESS no
longer reports anything on plug/unplug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

Back to muc.lists.freebsd.multimedia | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change bugzilla-noreply@freebsd.org - 2026-10-10 09:09 +0000
  [Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change bugzilla-noreply@freebsd.org - 2026-10-10 18:27 +0000
  [Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change bugzilla-noreply@freebsd.org - 2026-10-14 09:58 +0000
  [Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change bugzilla-noreply@freebsd.org - 2026-11-03 16:51 +0000
  [Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change bugzilla-noreply@freebsd.org - 2026-11-03 16:51 +0000
  [Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change bugzilla-noreply@freebsd.org - 2026-11-03 17:14 +0000
  [Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change bugzilla-noreply@freebsd.org - 2026-11-06 08:43 +0000
  [Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change bugzilla-noreply@freebsd.org - 2026-11-13 08:03 +0000
  [Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change bugzilla-noreply@freebsd.org - 2026-11-13 08:04 +0000

csiph-web