From nobody Thu Apr 11 09:59:20 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 4VFZt04FTkz5H7Q3; Thu, 11 Apr 2024 09:59:20 +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 4VFZt03dRWz4l11; Thu, 11 Apr 2024 09:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712829560; 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=9A6/qupz56bnvIbmiCXJ5wXxxNfj8p8iHGTsNe9zoGs=; b=uQf1lGpuluo54L0x71MLo5YyzVh3rbx6DWO92hsJIYSD8IwsqovA9l8gEDGwt+tVzaaWNE CxRPZd/NWj1FNP7u1P3+s8wHWfFd67NLtx46/fV5V8l/Gt0sq2muEBSwtbEGgiBJ7SYC9Y Joybp2TZ1oKm8Kbpu7TkygjynBqDZr8CHvoekUwVv48ExDoRgluOA5QsCmrmYplOEo6s6Q fyYbqEMd/bOW6HRvczLmjxfSAUO5n19LwLjiu338GdfNbyiA2Bi2j6Nssdoqq1tFisZr2y e3UYUElzkNfX98S6AleiuMPXGlKXA6VoWqnAZdHdG8diLFXXCeF3QKGtoVFsWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712829560; a=rsa-sha256; cv=none; b=fTRFzyUvK3d5sZCtH1YGVXl7FS8eCW1ORLxP61sayTMQiQYb/5Iu7NbHcYFX/xa4gHSEjc r/KY3H5iBfNK0ScxaiqwWIMZWnpMZOXmZk03BsReDwXj4L+xoHm4XDDo4FnqrCC+MzQiYm TTGP30V74a6W+3kfuhR7Wc1MSFYaYNWaf6lOilDoiefA4rtX1Iz/+8FbaYL9KWR1NkdGmU XPL4vkZAebCyWuP0M8Ae+knW29Qv8gByYmFrzzyhXCYS9KYA3gwg66c1epLdQnt0LvlNEq RSUX4ihW5acF90XxUxtb/dw8p4vCYyiEYnQh6hLLr47IQENm/VQc2ib2tzXBiw== 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=1712829560; 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=9A6/qupz56bnvIbmiCXJ5wXxxNfj8p8iHGTsNe9zoGs=; b=wyzRmPeaTKuGMwclitWLJFbqQ6v8HDqt201JcjvAN9IU78r1/9F4ptWN+RW0muZ4zJO7g4 JJn8Gg0wODqJUMo2xokpjDggsuD2lnLNOIfM21x1tFZp2tzaYd23Q12Zh/i/D8yw8jaM3w sqVwCNsSd1THgmerbPBVU+fNOxMW+LTpJ7GdjGMfP3wgE5ox77MHqNy1PGbgl1/q/KHXuz SIdWoKyY/vxTOygl6jwa/enF2SCrknjgSyWVWYNtshZksyvrcbzGFQ8MCqnhWdkefGjK3F nM9SGXG0NuExkZZBigD9a9NjrgQPnAyyIxqfzON0PPzjhlqgTT7aypz6a/hPwg== 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 4VFZt03DYpz1Fsh; Thu, 11 Apr 2024 09:59:20 +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 43B9xKUN090317; Thu, 11 Apr 2024 09:59:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43B9xK36090314; Thu, 11 Apr 2024 09:59:20 GMT (envelope-from git) Date: Thu, 11 Apr 2024 09:59:20 GMT Message-Id: <202404110959.43B9xK36090314@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: ecd8cc84dcee - main - scmi: Implement scmi_clknode_recalc_freq method 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: Sender: dev-commits-src-main+owner@freebsd.org X-BeenThere: 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: ecd8cc84dcee7d08be8663f721f0502dc5b65808 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ecd8cc84dcee7d08be8663f721f0502dc5b65808 commit ecd8cc84dcee7d08be8663f721f0502dc5b65808 Author: Cristian Marussi AuthorDate: 2023-12-10 22:14:21 +0000 Commit: Andrew Turner CommitDate: 2024-04-11 09:58:56 +0000 scmi: Implement scmi_clknode_recalc_freq method Allow the SCMI clock frequency to be queried back, useful for testing the IRQ path via sysctl access. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D43038 --- sys/dev/firmware/arm/scmi_clk.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/dev/firmware/arm/scmi_clk.c b/sys/dev/firmware/arm/scmi_clk.c index da7a8d37b465..b9ab2145ed76 100644 --- a/sys/dev/firmware/arm/scmi_clk.c +++ b/sys/dev/firmware/arm/scmi_clk.c @@ -55,7 +55,7 @@ struct scmi_clknode_softc { int clock_id; }; -static int __unused +static int scmi_clk_get_rate(struct scmi_clk_softc *sc, int clk_id, uint64_t *rate) { struct scmi_clk_rate_get_out out; @@ -154,8 +154,18 @@ scmi_clknode_init(struct clknode *clk, device_t dev) static int scmi_clknode_recalc_freq(struct clknode *clk, uint64_t *freq) { + struct scmi_clknode_softc *clk_sc; + struct scmi_clk_softc *sc; + uint64_t rate; + int ret; - return (0); + clk_sc = clknode_get_softc(clk); + sc = device_get_softc(clk_sc->dev); + ret = scmi_clk_get_rate(sc, clk_sc->clock_id, &rate); + if (ret == 0) + *freq = rate; + + return (ret); } static int