From nobody Wed Nov 18 10:24:40 2026 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 4jTyQJ2xVWz71J64 for ; Wed, 18 Nov 2026 10:24:40 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jTyQJ1Drwz4fds for ; Wed, 18 Nov 2026 10:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794997480; 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=qRjdw+O497a/6NbAyd8P0LQIksExSSOLexp6LJV/2N4=; b=QEeHu4JhpfqEsjt7xr7tt3eKuBxr9dZlZtScuXi3k+zuxsjpz5RkXpyP7g5QmRLua7CDOG foXil8u9CHjnqyR3S9YG5VufV4DA7ge9yOYQybRBBvW7X10jSK3OosAEI42uqUEhkGSvP6 j2aps2Qrs/OdXsfl+k4qt1W4s9eYgRSV9TR6IT2Nw/XvtHtBnmBG7ZpmBSyf8Fz1aiiEwx 74PqzunGVkHp+G07ga6i4/xjVKbyA2qVtfDnRpv9QkYqQCtEPs1YqRZa5iRTlkknufJ8KD nl65/J2+xM7RVY9QQ8dUTp/PnUrG/NLIyQjrZzwKMNcBQf/1i9DsNMAPQfuLhw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794997480; b=EE1mWYteGDP9j5iHmUenDBc6VdKbny1K3wQypId0mDIULfysX9zGq6fOl+GIhJeC1dP33e +GhVlumywxwLEkO5b3U+a9y8HfHIYNnSD3C5yhMeeb6VNagJQwgKQu7jeimMvJjrRU+1NB RzqEYYQ3iLpuJ4KArf/jbQdRtMdfcIzKcr0PweMEWWkGKJOUsC5Nsp2VqL1zeDngM9win+ wtlXY4WLAiTt7vi4uZq2oXnWjEoPpVo986bTMp0T9PLaB7uiV6IVDmEA+zittUZJ06xbJf oKej3g7XR8n2DWaKi6gBE99aXOnnlzN756vo901egBjgs1er0A5DM3vBogJMNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794997480; 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=qRjdw+O497a/6NbAyd8P0LQIksExSSOLexp6LJV/2N4=; b=wrWlpsEa6N6QIXvZIYdMQrzrsrPIb84wCZ7cF3Jao2uVA1pbUDppCUVWlYBQXGYer/McU/ o1PZUKFiG+wj98ZRCZZJz+9F1O3g8iIFe661afsUSP8Ev/18YdcB0BAjnSMoN64GGfGuiW NFQ7aZyDqL6OYGsUNeK78lPeNRmDx/wGsdxU90Mgi+IqU5TPxVM16ww7EVlMX8vQOqjhcX KVWZkmpNnKwKEgdgSa/PPa20MUDp8lCbbUDsRohbz299xWpP/dmaa1o2PTExfz62LS0X81 q7GdEHAMo2OJpW2Wp7RAor8b1YGqwBiqzKBGo+huWOQv6WN9latyq1fvhV+7hQ== 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 4jTyQJ0rzvz1P0f for ; Wed, 18 Nov 2026 10:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4156 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 18 Nov 2026 10:24:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 1cfc55dacd1d - main - sound: Protect channels.pcm.opened with the sx alone List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 1cfc55dacd1d29f3ad4fa110d97af949450b17b3 Auto-Submitted: auto-generated Date: Wed, 18 Nov 2026 10:24:40 +0000 Message-Id: <6afd7ce8.4156.7ca2b46e@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1cfc55dacd1d29f3ad4fa110d97af949450b17b3 commit 1cfc55dacd1d29f3ad4fa110d97af949450b17b3 Author: Christos Margiolis AuthorDate: 2026-11-18 10:20:02 +0000 Commit: Christos Margiolis CommitDate: 2026-11-18 10:20:02 +0000 sound: Protect channels.pcm.opened with the sx alone This list is initialized in pcm_init() and only accessed by dsp_open() and dsp_close(), and we are under sx already, so the PCM_LOCK does not add anything. PCM_LOCK is also held around playcount/reccount reads, which are also under sx now. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D60513 --- sys/dev/sound/pcm/dsp.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 4dfb66075a9b..8fb1df6d5dd1 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -266,7 +266,6 @@ dsp_close(void *data) PCM_GIANT_ENTER(d); PCM_ACQUIRE(d); - PCM_LOCK(d); rdch = priv->rdch; wrch = priv->wrch; @@ -276,8 +275,6 @@ dsp_close(void *data) if (wrch != NULL) CHN_REMOVE(d, wrch, channels.pcm.opened); - PCM_UNLOCK(d); - if (rdch != NULL) { /* * The channel itself need not be locked because: @@ -376,9 +373,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) PCM_GIANT_ENTER(d); - /* Lock snddev so nobody else can monkey with it. */ PCM_ACQUIRE(d); - PCM_LOCK(d); error = 0; if (!DSP_F_VALID(flags)) @@ -417,7 +412,6 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) error = ENOTSUP; } } - PCM_UNLOCK(d); if (error != 0) { PCM_RELEASE(d); @@ -432,9 +426,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) PCM_GIANT_EXIT(d); return (error); } - PCM_LOCK(d); CHN_INSERT_HEAD(d, priv->wrch, channels.pcm.opened); - PCM_UNLOCK(d); } if (DSP_F_READ(flags)) { error = dsp_chn_alloc(d, &priv->rdch, PCMDIR_REC, flags, td); @@ -443,9 +435,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) PCM_GIANT_EXIT(d); return (error); } - PCM_LOCK(d); CHN_INSERT_HEAD(d, priv->rdch, channels.pcm.opened); - PCM_UNLOCK(d); } PCM_RELEASE(d);