From nobody Wed May 27 15:33:33 2026 X-Original-To: dev-commits-src-main@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 4gQYYV2VrSz6fCQ2 for ; Wed, 27 May 2026 15:33:34 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gQYYT6yW1z3XZf for ; Wed, 27 May 2026 15:33:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779896014; 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=/FJN1qYPIhRqRLI0kmDtM2JF2tfHha9ZgQosmAnuv8w=; b=hhC9+vMkOk62q+6AhAA0YP1F9BOXKwnMnsS/5e8sEi1CCI3JSkvjwbSzUgJZIBkSBWwv9P WqA3Mh2Dt0pcQOX+GVuFehOEfkPRrPDX7PI4u+liaWGTtlryo/9jkvH1T1bHo02h6UFZlS rNBmDf6LUmtWNFu04BKx7+cS4pXW60hZ99xwoMyNhIPZN27nvfqumbyLIKfAaMM3/U9cLB zwHfsCqwWawOqAHuk4Tf8mIAssSDot8yaHQB2L1RAnQAnKNz9Q29eAddiAX8zjWnPyQtOo zBlQuTmln9r2PO9LVQ1Vk1yE9WTTifGFE+iTOHrBHa/sgEcdm9WvAaD0rp3atg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1779896014; a=rsa-sha256; cv=none; b=SV4AAkntQaVjMCp1Dr3zP1fynZ2oBNONjcnJWXO6+GcxVuYrJx28n4nHaQiCboxXHqqLwb 6avomMsWZBlpvek+Sc4Zkh7XrpWHWaJ805gjcnw/AfvukNNuyRHr2FaishSa6cSdgfkBKV PacfHpO6VZgbsIBeOFPmbo6JIlR2N3AJ3hV/3w6FTo9tVlGPoBNRZnoz0szu8f6dYjnXu6 tuTFNSBkSix0mFuWYUvGA+i+Eu9HX2+HEGc0EcJtdnVEV+GOupX78iJMh2V5AXI4JzFc8T h2Jc5umbkmwqPHFkguk2yw0PTKkZvWKRRzgUWfqKHdfJPErt3iuHAKdw3IOFIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779896014; 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=/FJN1qYPIhRqRLI0kmDtM2JF2tfHha9ZgQosmAnuv8w=; b=gxKd1ARqNIHG0+s2l6js6TcKqpshrcbMshRoYk9JAfUsawJs9/VKZz3qeZq97X+NU2AmTr xs6zcV2SOwgwZXwQJimTzTz8vaQFBZajLU9ElylJGi5LHzbzkJNgriF62iktvSScB4tApn dqQ2D4yKrSHLnDhfddTFoIfHVHgZ0yjIL0LjMg0IVd3O43y9taAKhu/+alx4FIEOZAcG93 B8UkHEe85HsTQmwbvaAnqFKHcE8FVTKnl/LxKfeosWmXswu/zfY0LQEwOg5o/sWHiSItj0 2RKLRS6hTsaVV6SdAGzjFzUL/5yQuPlCYAEnL8nv7XJ/3PxO25gpH+hqSSZfag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gQYYT6KMWz14HC for ; Wed, 27 May 2026 15:33:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 270ca by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 27 May 2026 15:33:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 1e72608a3c6a - main - sound: Remove all remaining uses of mixer_get_lock() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: 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: 1e72608a3c6a60b76938c5ded2a290d0b9ff6456 Auto-Submitted: auto-generated Date: Wed, 27 May 2026 15:33:33 +0000 Message-Id: <6a170ecd.270ca.661b05a@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1e72608a3c6a60b76938c5ded2a290d0b9ff6456 commit 1e72608a3c6a60b76938c5ded2a290d0b9ff6456 Author: Christos Margiolis AuthorDate: 2026-04-16 12:41:13 +0000 Commit: Christos Margiolis CommitDate: 2026-05-27 15:32:12 +0000 sound: Remove all remaining uses of mixer_get_lock() These functions are called from sound(4) through MIXER_SET() in mixer_set(), but nothing mixer-related is used or needs to be locked in these cases. Sponsored by: The FreeBSD Foundation MFC after: 1 week Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/18 --- sys/arm/allwinner/a64/sun50i_a64_acodec.c | 14 -------------- sys/arm64/rockchip/rk3328_codec.c | 14 -------------- sys/dev/sound/macio/onyx.c | 17 ----------------- sys/dev/sound/macio/snapper.c | 17 ----------------- sys/dev/sound/macio/tumbler.c | 17 ----------------- 5 files changed, 79 deletions(-) diff --git a/sys/arm/allwinner/a64/sun50i_a64_acodec.c b/sys/arm/allwinner/a64/sun50i_a64_acodec.c index 12c9a86cf361..93b0328e99e0 100644 --- a/sys/arm/allwinner/a64/sun50i_a64_acodec.c +++ b/sys/arm/allwinner/a64/sun50i_a64_acodec.c @@ -339,19 +339,9 @@ static int a64codec_mixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) { struct a64codec_softc *sc; - struct mtx *mixer_lock; - uint8_t do_unlock; u_int val; sc = device_get_softc(mix_getdevinfo(m)); - mixer_lock = mixer_get_lock(m); - - if (mtx_owned(mixer_lock)) { - do_unlock = 0; - } else { - do_unlock = 1; - mtx_lock(mixer_lock); - } right = left; @@ -375,10 +365,6 @@ a64codec_mixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned ri } A64CODEC_UNLOCK(sc); - if (do_unlock) { - mtx_unlock(mixer_lock); - } - return (left | (right << 8)); } diff --git a/sys/arm64/rockchip/rk3328_codec.c b/sys/arm64/rockchip/rk3328_codec.c index 22e3cde9093e..a019cab27cc9 100644 --- a/sys/arm64/rockchip/rk3328_codec.c +++ b/sys/arm64/rockchip/rk3328_codec.c @@ -416,18 +416,8 @@ static int rkcodec_mixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) { struct rkcodec_softc *sc; - struct mtx *mixer_lock; - uint8_t do_unlock; sc = device_get_softc(mix_getdevinfo(m)); - mixer_lock = mixer_get_lock(m); - - if (mtx_owned(mixer_lock)) { - do_unlock = 0; - } else { - do_unlock = 1; - mtx_lock(mixer_lock); - } right = left; @@ -443,10 +433,6 @@ rkcodec_mixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned rig } RKCODEC_UNLOCK(sc); - if (do_unlock) { - mtx_unlock(mixer_lock); - } - return (left | (right << 8)); } diff --git a/sys/dev/sound/macio/onyx.c b/sys/dev/sound/macio/onyx.c index f4f825a705cc..5ba22dd7c495 100644 --- a/sys/dev/sound/macio/onyx.c +++ b/sys/dev/sound/macio/onyx.c @@ -268,38 +268,21 @@ static int onyx_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) { struct onyx_softc *sc; - struct mtx *mixer_lock; - int locked; uint8_t l, r; sc = device_get_softc(mix_getdevinfo(m)); - mixer_lock = mixer_get_lock(m); - locked = mtx_owned(mixer_lock); switch (dev) { case SOUND_MIXER_VOLUME: - - /* - * We need to unlock the mixer lock because iicbus_transfer() - * may sleep. The mixer lock itself is unnecessary here - * because it is meant to serialize hardware access, which - * is taken care of by the I2C layer, so this is safe. - */ if (left > 100 || right > 100) return (0); l = left + 128; r = right + 128; - if (locked) - mtx_unlock(mixer_lock); - onyx_write(sc, PCM3052_REG_LEFT_ATTN, l); onyx_write(sc, PCM3052_REG_RIGHT_ATTN, r); - if (locked) - mtx_lock(mixer_lock); - return (left | (right << 8)); } diff --git a/sys/dev/sound/macio/snapper.c b/sys/dev/sound/macio/snapper.c index f14009f447a8..ed83990d563b 100644 --- a/sys/dev/sound/macio/snapper.c +++ b/sys/dev/sound/macio/snapper.c @@ -436,14 +436,10 @@ static int snapper_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) { struct snapper_softc *sc; - struct mtx *mixer_lock; - int locked; u_int l, r; u_char reg[6]; sc = device_get_softc(mix_getdevinfo(m)); - mixer_lock = mixer_get_lock(m); - locked = mtx_owned(mixer_lock); if (left > 100 || right > 100) return (0); @@ -460,21 +456,8 @@ snapper_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) reg[4] = (r & 0x00ff00) >> 8; reg[5] = r & 0x0000ff; - /* - * We need to unlock the mixer lock because iicbus_transfer() - * may sleep. The mixer lock itself is unnecessary here - * because it is meant to serialize hardware access, which - * is taken care of by the I2C layer, so this is safe. - */ - - if (locked) - mtx_unlock(mixer_lock); - snapper_write(sc, SNAPPER_VOLUME, reg); - if (locked) - mtx_lock(mixer_lock); - return (left | (right << 8)); } diff --git a/sys/dev/sound/macio/tumbler.c b/sys/dev/sound/macio/tumbler.c index bd40ea6b4f6b..89af4434e7fe 100644 --- a/sys/dev/sound/macio/tumbler.c +++ b/sys/dev/sound/macio/tumbler.c @@ -383,14 +383,10 @@ static int tumbler_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) { struct tumbler_softc *sc; - struct mtx *mixer_lock; - int locked; u_int l, r; u_char reg[6]; sc = device_get_softc(mix_getdevinfo(m)); - mixer_lock = mixer_get_lock(m); - locked = mtx_owned(mixer_lock); switch (dev) { case SOUND_MIXER_VOLUME: @@ -407,21 +403,8 @@ tumbler_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) reg[4] = (r & 0x00ff00) >> 8; reg[5] = r & 0x0000ff; - /* - * We need to unlock the mixer lock because iicbus_transfer() - * may sleep. The mixer lock itself is unnecessary here - * because it is meant to serialize hardware access, which - * is taken care of by the I2C layer, so this is safe. - */ - - if (locked) - mtx_unlock(mixer_lock); - tumbler_write(sc, TUMBLER_VOLUME, reg); - if (locked) - mtx_lock(mixer_lock); - return (left | (right << 8)); }