From nobody Wed Nov 18 10:24:31 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 4jTyQ75p1lz71JGv for ; Wed, 18 Nov 2026 10:24:31 +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 4jTyQ74gntz4fgK for ; Wed, 18 Nov 2026 10:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794997471; 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=dQDzYfBHsOAyFkO70sW8NM9FeZGCikr0Znf9fcE3PH0=; b=bHOF0MdEgOCac/aU5PVm65hAyw4yJ2WfLBu9VnDdjG+f6c+H7aPMoripazjxk1lN1qTfHI gWDetJQ5u884MmGXcdxQsl5ZmsxS1ohw1T/2UOrEIiBO4RNsQP01OGYR9X4cmka63ELlWj gAx7qI13j39LnSNAWPNiX7OSGVUj7YNjakhBq+fbP9c4yD0zqKga7x0260qx9aub1s36SB IcC1A95MQ5ZlqaHQj/um2owHEJahkBHmF/Dy8CE5r6OV3R9wNJTofQNnPVMikctviSxN+v +tNn/mJZtD2uVWhA2N1qzXeQmPPdMtQCN5p3+jLBfoyy/enGowSkPyxAk/RR0w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794997471; b=CZEAqIa1uUkNRxrYuaqWuRmoJymoPnN5DbmlcB6OLIJ/7G00uRQTENrlBfE+GI8B2FE6OB aepxCv/xmMRSzA/3xG1hnSHnNzssZfehuddEM23kfUblA2bQ41gdYdAoNDJw6uHCIr+Ryf jZ1aWg8LsMlCSI+StTHkC5Aqq0LoIqh6ChYt1AYZrRBTLkW2FtHKlkJsFmT7BXk2fDDql5 3B9DO1ZlMWdSyt1m5pp7Op+z+Fs9xjS9IPlQEeoIxEo9QNgpd9o+C0bKdrP1hevct6JwSC +ytvH+8OiNKQ3YgsVn7AmbmgC4upZhhHkix3n4HkRG3613SKjTqTDaATm5oVqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794997471; 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=dQDzYfBHsOAyFkO70sW8NM9FeZGCikr0Znf9fcE3PH0=; b=OgBqe+res1Awzf2iELyO5oyrsenHlMes5tse+74+OBX/F/gfc8cqMp7oIM00/FVqEpfn/T T9k38ZxNt+MThEN9J5Keay+CIeAr31EoauCD0cMuTp1kF1pDfnLtKgl5pU5THTLxd4KU72 BzHI2UtifN0ndAE61Exo7DKyUByywu19860ZnIkXY91AreXMVGq8RO6HmwjtenU0olLof4 D99R4PQ3sFiTSBr0x9VcfmKi3N83FO8wDEili7D4gfMDAMnDlxgIP8oHjZhwu0/AMlNzPs C6MAMgt5TO8vq47gcb6Tk+3dW9g62NrmVSpYl8u/1DEAe7AMqC1ZYwvGFPxo6g== 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 4jTyQ742jWz1Nnr for ; Wed, 18 Nov 2026 10:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 5504 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 18 Nov 2026 10:24:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: d30ca39517c5 - main - sound: Retire pcm_channel->sleeping 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: d30ca39517c5d23eb16d544d827a19aacd57a999 Auto-Submitted: auto-generated Date: Wed, 18 Nov 2026 10:24:31 +0000 Message-Id: <6afd7cdf.5504.39774e0@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d30ca39517c5d23eb16d544d827a19aacd57a999 commit d30ca39517c5d23eb16d544d827a19aacd57a999 Author: Christos Margiolis AuthorDate: 2026-11-18 10:17:54 +0000 Commit: Christos Margiolis CommitDate: 2026-11-18 10:17:54 +0000 sound: Retire pcm_channel->sleeping This field and the pause_sbt() in pcm_shutdownchans() are redundant now, because pcm_shutdownchans() (previously part of pcm_killchans()) is now only responsible for waking up and stopping the channel, and destroy_dev() will not return until the threads have returned from their cdev methods. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D60121 --- sys/dev/sound/pcm/channel.c | 2 -- sys/dev/sound/pcm/channel.h | 2 -- sys/dev/sound/pcm/sound.c | 33 +++++++++------------------------ 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 63e4788d91ee..11aaa59ebd1c 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -342,9 +342,7 @@ chn_sleep(struct pcm_channel *c, int timeout) if (c->flags & CHN_F_DEAD) return (EINVAL); - c->sleeping++; ret = cv_timedwait_sig(&c->intr_cv, &c->lock, timeout); - c->sleeping--; return ((c->flags & CHN_F_DEAD) ? EINVAL : ret); } diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 32508dab581d..3e50f2714ee8 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -122,8 +122,6 @@ struct pcm_channel { * lock. */ unsigned int inprog; - /* Incrememnt/decrement around cv_timedwait_sig() in chn_sleep(). */ - unsigned int sleeping; /** * Special channel operations should examine @c inprog after acquiring * lock. If zero, operations may continue. Else, thread should diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index a1595dd448f4..6f2d23aed1e7 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -151,37 +151,22 @@ static void pcm_shutdownchans(struct snddev_info *d) { struct pcm_channel *ch; - bool again; PCM_BUSYASSERT(d); KASSERT(!PCM_REGISTERED(d), ("%s(): still registered", __func__)); - for (;;) { - again = false; - /* Make sure all channels are woken up and stopped. */ - CHN_FOREACH(ch, d, channels.pcm) { - CHN_LOCK(ch); - chn_shutdown(ch); - if (ch->inprog == 0 && ch->sleeping == 0 && - CHN_STOPPED(ch)) { - CHN_UNLOCK(ch); - continue; - } - if (ch->direction == PCMDIR_PLAY) - chn_flush(ch); - else - chn_abort(ch); + CHN_FOREACH(ch, d, channels.pcm) { + CHN_LOCK(ch); + chn_shutdown(ch); + if (ch->inprog == 0 && CHN_STOPPED(ch)) { CHN_UNLOCK(ch); - again = true; + continue; } - /* - * Some channels are still active. Sleep for a bit and try - * again. - */ - if (again) - pause_sbt("pcmshutdownchans", mstosbt(5), 0, 0); + if (ch->direction == PCMDIR_PLAY) + chn_flush(ch); else - break; + chn_abort(ch); + CHN_UNLOCK(ch); } }