From nobody Thu Oct 08 20:44:20 2026 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 4j126F48D2z4n2Wj for ; Thu, 08 Oct 2026 20:44:21 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j126F2BPZz4cHW for ; Thu, 08 Oct 2026 20:44:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791492261; 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=+PzkBhT5jtoPhFFCyIH1u07Od3W4bpv8Z0xSFCwT4J8=; b=H1416EqMOK3mveC++Gu7viP1qrlHsqb3hJxAnkzr1b3wGO91G9YS5TsEhzOYFOIFO1rEdS 14oYHPzqR4LSjVe+4LPeu2YuKaCPjdP+lSg3Gk3e2ycabkxqlvn5QYr/OozaTpAOrjgIHU OXSZ7Hmd3rOSom5uWQD6Bejs65+mWo0b1eXdcE5EfejlygyPnPWDwkxndYPPpZ9h8hsE2q Tz0yMQveqcPWXV+4P51HxwM4EdWpvZJ8vDVPandkg/SU9q/V2FKoKkkTlh1Ie1PxyDoYj1 Z/2lNsGtYqAw33ir9lSgDqw17n30W1/6ATlmDaF1U23N4/w3EdgB9Qd3TVoFjQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791492261; b=QT2U0kAunqb7tKIfUbfvCJ0dwzl+yBwzEG9hx+spuELw6quS9kghhZce5n9axK2Y1TDpy2 CtxsWK7PF4bALaOSdfT1WdJtRfiQgOQXnb20w+oePipGi+wyLc9sle4n/06uUvai1avtQm bHIoX2hZo+Yh8mY/8YNipNFwRW+UeQojeuH5olP3QNSsyrHhsdOAqA15SSNH+1wv+UGcVS tCu96q3s0FIXAF0sYy9HDwq0kDYZr6yFv5Qtuq8NaQoIxYvftnsUVert9DBdRAequgVWvS uZ0x5noYzHvPseN1xZgkCPO2XyO+5xyNzsaVqNyKL7VlNlrLTcssl+txTNBTLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791492261; 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=+PzkBhT5jtoPhFFCyIH1u07Od3W4bpv8Z0xSFCwT4J8=; b=msIu8UmuFU901YymcFSN0DlBgILnlMBW4oRhtfAUtnEJGBbrT31SXEdHb3T8R8iPygyeLL 3fgoRXVjKhTaoT9AMO4FLF4kYc37VI0pYF05NHDXInxPAMYWPnaMeVATnebOdX8l7+qgzM mCgLFHkUihSEos7No8qOsPBgIpx773yUB3lcvyXH8D5gpRKQRG4CXP6349hyfuHpThP3sW 1nCdIAHk5pk+JOZmGdI0p9jmZICSqd0nC8mXuwtP9TD7ZArgKYDRwujvp0XAUr0b/RXwvh QmpM4EZEEzEBDEszDmAl4LLusoax8LtLBYsRtTrFIdpdosah4XIrRJLOSQjprg== 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 4j126D74jWzwmY for ; Thu, 08 Oct 2026 20:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3331f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 08 Oct 2026 20:44:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7ae6593f7a64 - stable/15 - acpi_timer: Remove unneeded acpi_timer_freq global variable 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 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 7ae6593f7a6436a32a17e5f81a71cfdd2d6f0610 Auto-Submitted: auto-generated Date: Thu, 08 Oct 2026 20:44:20 +0000 Message-Id: <6ac800a4.3331f.6c842c07@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7ae6593f7a6436a32a17e5f81a71cfdd2d6f0610 commit 7ae6593f7a6436a32a17e5f81a71cfdd2d6f0610 Author: John Baldwin AuthorDate: 2026-09-30 16:04:59 +0000 Commit: John Baldwin CommitDate: 2026-10-08 20:42:33 +0000 acpi_timer: Remove unneeded acpi_timer_freq global variable This was just an alias of acpi_timer_timecounter.tc_frequency. While here, register the machdep.acpi_timer_freq sysctl node dynamically only if the driver attaches rather than making the handler fail with EOPNOTSUPP if the driver had not attached. Differential Revision: https://reviews.freebsd.org/D59935 (cherry picked from commit 381840e88072a90df7ffb5731c08935412edbc19) --- sys/dev/acpica/acpi_timer.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index b1c1d64cd171..c6d015388f2a 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -59,7 +59,7 @@ static device_t acpi_timer_dev; static struct resource *acpi_timer_reg; static eventhandler_tag acpi_timer_eh; -static u_int acpi_timer_frequency = 14318182 / 4; +#define ACPI_TIMER_FREQUENCY (14318182 / 4) static void acpi_timer_identify(driver_t *driver, device_t parent); static int acpi_timer_probe(device_t dev); @@ -154,7 +154,7 @@ acpi_timer_probe(device_t dev) device_set_descf(dev, "%d-bit timer at %u.%06uMHz", (AcpiGbl_FADT.Flags & ACPI_FADT_32BIT_TIMER) != 0 ? 32 : 24, - acpi_timer_frequency / 1000000, acpi_timer_frequency % 1000000); + ACPI_TIMER_FREQUENCY / 1000000, ACPI_TIMER_FREQUENCY % 1000000); return (0); } @@ -191,10 +191,14 @@ acpi_timer_attach(device_t dev) acpi_timer_timecounter.tc_counter_mask = 0xffffffff; else acpi_timer_timecounter.tc_counter_mask = 0x00ffffff; - acpi_timer_timecounter.tc_frequency = acpi_timer_frequency; + acpi_timer_timecounter.tc_frequency = ACPI_TIMER_FREQUENCY; tc_init(&acpi_timer_timecounter); + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO, + "acpi_timer_freq", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + NULL, 0, acpi_timer_sysctl_freq, "I", "ACPI timer frequency"); + return (0); } @@ -265,19 +269,11 @@ acpi_timer_sysctl_freq(SYSCTL_HANDLER_ARGS) int error; u_int freq; - if (acpi_timer_timecounter.tc_frequency == 0) - return (EOPNOTSUPP); - freq = acpi_timer_frequency; + freq = acpi_timer_timecounter.tc_frequency; error = sysctl_handle_int(oidp, &freq, 0, req); if (error == 0 && req->newptr != NULL) { - acpi_timer_frequency = freq; - acpi_timer_timecounter.tc_frequency = acpi_timer_frequency; + acpi_timer_timecounter.tc_frequency = freq; } return (error); } - -SYSCTL_PROC(_machdep, OID_AUTO, acpi_timer_freq, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, - acpi_timer_sysctl_freq, "I", - "ACPI timer frequency");