aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Poss <knz@thaumogen.net>2025-12-10 20:12:22 +0000
committerWarner Losh <imp@FreeBSD.org>2026-04-24 16:23:06 +0000
commit43b7cf42d425abc84a1313b7eed933438804a051 (patch)
treee8c69d853698f808850049cc76d2bdad9ae9e0fc
parent03a515e9890b0c6844457254e26dc34333b85127 (diff)
speaker(4): drop NEEDGIANT
When the frequency configuration logic was moved to clock.c in 2008, a mutex lock was added there (timer_spkr_setfreq) to serialize accesses to the I/O register. Since then, no more calls to disable/enable_intr were needed in spkr.c than they were needed in the other callers to the same timer_spkr functions in syscons / kern_cons, that is, not at all. This is because there are no other accesses remaining in the kernel to the i8254 timers after boot than through clock.c. For context, see commits e46598588587b4897f6604489364f83fffd4d033 and 93f5134aaf829826dbcbea457bfeb27389761854. Signed-off-by: Raphael Poss <knz@thaumogen.net> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
-rw-r--r--sys/dev/speaker/spkr.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
index 2cdbbd43ff6e..85789c107336 100644
--- a/sys/dev/speaker/spkr.c
+++ b/sys/dev/speaker/spkr.c
@@ -24,7 +24,7 @@ static d_ioctl_t spkrioctl;
static struct cdevsw spkr_cdevsw = {
.d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
+ .d_flags = 0,
.d_open = spkropen,
.d_close = spkrclose,
.d_write = spkrwrite,
@@ -78,10 +78,8 @@ tone(unsigned int thz, unsigned int centisecs)
if (timer_spkr_acquire()) {
return;
}
- disable_intr();
/* Configure the speaker with the tone frequency. */
timer_spkr_setfreq(thz);
- enable_intr();
/*
* Make the current thread sleep while the tone is being