From nobody Thu Nov 13 14:36:06 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 4d6jWC2Xp3z6Gxqp; Thu, 13 Nov 2025 14:36:07 +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 4d6jWB6dZCz3M77; Thu, 13 Nov 2025 14:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763044566; 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=P5ZVB5BjJhXG3N/AAARdYIUkXuZ9oJYwSe06Ogso6pI=; b=XLuIbri+9tnbbWuocz+jtjLBSpDESPTahXn5ykeUmjbtWSlrHu/nn9qiQoH4B5LlskBwoJ VXDAfjxB2ZAxonS4ACxltj74BUtWYfMiBqwAdN7X48jiL485bV6Dpb3QguSzlGpg1Kbe6g +uNTFbm5mAqXaaNr5wT7re58EFr2JAiDF0dt21fbCAaLkhDvPVE4JgVL3Y1226d/3PUnnY yL2s56Sm+0xMNQN21dQa6vUtT5PPR++xJBXdp0Uaw7/EGL+PRoyhar1euYw5tCrWX37BTr 08lp2UcJS6C6ysKtWPPJdqZqhXetvqCJEUj37sLRFW19dPg5O4GSO+oBGQf4pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763044566; 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=P5ZVB5BjJhXG3N/AAARdYIUkXuZ9oJYwSe06Ogso6pI=; b=cOdFCuTsG3cNrb9IqOICP/yJQhMl4CpJZhAGTa7AT7zDESvVkQfOdykAf+/el30l3QQVuc +0FPlR5CU1B5A2S5vawnc4MaUta6iXBHehSCg5lPSYp5BzYW3H+dGtG/215kb0A36kGkdO DPkJOlZhVZVI1ry9NwcmGElbxLWStSlkE7q02qX6EvYuOI9DeQvQSUG7nZ8CvnGmN4x8CH +PHxqnh/aJRxB7uyy5KXjU56YPrD4MIE6GeX26QgwH64OCaU4z+FfPHoWfs2DxlyhpGRyE gNzKmL+7A+AxnCblM/8a6/A4NwVOVKXjYoBPkLZfo2rb0t/JSzb57b7JE/Y8vg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763044566; a=rsa-sha256; cv=none; b=KhxjMjAmr8lNdxuT/pt7s5GZGKGQlG1yC3fu1isEWv5WvH+5kJBMMG9RVaeQiICIeegxqR bQGEOLq3LeY2VoXpB+JOBs2N5fbFi6f8Fy0iIYZmMvvCvhjBSEgU9p2CiARgAasWw9OKFd cZG/t7p/RX3xIQUtArxQzr9M8oGAQAi7Z0wFgRsxdaDNwVAhFCMuoTIxJYNjPqEiwYAsfu ktIy+WlS325ciCEbDkgqNdrRzkD3LWFA+R9ruwGLNxoKn/M4EgVuJntBnGvfcYCsGfc4WG f9sN7O8vM5KvfSICQyTxijUIeJibgQ8/gBHLKIiOA9bm/IjZYm56UwCO7ktcdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4d6jWB64Wbz95Y; Thu, 13 Nov 2025 14:36:06 +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 5ADEa6QE045757; Thu, 13 Nov 2025 14:36:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5ADEa6KT045754; Thu, 13 Nov 2025 14:36:06 GMT (envelope-from git) Date: Thu, 13 Nov 2025 14:36:06 GMT Message-Id: <202511131436.5ADEa6KT045754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: b19e61f223a1 - main - sound: Retire SND_DIAGNOSTIC PCM locking macros 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: b19e61f223a1982cce103b9716568391a071892a Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=b19e61f223a1982cce103b9716568391a071892a commit b19e61f223a1982cce103b9716568391a071892a Author: Christos Margiolis AuthorDate: 2025-11-13 14:35:58 +0000 Commit: Christos Margiolis CommitDate: 2025-11-13 14:35:58 +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 --- 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); \