From nobody Tue Feb 6 09:41:51 2024 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 4TTdYq5crwz595FT; Tue, 6 Feb 2024 09:41:51 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TTdYq57wwz45dj; Tue, 6 Feb 2024 09:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707212511; 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=MCf3tFQyD3Ac43jQ/Piu/3YDieTlRxlZ3ZrYlF7TajU=; b=pORyCexaFazsq5dwEaZmudG2qZLfr0ebP6EmISParZ3G4WH2abbjDf131aJ5rGZSCHjgIW mXoNfbe7skk+4PktBb0vuz1jTsp6hUl3lKXyzF1ng49FDaOzxdPavkCLrC1zpBOGNEog8f wJ05ySE1sRboYDd62e2NSx3iPUx3OBZ0hiFVld/hShyGruU2Lk/wSQErtiaB86FbsFPXJI bd4G+JqfF6pxY0KmQt+P8tGUTmJXke96QF5ScTNQxT4aKk8mZ4Sosv/xyPoZW4SL8Xj9BC pmc8rsSUteFiXHyj66n8oe3Ia0Cglizjxdu1J8tNyr8OW+E1Sz/Jhcp+BIvVGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707212511; 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=MCf3tFQyD3Ac43jQ/Piu/3YDieTlRxlZ3ZrYlF7TajU=; b=Ht414OBqLCA6y3yzsfvJjK929fdCrTQYOrWnA/EQjwS8PRekPSIwLwftUsrA8tMmyoGK35 1/9SiwxBQphV1oVXD5/1SmzYBTWoAnnxubSgJLfHRzEGKWPEouYW+BVlq2olLjetfnl8cx NQ5YmwGn5O6mWg/bMs1Had10APkvUP+HVOqhtIglCdxbE9lCkj2KC/ofxOZbcj0DKwNz+4 0TI7smYoDCPvHUt5jSBfwvR7LhIDkeSc6hZz/LOB2mvf1NQ7d+LZ/Xc/Nk8qVE8eksQLJv wRTjmla8vaUVK7PbOjLaoo99zUD6Dv13Dw5FE3Ne0jvtiSfLt6E97aviU02nBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707212511; a=rsa-sha256; cv=none; b=wAUnP6CbbajB4y8FoPDc/ld1R18jwCQblO/JMvuN4C+2Xd1dqui3YoNbder4xjFsw0Wki9 gagQSriiKciLIomOU/rsbG3ki9joRi4dwByaSG6ZQGWLYOtBcR0iVcQe0bKKTwe85IGLYC 6/d2JaTExJfMjMtp3oBhfbLK2Pp2nkW0IMRzK3YDAi3mg1VSQK4aWNv7eirkxPMqVyEJIZ l1v2cNTtU9w67s8hehrIgjKlQEk5swqg6eCojBZi3+JmMDjkXCadSQ5cdb4YbBNqMWofdm SrBmOIudHxygBbaUxY3Gp+oON0WNbpgRFzk1zH3RzIX4DmVij0LnWpE47cs7rA== 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 4TTdYq4BnYzJCQ; Tue, 6 Feb 2024 09:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4169fpPK092975; Tue, 6 Feb 2024 09:41:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4169fpXE092972; Tue, 6 Feb 2024 09:41:51 GMT (envelope-from git) Date: Tue, 6 Feb 2024 09:41:51 GMT Message-Id: <202402060941.4169fpXE092972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: e4ab361e5394 - main - fix poweroff regression from 9cdf326b4f by delaying shutdown_halt 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4ab361e53945a6c3e9d68c5e5ffc11de40a35f2 Auto-Submitted: auto-generated The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=e4ab361e53945a6c3e9d68c5e5ffc11de40a35f2 commit e4ab361e53945a6c3e9d68c5e5ffc11de40a35f2 Author: Andriy Gapon AuthorDate: 2024-02-06 08:55:13 +0000 Commit: Andriy Gapon CommitDate: 2024-02-06 08:55:13 +0000 fix poweroff regression from 9cdf326b4f by delaying shutdown_halt The regression affected ACPI-based systems without EFI poweroff support (including VMs). The key reason for the regression is that I overlooked that poweroff is requested by RB_POWEROFF | RB_HALT combination of flags. In my opinion, that command is a bit bipolar, but since we've been doing that forever, then so be it. Because of that flag combination, the order of shutdown_final handlers that check for either flag does matter. Some additional complexity comes from platform-specific shutdown_final handlers that aim to handle multiple reboot options at once. E.g., acpi_shutdown_final handles both poweroff and reboot / reset. As explained in 9cdf326b4f, such a handler must run after shutdown_panic to give it a chance. But as the change revealed, the handler must also run before shutdown_halt, so that the system can actually power off before entering the halt limbo. Previously, shutdown_panic and shutdown_halt had the same priority which appears to be incompatible with handlers that can do both poweroff and reset. The above also applies to power cycle handlers. PR: 276784 Reported by: many Tested by: Katsuyuki Miyoshi , Masachika ISHIZUKA Fixes: 9cdf326b4fae run acpi_shutdown_final later to give other handlers a chance MFC after: 1 week --- sys/kern/kern_shutdown.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index ee666281418f..f49e315a503d 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -262,10 +262,10 @@ shutdown_conf(void *unused) EVENTHANDLER_REGISTER(shutdown_final, poweroff_wait, NULL, SHUTDOWN_PRI_FIRST); - EVENTHANDLER_REGISTER(shutdown_final, shutdown_halt, NULL, - SHUTDOWN_PRI_LAST + 100); EVENTHANDLER_REGISTER(shutdown_final, shutdown_panic, NULL, SHUTDOWN_PRI_LAST + 100); + EVENTHANDLER_REGISTER(shutdown_final, shutdown_halt, NULL, + SHUTDOWN_PRI_LAST + 200); } SYSINIT(shutdown_conf, SI_SUB_INTRINSIC, SI_ORDER_ANY, shutdown_conf, NULL);