From nobody Thu Nov 20 13:31:45 2025 X-Original-To: dev-commits-src-branches@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 4dBzlk2XX5z6HPNK for ; Thu, 20 Nov 2025 13:31:46 +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 4dBzlj72Znz44VJ for ; Thu, 20 Nov 2025 13:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763645506; 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=PA0acWEGUydKbgpwTqgR6Cst/EAYFJBNM2hAkkTqgbY=; b=i79QhF4v6uEgQkHmrPMSNhKU51VRz0HbLUcFrAdeE9U+d9d5xL8W8xmBxTcJ2NCpjpTmHu gvZy5ToiWbdCfePKIs1YfpU4hCpqAbv/+Uxn8wrC82sR26MphcqXuh99YfyPvctwyZyBIW a+46k3GUgTzHqFew5ZI3XjOWJjAcetBoZcLgq5ydJNqwxSMQOaI06tcjc7RxgIsv+cZ/XJ 26ogwdl3j8WC9tClxKyk/Rj0TOTuzt6gbqB0HMm2XU6zHE5kRAYlFLQObfEgcR2T9ZEZf0 Y6EUB0fXEZmuILEzEU/UdBd2fjswQKr+MxfFKKJYuAdr+NLGqtSSdiVDOc4/xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763645506; 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=PA0acWEGUydKbgpwTqgR6Cst/EAYFJBNM2hAkkTqgbY=; b=ChBEaXgBx0KwyzXl1WwRODzssnQPh6iqNyt146wHqTR3N5sYSoFCTMOmc3i5/B2b3F3BXT i0Di/ZbVA0hJ08eXBOT+aC+LzXBBQoV8Nt1j6YpPcnb0OHuI/p2jzwy6o4h6UzWzBpNQjx K/MGApaXculV37yq4bQNha6jacrrOi4sONb7ReTWjxStBzX0n7niWbmJ09pjiZ81/dFFrw 9sD9YtLWUu8397kF8e2AnLwzBeEPDHFCuk5Wc06hHMUW894H6y8CnvwJsu52NArDVAhhEt jwgD3HttiTbTljwl/pNMqQ2ci6julA6c+BTeq+gT0WIk9LFkZCnqQbcImKKETw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763645506; a=rsa-sha256; cv=none; b=kPjTbv4eF98BiW2VO5kewhZEFwiZU1Jl7eQOdQhAch8CHjLn2L3xgtp9OC5KGyW2y+ygbT FLpNFq5JTYgTwlomfSkt6wikiCbLjKT3JA0Hr9/Nw6AtCZDxKWxTXcQqTvrFhEZ96uf+xN Szq0c4XGhiCarTSRsQQgd/XKTSN7Q5BRSpLalegK7YY7jaxvtZ9/BeKGwYLsvvk1TmD+PM YVxgKx2FdNv2N+XTTjtxbUyOxmxCRdCRsNOlNTMHOZuxuR6BvBGiEuvdWkqenFweDSo+GF ykNpsmvjjZNsRyVAdyU6PkMEZYQnjYw5EanwX4T5c5URY5YTLP8M+l4cBn2t2Q== 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 4dBzlj6dW9zCKZ for ; Thu, 20 Nov 2025 13:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2bd45 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 20 Nov 2025 13:31:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 538df10f545e - stable/15 - sound: Retire SND_DIAGNOSTIC PCM locking macros List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/15 X-Git-Reftype: branch X-Git-Commit: 538df10f545e8e658a7010f7ec6eb9834f1aaf1c Auto-Submitted: auto-generated Date: Thu, 20 Nov 2025 13:31:45 +0000 Message-Id: <691f1841.2bd45.47ed0749@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=538df10f545e8e658a7010f7ec6eb9834f1aaf1c commit 538df10f545e8e658a7010f7ec6eb9834f1aaf1c Author: Christos Margiolis AuthorDate: 2025-11-13 14:35:58 +0000 Commit: Christos Margiolis CommitDate: 2025-11-20 13:28:15 +0000 sound: Retire SND_DIAGNOSTIC PCM locking macros Disabled by default, but also redundant, since most of the errors they catch will be caught anyway by WITNESS and the locking subsystem. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D53735 (cherry picked from commit b19e61f223a1982cce103b9716568391a071892a) --- sys/dev/sound/pcm/sound.h | 103 ---------------------------------------------- 1 file changed, 103 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index c5107d5fba1c..8542a96ccb14 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -251,108 +251,6 @@ int sound_oss_card_info(oss_card_info *); * For PCM_[WAIT | ACQUIRE | RELEASE], be sure to surround these * with PCM_LOCK/UNLOCK() sequence, or I'll come to gnaw upon you! */ -#ifdef SND_DIAGNOSTIC -#define PCM_WAIT(x) do { \ - if (!PCM_LOCKOWNED(x)) \ - panic("%s(%d): [PCM WAIT] Mutex not owned!", \ - __func__, __LINE__); \ - while ((x)->flags & SD_F_BUSY) { \ - if (snd_verbose > 3) \ - device_printf((x)->dev, \ - "%s(%d): [PCM WAIT] calling cv_wait().\n", \ - __func__, __LINE__); \ - cv_wait(&(x)->cv, (x)->lock); \ - } \ -} while (0) - -#define PCM_ACQUIRE(x) do { \ - if (!PCM_LOCKOWNED(x)) \ - panic("%s(%d): [PCM ACQUIRE] Mutex not owned!", \ - __func__, __LINE__); \ - if ((x)->flags & SD_F_BUSY) \ - panic("%s(%d): [PCM ACQUIRE] " \ - "Trying to acquire BUSY cv!", __func__, __LINE__); \ - (x)->flags |= SD_F_BUSY; \ -} while (0) - -#define PCM_RELEASE(x) do { \ - if (!PCM_LOCKOWNED(x)) \ - panic("%s(%d): [PCM RELEASE] Mutex not owned!", \ - __func__, __LINE__); \ - if ((x)->flags & SD_F_BUSY) { \ - (x)->flags &= ~SD_F_BUSY; \ - cv_broadcast(&(x)->cv); \ - } else \ - panic("%s(%d): [PCM RELEASE] Releasing non-BUSY cv!", \ - __func__, __LINE__); \ -} while (0) - -/* Quick version, for shorter path. */ -#define PCM_ACQUIRE_QUICK(x) do { \ - if (PCM_LOCKOWNED(x)) \ - panic("%s(%d): [PCM ACQUIRE QUICK] Mutex owned!", \ - __func__, __LINE__); \ - PCM_LOCK(x); \ - PCM_WAIT(x); \ - PCM_ACQUIRE(x); \ - PCM_UNLOCK(x); \ -} while (0) - -#define PCM_RELEASE_QUICK(x) do { \ - if (PCM_LOCKOWNED(x)) \ - panic("%s(%d): [PCM RELEASE QUICK] Mutex owned!", \ - __func__, __LINE__); \ - PCM_LOCK(x); \ - PCM_RELEASE(x); \ - PCM_UNLOCK(x); \ -} while (0) - -#define PCM_BUSYASSERT(x) do { \ - if (!((x) != NULL && ((x)->flags & SD_F_BUSY))) \ - panic("%s(%d): [PCM BUSYASSERT] " \ - "Failed, snddev_info=%p", __func__, __LINE__, x); \ -} while (0) - -#define PCM_GIANT_ENTER(x) do { \ - int _pcm_giant = 0; \ - if (PCM_LOCKOWNED(x)) \ - panic("%s(%d): [GIANT ENTER] PCM lock owned!", \ - __func__, __LINE__); \ - if (mtx_owned(&Giant) != 0 && snd_verbose > 3) \ - device_printf((x)->dev, \ - "%s(%d): [GIANT ENTER] Giant owned!\n", \ - __func__, __LINE__); \ - if (!((x)->flags & SD_F_MPSAFE) && mtx_owned(&Giant) == 0) \ - do { \ - mtx_lock(&Giant); \ - _pcm_giant = 1; \ - } while (0) - -#define PCM_GIANT_EXIT(x) do { \ - if (PCM_LOCKOWNED(x)) \ - panic("%s(%d): [GIANT EXIT] PCM lock owned!", \ - __func__, __LINE__); \ - if (!(_pcm_giant == 0 || _pcm_giant == 1)) \ - panic("%s(%d): [GIANT EXIT] _pcm_giant screwed!", \ - __func__, __LINE__); \ - if ((x)->flags & SD_F_MPSAFE) { \ - if (_pcm_giant == 1) \ - panic("%s(%d): [GIANT EXIT] MPSAFE Giant?", \ - __func__, __LINE__); \ - if (mtx_owned(&Giant) != 0 && snd_verbose > 3) \ - device_printf((x)->dev, \ - "%s(%d): [GIANT EXIT] Giant owned!\n", \ - __func__, __LINE__); \ - } \ - if (_pcm_giant != 0) { \ - if (mtx_owned(&Giant) == 0) \ - panic("%s(%d): [GIANT EXIT] Giant not owned!", \ - __func__, __LINE__); \ - _pcm_giant = 0; \ - mtx_unlock(&Giant); \ - } \ -} while (0) -#else /* !SND_DIAGNOSTIC */ #define PCM_WAIT(x) do { \ PCM_LOCKASSERT(x); \ while ((x)->flags & SD_F_BUSY) \ @@ -422,7 +320,6 @@ int sound_oss_card_info(oss_card_info *); mtx_unlock(&Giant); \ } \ } while (0) -#endif /* SND_DIAGNOSTIC */ #define PCM_GIANT_LEAVE(x) \ PCM_GIANT_EXIT(x); \