From nobody Sat Mar 16 15:16:17 2024 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 4Txl7j5KKmz5F1NQ; Sat, 16 Mar 2024 15:16:17 +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 4Txl7j42cPz4G22; Sat, 16 Mar 2024 15:16:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710602177; 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=/Aoep055t7EaQYxYCch5ohJP6OlR0YbNzps5najm4vU=; b=OTb201w2JV0N0xH/cIWYRTThDOMspzwMgiABrAKxiQ69aOOartwPejQt1yFmIN1NLSeugX POAuNhMQja3DzHRsKg5bMPrqevb1MTNugwnZsT79vU0rSCJKXPdXBQMoTD6QDhsUgHr8WN T+JeQ+iKj2z88N632KXQeONS+yP0BkNlGPL5pXiRcyoEhrsFOFdw7eFbAq0fTW5yIUa6N/ YrQcnlTWZ2wwQ8DvnammsXCN6cMaWmJJJ75vHvICp4qYH2DgwA/gMxgfY2s7IFK6ZK5Vmd iXsHbXbJ9m09fmUHmnIwJt3shdZ9cnzZLWbi0OWkPVAMyECNoZCUg9+trPymzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710602177; a=rsa-sha256; cv=none; b=vIaQ+TU5wp0qSo8ARm3heXXXTAa5Q0AfSiCmoUpxO1b5jwju5qaoXliTFFZEd2ahsAqQ2P bgwD9zitMIiZJeYfEVHyzXndKuXN1mrTGpFil7r73gYQ/M30C3/cFF6FwfBA1flTI99DYY P2Edtptm3OiowvQvmjcHISs8Hkf7vprixp1I8eatH8d6XhQITgK7mtwllj9nieTVVmy+9w ptJOrhffn6UHnlVmZaZOxiO1DStvIkYNdU5G6KZ1UcfolRsTeb2A3RBWTbAnha+UfX+FnR OWHRErud84S+537AQDLTDZD4TSW+slmOX38w1aCMsuTYXjHZcy8bAHp7WaOgXA== 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=1710602177; 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=/Aoep055t7EaQYxYCch5ohJP6OlR0YbNzps5najm4vU=; b=DUS8MWg9zaGwYjQ9N0xhkI24ChLaQm+Z/simjxRwjmc1R86imj3R2CVB/8ylRiNcmpKdSd rt5XbI7vepvx/hCA+UvvOjPd+sxVZSErvGQczqAwOeoN5b73xmMd7jJO9sKJQVwLs5y/fi P5wZsQYe62TmIqHmfWGhQV9q+vxV1np6eNnDOiI0n8hBdiPgcrOk6fiA4WjtUKo1PUKNrZ U9+aERbS2sJxRbJuAZwS9FzJv4F38CUZSWad2BGFh9NCSgFpC8KUU3Rg2pexYmzD3Bp+CV OgrmIWgO8zZdEsvxh2RJCtNlZ7C065xiwy1PO8RGq7xjl/XPc7glsaMw30y9Ew== 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 4Txl7j3fp8z10Qr; Sat, 16 Mar 2024 15:16:17 +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 42GFGHv4062769; Sat, 16 Mar 2024 15:16:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42GFGHQh062766; Sat, 16 Mar 2024 15:16:17 GMT (envelope-from git) Date: Sat, 16 Mar 2024 15:16:17 GMT Message-Id: <202403161516.42GFGHQh062766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 0cb72c25b01a - stable/14 - psci: split off psci_reboot from psci_shutdown 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 0cb72c25b01aadb3c6fdd62e58e5c89cdd1b855f Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=0cb72c25b01aadb3c6fdd62e58e5c89cdd1b855f commit 0cb72c25b01aadb3c6fdd62e58e5c89cdd1b855f Author: Andriy Gapon AuthorDate: 2021-07-09 15:01:57 +0000 Commit: Andriy Gapon CommitDate: 2024-03-16 15:14:41 +0000 psci: split off psci_reboot from psci_shutdown Priority of psci_reboot set so that it is run after shutdown_panic is executed. This is to provide uniform experience with other platforms. (cherry picked from commit 0f354b2b588b60e2ef119ff2f480f7905c5db587) --- sys/dev/psci/psci.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/sys/dev/psci/psci.c b/sys/dev/psci/psci.c index 46d7a2f07181..4fd1cd62ed8c 100644 --- a/sys/dev/psci/psci.c +++ b/sys/dev/psci/psci.c @@ -124,7 +124,6 @@ static struct ofw_compat_data compat_data[] = { #endif static int psci_attach(device_t, psci_initfn_t, int); -static void psci_shutdown(void *, int); static int psci_find_callfn(psci_callfn_t *); static int psci_def_callfn(register_t, register_t, register_t, register_t, @@ -468,12 +467,24 @@ psci_shutdown(void *xsc, int howto) if (psci_softc == NULL) return; - /* PSCI system_off and system_reset werent't supported in v0.1. */ if ((howto & RB_POWEROFF) != 0) fn = psci_softc->psci_fnids[PSCI_FN_SYSTEM_OFF]; - else if ((howto & RB_HALT) == 0) - fn = psci_softc->psci_fnids[PSCI_FN_SYSTEM_RESET]; + if (fn) + psci_call(fn, 0, 0, 0); + + /* System reset and off do not return. */ +} +static void +psci_reboot(void *xsc, int howto) +{ + uint32_t fn = 0; + + if (psci_softc == NULL) + return; + + if ((howto & RB_HALT) == 0) + fn = psci_softc->psci_fnids[PSCI_FN_SYSTEM_RESET]; if (fn) psci_call(fn, 0, 0, 0); @@ -484,7 +495,7 @@ void psci_reset(void) { - psci_shutdown(NULL, 0); + psci_reboot(NULL, 0); } #ifdef FDT @@ -582,6 +593,10 @@ psci_v0_2_init(device_t dev, int default_version) EVENTHANDLER_REGISTER(shutdown_final, psci_shutdown, sc, SHUTDOWN_PRI_LAST); + /* Handle reboot after shutdown_panic. */ + EVENTHANDLER_REGISTER(shutdown_final, psci_reboot, sc, + SHUTDOWN_PRI_LAST + 150); + return (0); }