From nobody Fri May 10 09:30:10 2024 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 4VbNrz1kHMz5J2YF; Fri, 10 May 2024 09:30:11 +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 4VbNry5Zqxz4G1q; Fri, 10 May 2024 09:30:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715333410; 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=Xc61ay+4uRHsWHDmbamRp7oP3hCi+cEJDLVMc/B/s2w=; b=G4nb0//Mdu7UiPzSU5JdgVTd5XF9J38lClqH4qOV8itwex7gGTH06+6dhjzNpIpKRPUvYN lU17pCFA0EOFTlNwskg0OXnJi/117zGH2e3pBZO5WUb7lRyo5AmC/8+0lOmwYq5xC/AlsD GRR+DT43V7XOAUddiLLNE4ebWhx4M8TYh/KB8XAVxDCJPpGmRna36JUbWXlOmjgZJjMxYf TCgCyw56Y0sL0i3fx9YkY6yaAHn4WwKIOefE64daSoUIFtZ8T02W9KiNM9SjCI5IgVn+gp D8VUf9+BdIAruvY+rEie2XwwQjAQxmgQrlX+kHa1bnbfjzrZZrZlo8vz1KAK/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715333410; a=rsa-sha256; cv=none; b=HIuUGMoOZZ96f+ckUJorGUxxhCQuy9/zAh6xxnghdg/tb/qELsydilrMuYYSXQAv6jsW7J nK2YSTLKmuoUL9Sa/BvvOPSs26JiZ8iI8HG+Ko0uFF7yzdlzMzSOQcHQm4AeBx4VwR6EdH kQQ4UiceMA2o1jPT8ypwnqO8oXG1/FqpHl7urYjVwLFkfnDphM1rJZ0CGl0N+yN/RjFTKE CKWPAysV7I2l7szItp8XXdyGZKROt5iLUA6GWUdp+JNEymfiAGGauPppu0iYxOE4R0HvaA nz9gOWfX/PsnudGO/8WZ4GluH/+b8xJYO//h/cjVttBYhtqeiUDCLcBb+Y2Kig== 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=1715333410; 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=Xc61ay+4uRHsWHDmbamRp7oP3hCi+cEJDLVMc/B/s2w=; b=bdJQ8v60LbKysYAMN96rCeArbblBWq47Cl8y0zlApgF0Wjrza0Jx18q26/d0wpjucYtrcp AGD1HWB9jIjpu1ZAbk8LRJboKJwPMuLdede5Jno+fsA5qNYIAJ88jFDzZyG16/jAkk/ZGa XNeEDvz2sHveoPLQQ7b7PLsoueUR//io7PNwCTWmo90oaIES45AsbHopVFIF6QzoLrLEME r2WK8OQclfPqGsU5KhTDNCENDOPFtWgJzoQx9rgIsxiIaENF6qSmKfq8IbmFEOPPEiUDlX sivHue0gAlH9VvbBcihyDUZxC7Q1AikxtjTIN7iz6tUBUskDlQNZ06dyBsY2rQ== 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 4VbNry5BkSzX1q; Fri, 10 May 2024 09:30:10 +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 44A9UAE8085538; Fri, 10 May 2024 09:30:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44A9UAGo085533; Fri, 10 May 2024 09:30:10 GMT (envelope-from git) Date: Fri, 10 May 2024 09:30:10 GMT Message-Id: <202405100930.44A9UAGo085533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f91e9401c209 - main - dev/psci: Check all compat strings 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f91e9401c2098ba56f43093ef9747d0b1f60f8eb Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f91e9401c2098ba56f43093ef9747d0b1f60f8eb commit f91e9401c2098ba56f43093ef9747d0b1f60f8eb Author: Andrew Turner AuthorDate: 2024-04-23 11:27:09 +0000 Commit: Andrew Turner CommitDate: 2024-05-10 09:29:24 +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 --- 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 e1e9c1880b54..3211c331ed6e 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); if (!ofw_bus_node_status_okay(node)) return (PSCI_MISSING);