From nobody Mon Jul 15 12:38:15 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 4WN1vW4Hvnz5QrXh; Mon, 15 Jul 2024 12:38:15 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WN1vW19Bdz4H6Z; Mon, 15 Jul 2024 12:38:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047095; 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=9OKXgLjwBEC+HuiB3qV8jrHct7S/qtePc2GLZTb278M=; b=XjStve0IQrQXtEdfj1KfZ8bv5ERj+eQG0AY5S4uREqU5Q0gnoRPctsC9PtgtY/cP1i00BO CkEywwY5Xi9ZEfHYTrxHyAzID9gMPrdXKF/mOEAcBQ9U3W3WMH+NB/MdrguPyq7A08lmOw HuC8Z3gox4QYv58PgOmrxNs29LMe6IO31KDJ2+aF6rIB81FZ96KJeN/1qF6C226LCrSyB/ hC8cF3ERODkIA5rBAbd1oE83rZBHD4LqLSZNsY2LH5ZyfyNpFg6wQMo5Y07kQqX0gh4sEP GDSqiP1pgnkrLv3RRQp2mqYgCJOEEN0Ul2Ci1c6+8KtdGZst0L1nYWJyN6/3Ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721047095; a=rsa-sha256; cv=none; b=umbOj57ZuQAXCRZ0tb2qx8ykL9dRXav+GWya1t+/lezrMDr/KUv2KiMAAjK9uvXMU2NxyB ewDQtR9PxUSlLBh7mH2rj5EDUbtoUrsU6+Gj1bqcHDW1x8JBUVclcvjtTqsu5OpOKhJOu3 38joecUTXucoqh60ILSv8d9QcmclAXQogUlwID8sPw2lhfiNtitTSOUl4ZG+x86+y0Yl3g MhLg0nx+sgIzcr6LlTL2c3q/yvdRt4GS/7KZVNcBrvtK9Fnf8hOFhVTXvZZzr0JbfUd7cW XDVZHbp+ofX6YhqKymVmuTo9GwZwe+FLLAMxCZ5iAS+MdUzxtlLEOAo7GvkGpg== 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=1721047095; 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=9OKXgLjwBEC+HuiB3qV8jrHct7S/qtePc2GLZTb278M=; b=Zr7p+YVEdgeAC498Jsb0zNuNYhuykLiGm9KI/3LiHWgj4zmKEopzexfXAwtvNQkurCFE+w ViJLiwVsBwh0C+yoXmn4DETPkrAtAtOCxGvHAuND3JC2551UILBllALfkDBLGUlKX6EKxq FkLBh95NUDUUlS21n5hhtx5ztAMtum2K2YSnbqT3zD+IFr9eBs09LKDGwqSc0V4cCEoPqX SfTIW42AeESXW1MHVtMeeRlIGux9EUd4tCGy+0Ct1Jh/kddiujywoAxIYENsKj83VjG1ja Rm3Pu59o2oWN4UE0ydLzTkOkQ8/ym8eRRcpsO/OYqfytOYKjCYQ0V8IYzXMLLw== 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 4WN1vW0nmmzscl; Mon, 15 Jul 2024 12:38:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46FCcFfl060408; Mon, 15 Jul 2024 12:38:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FCcFhp060405; Mon, 15 Jul 2024 12:38:15 GMT (envelope-from git) Date: Mon, 15 Jul 2024 12:38:15 GMT Message-Id: <202407151238.46FCcFhp060405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 1320b22f49b2 - stable/13 - dev/psci: Check all compat strings 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1320b22f49b2385dc12505a93c3e2e34071d4eae Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=1320b22f49b2385dc12505a93c3e2e34071d4eae commit 1320b22f49b2385dc12505a93c3e2e34071d4eae Author: Andrew Turner AuthorDate: 2024-04-23 11:27:09 +0000 Commit: Andrew Turner CommitDate: 2024-07-15 12:34:29 +0000 dev/psci: Check all compat strings When searching for the PSCI FDT node we only check a few compat strings. Use the existing compat_data array to check all strings the driver may attach to. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44913 (cherry picked from commit f91e9401c2098ba56f43093ef9747d0b1f60f8eb) --- sys/dev/psci/psci.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sys/dev/psci/psci.c b/sys/dev/psci/psci.c index a656a1365067..da0a5f2edb16 100644 --- a/sys/dev/psci/psci.c +++ b/sys/dev/psci/psci.c @@ -382,12 +382,18 @@ psci_fdt_callfn(psci_callfn_t *callfn) { phandle_t node; - node = ofw_bus_find_compatible(OF_peer(0), "arm,psci-0.2"); - if (node == 0) { - node = ofw_bus_find_compatible(OF_peer(0), "arm,psci-1.0"); - if (node == 0) - return (PSCI_MISSING); + /* XXX: This is suboptimal, we should walk the tree & check each + * node against compat_data, but we only have a few entries so + * it's ok for now. + */ + for (int i = 0; compat_data[i].ocd_str != NULL; i++) { + node = ofw_bus_find_compatible(OF_peer(0), + compat_data[i].ocd_str); + if (node != 0) + break; } + if (node == 0) + return (PSCI_MISSING); *callfn = psci_fdt_get_callfn(node); return (0);