From nobody Sun Oct 27 16:33:14 2024 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 4Xc2Bf5xxZz5bBsX; Sun, 27 Oct 2024 16:33:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xc2Bf4c1sz4PPk; Sun, 27 Oct 2024 16:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730046794; 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=3fdS7wGyZHhNCWMUjx2RMsZGddYQUiwVEei2JlZ5lMQ=; b=W7jfEDwYF+8pqCj6EZggZROuAUuSm9ARDaO89B/rTbD4miTin2h7Deea9WBl40BlfvY3Kj XvWgW4Qq5GjSWCwPIs2YarldzAi2Ua0bjWibk2Gg2nL4fgMK5MTSjgcbUur2Qv8m3ajwZq PA8quZOdhJKEBUFeld2D4gp+FBV4S3cEktwCQ5Ayef2sX+Hku/lcCuXdvduhU+0ykYan5j WolrkgkK1rcf4TWCQcDeW1+0gHxQV9hW1QtfW71VJYIc9ZBO+7bRJ2F+7AR5MSOylf3f4o FFsewdGn1UzkCY2roqxHTbtM323DL25nlRAxxQMNbuW9Fs39Xsc5JZtyb37aGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730046794; 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=3fdS7wGyZHhNCWMUjx2RMsZGddYQUiwVEei2JlZ5lMQ=; b=E4CyjxEEoTELRZhizrR/dB+PfSrJzUsyWM5IVIIwbqUUOMCs3Stgaw57K1U5AGuGpiMwWU kamDxhYZsMsHCq9cnnBG+zCbRKaK7pBgx7AxCWyDlo9mIDfKNXI4Zj2+A0/G6L6UWSOESL b+V6gNaQhl8eIGggIAMk+uhfhBjxj+3HnHn9uFUXZEjS/OP0Eju3Gvvkz2vv7MGAGVz+cV dY2duc3gv+tgZUz62ajMk0sDxid0h49tnf/B7sf4cC2nh0xfoxA8DyX05GoKynlEiOAroO Xbs294dv+O930xBdtfLhkJjwiO+8G4cTSnREXuNk52g3vBpR38FRoTPAa7eLpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730046794; a=rsa-sha256; cv=none; b=bZWUM36UYpvTJaUAdzpS3KVBKpHwaGv3S+2r0mP2J8JOVf2xoSWabUNH1UwVuL+0LaRhTJ a/FKLuMUfQNtWMhIEtnMSL0vzhCZ7YnLMIfWsC1GrQsmqtDCOuubhjUh3JcK0NaHAihWPa FkQEB2z6DsXWBLmYohuPjxSGWp+cxxNJ7xloC+Tp1oIfkb3j3HrQH9x4Ckp+9sK7lYM6om mXFYyO6HUYetGRG38v/TOvR7gZ0KF4iCyVR7fDKiWLKA4sv7dqHe+wltNfCV436iqHi396 OnRgHnndhjSKfeH8WTejCniZ0soNiIWTN8Gxjy7YHZZQpLEMFOGcS4u0PtZO8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xc2Bf4Cc6z12KB; Sun, 27 Oct 2024 16:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49RGXEBl035567; Sun, 27 Oct 2024 16:33:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49RGXEwX035564; Sun, 27 Oct 2024 16:33:14 GMT (envelope-from git) Date: Sun, 27 Oct 2024 16:33:14 GMT Message-Id: <202410271633.49RGXEwX035564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 6bfac3b2a335 - stable/14 - sound: Retire channel refcount 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 6bfac3b2a335c4fb133f670e7b484ea13072882c Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6bfac3b2a335c4fb133f670e7b484ea13072882c commit 6bfac3b2a335c4fb133f670e7b484ea13072882c Author: Christos Margiolis AuthorDate: 2024-10-25 11:36:59 +0000 Commit: Christos Margiolis CommitDate: 2024-10-27 16:32:30 +0000 sound: Retire channel refcount No longer used. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D47269 (cherry picked from commit 9a6cf27583ffc13bb0a7c5be0704ba0d2f3b834d) --- sys/dev/sound/pcm/channel.c | 13 ------------- sys/dev/sound/pcm/channel.h | 2 -- sys/dev/sound/pcm/dsp.c | 29 ++++------------------------- 3 files changed, 4 insertions(+), 40 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 7bcd841d541f..eb70e910f51d 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1435,19 +1435,6 @@ chn_release(struct pcm_channel *c) return (0); } -int -chn_ref(struct pcm_channel *c, int ref) -{ - PCM_BUSYASSERT(c->parentsnddev); - CHN_LOCKASSERT(c); - KASSERT((c->refcount + ref) >= 0, - ("%s(): new refcount will be negative", __func__)); - - c->refcount += ref; - - return (c->refcount); -} - int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center) diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 6c6692fa8bc2..0788fbe42a5a 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -84,7 +84,6 @@ struct pcm_channel { kobj_t methods; pid_t pid; - int refcount; struct pcm_feeder *feeder; u_int32_t align; @@ -266,7 +265,6 @@ struct pcm_channel *chn_init(struct snddev_info *d, struct pcm_channel *parent, void chn_kill(struct pcm_channel *c); void chn_shutdown(struct pcm_channel *c); int chn_release(struct pcm_channel *c); -int chn_ref(struct pcm_channel *c, int ref); int chn_reset(struct pcm_channel *c, u_int32_t fmt, u_int32_t spd); int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center); diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 7d80a82d31c8..6a59bcfc1ade 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -168,9 +168,9 @@ static void dsp_close(void *data) { struct dsp_cdevpriv *priv = data; - struct pcm_channel *rdch, *wrch, *volch; + struct pcm_channel *rdch, *wrch; struct snddev_info *d; - int sg_ids, rdref, wdref; + int sg_ids; if (priv == NULL) return; @@ -188,22 +188,6 @@ dsp_close(void *data) rdch = priv->rdch; wrch = priv->wrch; - volch = priv->volch; - - rdref = -1; - wdref = -1; - - if (volch != NULL) { - if (volch == rdch) - rdref--; - else if (volch == wrch) - wdref--; - else { - CHN_LOCK(volch); - chn_ref(volch, -1); - CHN_UNLOCK(volch); - } - } if (rdch != NULL) CHN_REMOVE(d, rdch, channels.pcm.opened); @@ -231,7 +215,6 @@ dsp_close(void *data) free_unr(pcmsg_unrhdr, sg_ids); CHN_LOCK(rdch); - chn_ref(rdch, rdref); chn_abort(rdch); /* won't sleep */ rdch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | CHN_F_DEAD | CHN_F_EXCLUSIVE); @@ -249,7 +232,6 @@ dsp_close(void *data) free_unr(pcmsg_unrhdr, sg_ids); CHN_LOCK(wrch); - chn_ref(wrch, wdref); chn_flush(wrch); /* may sleep */ wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | CHN_F_DEAD | CHN_F_EXCLUSIVE); @@ -382,7 +364,6 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) rdch->flags |= CHN_F_NBIO; if (flags & O_EXCL) rdch->flags |= CHN_F_EXCLUSIVE; - chn_ref(rdch, 1); chn_vpc_reset(rdch, SND_VOL_C_PCM, 0); CHN_UNLOCK(rdch); } @@ -402,11 +383,10 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) if (!DSP_F_DUPLEX(flags)) { if (rdch != NULL) { /* - * Lock, deref and release previously - * created record channel + * Lock, and release previously created + * record channel */ CHN_LOCK(rdch); - chn_ref(rdch, -1); chn_release(rdch); } PCM_RELEASE_QUICK(d); @@ -419,7 +399,6 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) wrch->flags |= CHN_F_NBIO; if (flags & O_EXCL) wrch->flags |= CHN_F_EXCLUSIVE; - chn_ref(wrch, 1); chn_vpc_reset(wrch, SND_VOL_C_PCM, 0); CHN_UNLOCK(wrch); }