From nobody Sun Nov 23 13:50:42 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 4dDr2C16Wnz6H1Cy for ; Sun, 23 Nov 2025 13:50:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dDr2C0BRFz3lhx for ; Sun, 23 Nov 2025 13:50:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763905843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEY2MpQputJqp5fEfPgcRtWIPAHip6QJHm0/1JdtT4Q=; b=y4taoklx45jJ/G+w+uYlGlBAtoyyFre2qTzJIttwLK93bx9Xsawg1qyo62lLROtmB2ISRW UPVL94Bqg6kC5waEzyrzJdckIJzYIcox/xI9tSlr31T9QEtvTQVRcVi+Eupm6JThajBZQf zLnKtNBC2CQ229wRQ+/qufVD7ofoV67NDASkhVvKWynr7gkQFcEr9BX68FjZE7/fekvaHx Qqex8JY49hCVmg/1w7LRzYKKku0JP9LqoH353uuRhtgkahi9PCROpEExU2ocTDAsgdXjOl Zrm+kWSvodjSy2NnZW3MuOCmQaJ5SxcZlrHZCQFIjgiJK528r23X+JTy/CjknQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763905843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEY2MpQputJqp5fEfPgcRtWIPAHip6QJHm0/1JdtT4Q=; b=yPJDkOL/nnNbPhBfd1PcTI/uMOI7Vffe0xW07TSc8LBCEZROtIIcB/kWArEO1u5IXUv5J8 GhozJad+F0vrXhnmO9DxDXg0bRohMOzcj++xV8YlyMsI3UfI0G7E1Vde6E490rSkS0TtRi u8xwVBAsjjWM6cGWvDvgHs31NF0n3GBQ5Znyd56rC0tIsPxjxFZOQaaYUHq9D/5o9E939j sQMRIX/PuNlE0ESqejj95Pkavg9frtINtn7oktIK0OM7eB8R8UgQiKUQ0SLrcXbLchNo1q /SCVKGv6cW4wtCrN1/Vjq87xgX9TwYv9ogNeiECIdc20aI9hi5pPe0Wex3oZ6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763905843; a=rsa-sha256; cv=none; b=kBDYbolCSqqXl5xTigsnyoLiqls1KljntH0f0EQo4azHmWKI/ye0nyYcprhzmd4YD4SvvS EWa99GH3GOZC+saOO18uIDgM0VmhkKqKl/2neOVQnVKgjB49vWGdCAX0waNXBhBoi9AIwR SFAK+gfwpgKFWTAknmnzsKUbGlqtqFJjXf7hraUzqyUE00tYzkhUoT3kUAw129okUVXn69 y5/vrjRxtbIlQmPeGS9buUhwUqfoAmIjkXw4QiZZ7XKHPMpAFqH+AcBVHT/B0pTfM0z7e1 /SAV9uzbfywBJQxw9dLdgXHDWffAiiP3HE+nhoDvUXayrEQiQesKDhL2SabluA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dDr2B6ncHzVZv for ; Sun, 23 Nov 2025 13:50:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26330 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 23 Nov 2025 13:50:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 5cc34a83e1cc - main - Revert "sound: Merge chn_intr() with chn_intr_locked()" 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-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5cc34a83e1cc812871fd02a15b7d9f75342faaa0 Auto-Submitted: auto-generated Date: Sun, 23 Nov 2025 13:50:42 +0000 Message-Id: <69231132.26330.30d762ab@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5cc34a83e1cc812871fd02a15b7d9f75342faaa0 commit 5cc34a83e1cc812871fd02a15b7d9f75342faaa0 Author: Christos Margiolis AuthorDate: 2025-11-23 13:48:51 +0000 Commit: Christos Margiolis CommitDate: 2025-11-23 13:48:51 +0000 Revert "sound: Merge chn_intr() with chn_intr_locked()" It turns out that snd_uaudio(4) uses sound(4)'s channel lock for its USB transfer callbacks. I will try to address this at some point, because this is layering violation, but for now we need to revert the commit, as it causes a lock recursion panic with USB audio devices. This reverts commit e254ef87a30bfcaabc6e4d8e0ecf05f6949a4f06. --- sys/dev/sound/pcm/channel.c | 20 ++++++++++++++++++-- sys/dev/sound/pcm/channel.h | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 011dc1427c2e..7c3f0e3dc9f0 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -581,14 +581,30 @@ chn_read(struct pcm_channel *c, struct uio *buf) } void -chn_intr(struct pcm_channel *c) +chn_intr_locked(struct pcm_channel *c) { - CHN_LOCK(c); + + CHN_LOCKASSERT(c); + c->interrupts++; + if (c->direction == PCMDIR_PLAY) chn_wrintr(c); else chn_rdintr(c); +} + +void +chn_intr(struct pcm_channel *c) +{ + + if (CHN_LOCKOWNED(c)) { + chn_intr_locked(c); + return; + } + + CHN_LOCK(c); + chn_intr_locked(c); CHN_UNLOCK(c); } diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 6415f5c88984..0b17c4a130a7 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -298,6 +298,7 @@ int chn_oss_setorder(struct pcm_channel *, unsigned long long *); int chn_oss_getmask(struct pcm_channel *, uint32_t *); void chn_resetbuf(struct pcm_channel *c); +void chn_intr_locked(struct pcm_channel *c); void chn_intr(struct pcm_channel *c); int chn_abort(struct pcm_channel *c);