From nobody Mon Jul 15 12:38:08 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 4WN1vP2zk8z5QrXG; Mon, 15 Jul 2024 12:38:09 +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 4WN1vP0cd5z4HGm; Mon, 15 Jul 2024 12:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047089; 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=AhLFzftEdp8YVmPUc3QASC213fmKiiYraU06segE+LQ=; b=ApjIKSO+qkfnuFjPy8VNFn+9yGCbEQkK1rNgBqofgKAJn6qNQ4BS1HbZHwX2Qq6w9Sps9W EFKkANLmPaFmRcK86pmvwgRc7bIpROfW69hmjWmhKvZdw2ZApFfGmj9V1hENCbH+BSQHPD QuuUU5rbHTKC2tTovPv3bpfGYgrQBN3QqZDDjdonQj/LoRfieEEmMnrwmOheEJgrbOxUuu MlInr42Q7c/yi0VU42PIS5JnFvBDmxKcYPL6VTknNBfzrhVNmrLiTBOuJLYiFqKNB9k66E kCi9+tfcqCJAvquCq5+1LYMpy8TdlteYnAhcY3w64kucfzYn/8TyUNomPVQ/5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721047089; a=rsa-sha256; cv=none; b=t61V2jO/TwZS4F2JMk7W+rNSvWxDTAJadOeaXGnFtzKtU65PJeEZ+NhxiLB7nUazzLgq1x eQILxXmir17lQGxzzyChzeiSFso8zz4/K2Vm97I0JZVdZ2J17DpmL1a52+Eojf9FPMmQjh vlH38tVA95rtYU2HvPf8MA4PTHJbiVahZa+Yu/Vp85LJkgq2bDjyBHDj0BGA/RmN8m4hS7 Q6ojWiSKJzRvT67/MI3BM0YfbOwwDsasRBVfNuCLpEFlaSJkYmLWIImSsBo8n/60uy1iQT CadVAOD78i3NEdCKh87ufwM4MT4jOHVzj3mX2ODqn+dOUSc0pDC7Lh2QVzCVZA== 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=1721047089; 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=AhLFzftEdp8YVmPUc3QASC213fmKiiYraU06segE+LQ=; b=MBQnbwMxRuf4q42UrBcy7b9FrNFanuGBxcbiVB4vVGPdv3jUtp710J/ldvevw5N+uNhi/2 f4Y4aID5BumvoLbhVnUofUok11BV//Qvi8jLhQ9b99uLUDHb/PIqdsIy9tyEBf8bH+UKKi 2Q3K5XkLqqe0aJB5W9a2E5Lz04bBMqtqptDdPOZyZkAyjM6WEFrzJVQtTul2c7SNC1CE4S a3aD8Pr9kWR+ozAJxq1tl1gn4/9VGENkM8altn2POTtw79XhJLQsIsqh911IqrafLeJpR5 wfSmAwBcR+LvPkMcfO9vJePH3BBOzXSWBdl2fR1vZX/79lKiA1m8RZqZdwk9JQ== 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 4WN1vP0Bpfzsrp; Mon, 15 Jul 2024 12:38:09 +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 46FCc8GD059877; Mon, 15 Jul 2024 12:38:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FCc8II059874; Mon, 15 Jul 2024 12:38:08 GMT (envelope-from git) Date: Mon, 15 Jul 2024 12:38:08 GMT Message-Id: <202407151238.46FCc8II059874@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: ab44e45862e0 - stable/14 - dev/psci: Check all compat strings 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 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/14 X-Git-Reftype: branch X-Git-Commit: ab44e45862e099dac5f3bd5390c3233ad1073a56 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ab44e45862e099dac5f3bd5390c3233ad1073a56 commit ab44e45862e099dac5f3bd5390c3233ad1073a56 Author: Andrew Turner AuthorDate: 2024-04-23 11:27:09 +0000 Commit: Andrew Turner CommitDate: 2024-07-15 12:24:30 +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 4fd1cd62ed8c..bc35f818d844 100644 --- a/sys/dev/psci/psci.c +++ b/sys/dev/psci/psci.c @@ -378,12 +378,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);