From nobody Sun Nov 23 13:50:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dDr2M6gVYz6H160; Sun, 23 Nov 2025 13:50:51 +0000 (UTC) (envelope-from christos@freebsd.org) Received: from margiolis.net (mail.margiolis.net [95.179.159.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4dDr2L5vPmz3m5T; Sun, 23 Nov 2025 13:50:50 +0000 (UTC) (envelope-from christos@freebsd.org) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=default; bh=P6NLkOu+9ckw AHtm4sTgjqZuEW8f5svBVGJw9xJZ08I=; h=in-reply-to:references:from: subject:cc:to:date; d=margiolis.net; b=He+KgbRKVLdkdjHg2iqli9AxH8JcMba rayFu5m7cjl/3j0lNwYfkvok/1Ist0VL3gIkO+4KRvYbcSiJJjZQIt7tt/amEQFt6XpfY6 LGGs2Lf0Yl99kmFDRplrh0+9gsmLx3ATYdyUxcfqtcz3q1H46e3hNX6I9rL4GpI6O6jeOU = Received: from localhost (public-gprs561811.centertel.pl [37.225.57.212]) by margiolis.net (OpenSMTPD) with ESMTPSA id 7d62ac68 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 23 Nov 2025 06:50:48 -0700 (MST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sun, 23 Nov 2025 14:50:47 +0100 Message-Id: To: "Roman Bogorodskiy" Cc: , , Subject: Re: git: e254ef87a30b - main - sound: Merge chn_intr() with chn_intr_locked() From: "Christos Margiolis" X-Mailer: aerc 0.21.0 References: <69209005.3652b.58fc1f99@gitrepo.freebsd.org> In-Reply-To: X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dDr2L5vPmz3m5T On Sun Nov 23, 2025 at 2:34 PM CET, Roman Bogorodskiy wrote: > Christos Margiolis wrote: > >> On Sun Nov 23, 2025 at 7:54 AM CET, Roman Bogorodskiy wrote: >> > Christos Margiolis wrote: >> > >> >> The branch main has been updated by christos: >> >>=20 >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3De254ef87a30bfcaabc6e4d= 8e0ecf05f6949a4f06 >> >>=20 >> >> commit e254ef87a30bfcaabc6e4d8e0ecf05f6949a4f06 >> >> Author: Christos Margiolis >> >> AuthorDate: 2025-11-21 16:14:28 +0000 >> >> Commit: Christos Margiolis >> >> CommitDate: 2025-11-21 16:14:47 +0000 >> >>=20 >> >> sound: Merge chn_intr() with chn_intr_locked() >> >> =20 >> >> There is no scenario where chn_intr() is called with the channel = lock >> >> already held. >> >> =20 >> >> No functional change intended. >> >> =20 >> >> Sponsored by: The FreeBSD Foundation >> >> MFC after: 1 week >> >> Reviewed by: kib, markj >> >> Differential Revision: https://reviews.freebsd.org/D53854 >> >> --- >> >> sys/dev/sound/pcm/channel.c | 20 ++------------------ >> >> sys/dev/sound/pcm/channel.h | 1 - >> >> 2 files changed, 2 insertions(+), 19 deletions(-) >> > >> > With this change my system panics as soon as I start firefox: >> > >> > panic: _mtx_lock_sleep: recursed on non-recursive mutex dsp2.play.0 @ = /usr/src/sys/dev/sound/pcm/channel.c:586 >> > >> > Things work fine again with this commit reverted. >> > >> > Roman >>=20 >> Which driver are you using for your sound card? >>=20 >> Christos > > I'm using snd_uaudio(4). If that's important, I have other pcm devices > as well: > > $ cat /dev/sndstat=20 > Installed devices: > pcm0: (play/rec) > pcm1: (play/rec) > pcm2: (play/rec) default > No devices installed from userspace. > $ dmesg |grep pcm > pcm2 on uaudio0 > pcm0: at nid 20 and 24 on hdaa0 > pcm1: at nid 27 and 26 on hdaa0 > pcm2 on uaudio0 > $=20 > > Roman Oh, right. I just saw snd_uaudio(4) uses the channel lock (the one your panic says we recursed in), to lock the usb transfer callback, which at some point calls chn_intr(). I actually do not like that snd_uaudio(4) uses sound(4)'s locks to do USB stuff. I just reverted the commit, and will look into solving this afterwards. Christos