From nobody Mon Feb 2 23:51:35 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 4f4k0r5Lncz6QkQ3 for ; Mon, 02 Feb 2026 23:51:40 +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" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f4k0r4Lyzz3Hcv for ; Mon, 02 Feb 2026 23:51:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770076300; 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=6FSTjYp/B9SmEiPrJ9HXwmFHkBteVLC3EASjpIGK/po=; b=yulbXsekGaopH6UsjVscnrh613H5kFVM4H6UJSxJ2m2mZ1GobYGe2WLKsjhzeCf/Lzuvw+ t0wbmzhI5IpMFpV9ADZIcZfOh2FYHXVadWm1Y+HDTgnsg6g90kFxqRdc5mMXYQaE8yXVUb kTqnESqSXVzouJ9jwhlJQA+lmw3f+633wiFup1ZxNuUGSuiPB5sB+rzTYNi38JSqcnjycN wZQ/hokgrPFFw5YXXLIBLNXiWZjuZX2AIjr+U2tFn9ehzGS6e3WEmi8Qxe6Z9Pih5v2SRe TxJ402slKiGTLrz62JrYBrE6Qx0bbOh3gEBemfcka0lDJlUbBCiXdmaFcStWpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770076300; a=rsa-sha256; cv=none; b=hUZck1FgKi7xex9RjK7Hj0I9rEYRoqCBAAY8c1MgV/JPhlayTGuavz+9W05HIiTt/b5qrQ mm7LSKMY35dVcA1Dn2swGQkqHirJLUzlBihDcFx0nJ+SYDevYfVhAXl1AOSM9NsH4yAfhI XfE80rSQlEGXnxZM94CZEZ7OoV0atAd/01gT+Gtq+dkI5VpuqtjkykaZhEsBNpV78bP9Bi U9oTmqXoM05O2s7+LSXyP5dOISl9JG13lCoDRE4DxLtVanB5InHWJJWJuiYIFDXd0uMFJE HcjcLN3w2Mz8RBPVYx9CnBasM0t5ZZjNRRKiR9/DqNjKqu1qzsxo+PAl8be3/g== 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=1770076300; 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=6FSTjYp/B9SmEiPrJ9HXwmFHkBteVLC3EASjpIGK/po=; b=sEb9CmaWAXwEzH7FjvbDJTWrJaZcbSkvF9x2rAZ3q2K1DsKtsUy/OvWRwhwOSOfXA3eUes KFpAMDThuEAnDVzCS7AiqRzC4GAubU7REbNwwnE9Oe2K1tHwZC8qHAi+P0L6tp5oTwXEAH y3IIc2zxkq5eOgkfjgf11dhK3983dDIEEx2LOwEK0zZzbf9dKVSN4bSasiB7HOnzbndTtq i/muSPnsBieFSWgsZ1u7XJ/4B6RVnn3Q/uzVod0Wg3mWS9U78bw7SRIVddOZhxmGUQiQAj uVriceF2RkuHgQmPY7RFq4DWpxM7FAtvyW4XjRk7i59RcyLi4dBeyi2zybUkCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f4k0r3dGzzp9W for ; Mon, 02 Feb 2026 23:51:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2201c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 02 Feb 2026 23:51:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: 4a71fc3b5ceb - main - acpi: Post/pre device suspend/resume eventhandlers 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a71fc3b5cebdf3e6227470d50cf559bab28f26b Auto-Submitted: auto-generated Date: Mon, 02 Feb 2026 23:51:35 +0000 Message-Id: <69813887.2201c.5b0c76e@gitrepo.freebsd.org> The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=4a71fc3b5cebdf3e6227470d50cf559bab28f26b commit 4a71fc3b5cebdf3e6227470d50cf559bab28f26b Author: Aymeric Wibo AuthorDate: 2026-02-02 23:46:44 +0000 Commit: Aymeric Wibo CommitDate: 2026-02-02 23:51:17 +0000 acpi: Post/pre device suspend/resume eventhandlers These eventhandlers are called after suspending the device tree and before resuming it. This is useful for PMC (power management controller) drivers. Reviewed by: olce Approved by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48735 --- sys/dev/acpica/acpi.c | 2 ++ sys/dev/acpica/acpivar.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 6944adafed8e..60a2dba91b05 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -3634,6 +3634,7 @@ acpi_EnterSleepState(struct acpi_softc *sc, enum power_stype stype) device_printf(sc->acpi_dev, "device_suspend failed\n"); goto backout; } + EVENTHANDLER_INVOKE(acpi_post_dev_suspend, stype); slp_state |= ACPI_SS_DEV_SUSPEND; if (stype != POWER_STYPE_SUSPEND_TO_IDLE) { @@ -3683,6 +3684,7 @@ backout: slp_state &= ~ACPI_SS_GPE_SET; } if ((slp_state & ACPI_SS_DEV_SUSPEND) != 0) { + EVENTHANDLER_INVOKE(acpi_pre_dev_resume, stype); DEVICE_RESUME(root_bus); slp_state &= ~ACPI_SS_DEV_SUSPEND; } diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 0ffb9f7c7cc3..eea54178060f 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -482,12 +482,14 @@ UINT32 acpi_event_sleep_button_wake(void *context); #define ACPI_EVENT_PRI_DEFAULT 10000 #define ACPI_EVENT_PRI_LAST 20000 -typedef void (*acpi_event_handler_t)(void *, int); +typedef void (*acpi_event_handler_t)(void *, enum power_stype); EVENTHANDLER_DECLARE(acpi_sleep_event, acpi_event_handler_t); EVENTHANDLER_DECLARE(acpi_wakeup_event, acpi_event_handler_t); EVENTHANDLER_DECLARE(acpi_acad_event, acpi_event_handler_t); EVENTHANDLER_DECLARE(acpi_video_event, acpi_event_handler_t); +EVENTHANDLER_DECLARE(acpi_post_dev_suspend, acpi_event_handler_t); +EVENTHANDLER_DECLARE(acpi_pre_dev_resume, acpi_event_handler_t); /* Device power control. */ ACPI_STATUS acpi_pwr_wake_enable(ACPI_HANDLE consumer, int enable);