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


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

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

Started bybugzilla-noreply@freebsd.org
First post2026-10-10 09:09 +0000
Last post2026-11-13 08:04 +0000
Articles 9 — 1 participant

Back to article view | Back to muc.lists.freebsd.multimedia


Contents

  [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

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

Frombugzilla-noreply@freebsd.org
Date2026-10-10 09:09 +0000
Subject[Bug 299272] snd_hda: devctl_notify() called with HDA driver mutex held on jack change
Message-ID<bug-299272-12827@https.bugs.freebsd.org/bugzilla/>
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

[toc] | [next] | [standalone]


#13534

Frombugzilla-noreply@freebsd.org
Date2026-10-10 18:27 +0000
Message-ID<bug-299272-12827-naqFULn3iG@https.bugs.freebsd.org/bugzilla/>
In reply to#13532
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299272

Mark Linimon <linimon@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|bugs@FreeBSD.org            |multimedia@FreeBSD.org

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee 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

[toc] | [prev] | [next] | [standalone]


#13540

Frombugzilla-noreply@freebsd.org
Date2026-10-14 09:58 +0000
Message-ID<bug-299272-12827-Qtk5gNwUCZ@https.bugs.freebsd.org/bugzilla/>
In reply to#13532
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299272

Christos Margiolis <christos@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|multimedia@FreeBSD.org      |christos@freebsd.org

-- 
You are receiving this mail because:
You are the assignee for the bug.
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

[toc] | [prev] | [next] | [standalone]


#13574

Frombugzilla-noreply@freebsd.org
Date2026-11-03 16:51 +0000
Message-ID<bug-299272-12827-ms4jS8kylb@https.bugs.freebsd.org/bugzilla/>
In reply to#13532
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299272

Christos Margiolis <christos@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |In Progress

-- 
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

[toc] | [prev] | [next] | [standalone]


#13575

Frombugzilla-noreply@freebsd.org
Date2026-11-03 16:51 +0000
Message-ID<bug-299272-12827-aBsthp8eFX@https.bugs.freebsd.org/bugzilla/>
In reply to#13532
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299272

--- Comment #1 from Christos Margiolis <christos@freebsd.org> ---
Related discussion in: https://github.com/freebsd/freebsd-src/pull/2468

-- 
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

[toc] | [prev] | [next] | [standalone]


#13576

Frombugzilla-noreply@freebsd.org
Date2026-11-03 17:14 +0000
Message-ID<bug-299272-12827-0cMNtDeiNP@https.bugs.freebsd.org/bugzilla/>
In reply to#13532
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299272

--- Comment #2 from Christos Margiolis <christos@freebsd.org> ---
Fix submitted for review: https://reviews.freebsd.org/D61161

-- 
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

[toc] | [prev] | [next] | [standalone]


#13578

Frombugzilla-noreply@freebsd.org
Date2026-11-06 08:43 +0000
Message-ID<bug-299272-12827-ty56lKuXNZ@https.bugs.freebsd.org/bugzilla/>
In reply to#13532
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299272

--- Comment #3 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=66d078c17294ca2ea225e4926a8cd9697dda57ed

commit 66d078c17294ca2ea225e4926a8cd9697dda57ed
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-11-03 16:51:08 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-11-06 08:42:37 +0000

    netlink: Pre-register the missing devctl event systems

    devctl_notify() can be called with a mutex held. If the event system is
    not listed in devctl_systems[], sysevent_get_group() calls
    sysevent_new_group(), which calls strdup() with M_WAITOK, and we may end
    up sleeping while holding a non-sleepable mutex.

    Add the missing systems.

    While here, remove the nonexistent KERNEL system.

    PR:             299272
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D61161

 sys/netlink/netlink_sysevent.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
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

[toc] | [prev] | [next] | [standalone]


#13598

Frombugzilla-noreply@freebsd.org
Date2026-11-13 08:03 +0000
Message-ID<bug-299272-12827-NtfWdZTKsx@https.bugs.freebsd.org/bugzilla/>
In reply to#13532
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299272

--- Comment #4 from commit-hook@FreeBSD.org ---
A commit in branch stable/15 references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=03466b1de5f8358db6d60eb9a72b3d121be47e64

commit 03466b1de5f8358db6d60eb9a72b3d121be47e64
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-11-03 16:51:08 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-11-13 08:02:14 +0000

    netlink: Pre-register the missing devctl event systems

    devctl_notify() can be called with a mutex held. If the event system is
    not listed in devctl_systems[], sysevent_get_group() calls
    sysevent_new_group(), which calls strdup() with M_WAITOK, and we may end
    up sleeping while holding a non-sleepable mutex.

    Add the missing systems.

    While here, remove the nonexistent KERNEL system.

    PR:             299272
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D61161

    (cherry picked from commit 66d078c17294ca2ea225e4926a8cd9697dda57ed)

 sys/netlink/netlink_sysevent.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
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

[toc] | [prev] | [next] | [standalone]


#13599

Frombugzilla-noreply@freebsd.org
Date2026-11-13 08:04 +0000
Message-ID<bug-299272-12827-dN0cVReevO@https.bugs.freebsd.org/bugzilla/>
In reply to#13532
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299272

Christos Margiolis <christos@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|In Progress                 |Closed

-- 
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

[toc] | [prev] | [standalone]


Back to top | Article view | muc.lists.freebsd.multimedia


csiph-web