Message ID | c03c4f2b9d4dcc3264d1902606c6c5c464b4b043.1669012140.git.viresh.kumar@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1426523wrr; Sun, 20 Nov 2022 23:04:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf5TLOqCieIAyLjDFEZgn/2inczoacNYpmAZRY9DLh2EL7U90X0EcR8S/x1+GwbhDzDP+slj X-Received: by 2002:a05:6402:1386:b0:458:d7b5:9793 with SMTP id b6-20020a056402138600b00458d7b59793mr5011771edv.377.1669014248863; Sun, 20 Nov 2022 23:04:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669014248; cv=none; d=google.com; s=arc-20160816; b=JVlAnCbtEvSyfoP1OTAETWvoN847TXstzJss+lMkKG+lMi+tK5J6Dpz1+iN+IIQhGa Erq9zLqrJGiPqcRScA1P4MMdnN28hoqX/QzI2d2DmFGesIOmuS9znp0K+C1LVuLYYFs9 srJ5dDG0Vi+Cvn93YOXCgYzHYhcLa63UiuDV3J5G1pl2DTtfZvLeEaqjzu97lfGbUvI/ h9W/2999IWJCUdIlptblpfCebocmGKurMBZzh22wVrds3V2yNDQehiG2DKBye3qdyRWc ZjXc2bfVr/AREpkWWOhAhRJxA/625uTtRfpzTu5oNJjl/k5Ovbpa6JVy210PmVzoAXPc CYXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BtruWrVYTytoEhIj6SMwW8OKntqRZGuB4D7xreZ5kLA=; b=WcgW5iaSBHDhgrqpQ/vsxQniYP5xIhMyFq49y/zOOmOqUnsGbySgylysbpSRj4U969 eIZ4WdnvN2dlNGOLnyr9NODD/ojHAvqFI4zFht/d8mdRzkx0z+pnvheeLyso2xq5W55K kEC1jbq4LkPQjw30AA8/I+pp+B8wiaC6uIOistgvjfqjkT5D+izcZ+ue8TVy3ANVGf3x /kZCiT0oL5X74Wnsw/vkLvx7NVfGXwUQM5TBNlXFf4BRp4DpcysZIunSsXs9g1S6OY/N +lmcKm9tz4arZe7RHSXdNXQKSo+GQFKj80ijVmqJykYE5VXaZNGzljWBJb4RwrRMt4wu gq3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zv/HlQ1+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xd4-20020a170907078400b0078da30cb4bfsi8914076ejb.428.2022.11.20.23.03.35; Sun, 20 Nov 2022 23:04:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zv/HlQ1+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbiKUG62 (ORCPT <rfc822;peter110.wang@gmail.com> + 99 others); Mon, 21 Nov 2022 01:58:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbiKUG6I (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 21 Nov 2022 01:58:08 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D8E8175B5 for <linux-kernel@vger.kernel.org>; Sun, 20 Nov 2022 22:58:02 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id p21so9765693plr.7 for <linux-kernel@vger.kernel.org>; Sun, 20 Nov 2022 22:58:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BtruWrVYTytoEhIj6SMwW8OKntqRZGuB4D7xreZ5kLA=; b=zv/HlQ1+Kd/LPc2G4AXA2rmVOt0ecSPXMRHhl95bCGd7z4kAnCaLNgLxqz3IvFnlWC imM1sj4HhcQnltsphPzF4FL62L3DvQmBsFDoA6K2UdCbitJBolWFB0/p+uFPa9JKPCL/ xT1vmDBjcYjqDEWU2enbYWDm9gS2uj2JhcPMmX1y9aRvtYbZME0drywKFCLdUBhmECOv mHvetH16NAOhFIZ8tdG8a/D/D5ZEyLX1bdN9+rAs+rlvOWR9QyN6p77zXnVymIsOkV9o BV4jaHv8Z6KbL+dCKTgu6gICEQHpPXoMIHr204NNBpAusMbBHi+rvESl1cT3XkjzHvlO YhsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BtruWrVYTytoEhIj6SMwW8OKntqRZGuB4D7xreZ5kLA=; b=z6tEl4lDzoHj77tTCd6v/doKgQHGBn0tMb8xMTv1UmZdo+rohpNK5Cb6jLtcgxu4+E wRx1+vhnjnNT0UDNdwl/lv33EnzqXy0DEk8mxxFzAKbEnNtkIkI+qYs4el5be8CBmEX1 ZxvuNZASdii1eXza3IZitQq/FOI565a9oOGOZYgXTHU2xPXjxTwbIfm0t2hmcMCL3qW0 tSIq/XAyqgFM53nKOc4f+h0A/22nvz7IUZXtmnaugNWGl9lmXIW8B30T3cNmYjJnvuHc qv/O/+ZknEmjAyQ5DS4dzYWaBcyqPoVxJcy5BK7eahp56zfGj6UY4kAmdYW0lPBIGsLe udQQ== X-Gm-Message-State: ANoB5pnYL9UTzxBtEzJV4nWA7nqECaL6s6R7psOJ0bbyQz+8RCBmMoNT IaQpX1fIjqS7QEvoimqm5TXlRQ== X-Received: by 2002:a17:902:f552:b0:186:b768:454d with SMTP id h18-20020a170902f55200b00186b768454dmr1830511plf.82.1669013882031; Sun, 20 Nov 2022 22:58:02 -0800 (PST) Received: from localhost ([122.172.85.60]) by smtp.gmail.com with ESMTPSA id c10-20020a630d0a000000b0047702d44861sm6815938pgl.18.2022.11.20.22.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Nov 2022 22:58:00 -0800 (PST) From: Viresh Kumar <viresh.kumar@linaro.org> To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>, Stephen Boyd <sboyd@kernel.org> Cc: Viresh Kumar <viresh.kumar@linaro.org>, linux-pm@vger.kernel.org, Vincent Guittot <vincent.guittot@linaro.org>, "Rafael J. Wysocki" <rafael@kernel.org>, andersson@kernel.org, johan@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] OPP: Disallow "opp-hz" property without a corresponding clk Date: Mon, 21 Nov 2022 12:27:48 +0530 Message-Id: <c03c4f2b9d4dcc3264d1902606c6c5c464b4b043.1669012140.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: <cover.1669012140.git.viresh.kumar@linaro.org> References: <cover.1669012140.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750088148330935229?= X-GMAIL-MSGID: =?utf-8?q?1750088284592724515?= |
Series |
OPP: Disallow "opp-hz" property without a corresponding clk
|
|
Commit Message
Viresh Kumar
Nov. 21, 2022, 6:57 a.m. UTC
This removes the special code added by the commit 2083da24eb56 ("OPP:
Allow multiple clocks for a device"), to make it work for Qcom SoC.
In qcom-cpufreq-hw driver, we want to skip clk configuration that
happens via dev_pm_opp_set_opp(), but still want the OPP core to parse
the "opp-hz" property so we can use the freq based OPP helpers.
The DT for Qcom SoCs is fixed now and contain a valid clk entry, and we
no longer need the special handling of the same in the OPP core.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/opp/core.c | 14 --------------
drivers/opp/debugfs.c | 2 +-
2 files changed, 1 insertion(+), 15 deletions(-)
Comments
On Mon, Nov 21, 2022 at 12:27:48PM +0530, Viresh Kumar wrote: > This removes the special code added by the commit 2083da24eb56 ("OPP: > Allow multiple clocks for a device"), to make it work for Qcom SoC. > > In qcom-cpufreq-hw driver, we want to skip clk configuration that > happens via dev_pm_opp_set_opp(), but still want the OPP core to parse > the "opp-hz" property so we can use the freq based OPP helpers. > > The DT for Qcom SoCs is fixed now and contain a valid clk entry, and we > no longer need the special handling of the same in the OPP core. Didn't this affect also sc8280xp? Perhaps you can hold off with applying this one for a bit until the needed devicetree changes are in linux-next for all the affected platforms. (It looks like Mani's series only updated sm8450 and I guess Bjorn hasn't picked up that one up yet either.) Johan
On 21-11-22, 08:22, Johan Hovold wrote: > On Mon, Nov 21, 2022 at 12:27:48PM +0530, Viresh Kumar wrote: > > This removes the special code added by the commit 2083da24eb56 ("OPP: > > Allow multiple clocks for a device"), to make it work for Qcom SoC. > > > > In qcom-cpufreq-hw driver, we want to skip clk configuration that > > happens via dev_pm_opp_set_opp(), but still want the OPP core to parse > > the "opp-hz" property so we can use the freq based OPP helpers. > > > > The DT for Qcom SoCs is fixed now and contain a valid clk entry, and we > > no longer need the special handling of the same in the OPP core. > > Didn't this affect also sc8280xp? I assumed Mani fixed all affected Qcom SoCs :( > Perhaps you can hold off with applying > this one for a bit until the needed devicetree changes are in linux-next > for all the affected platforms. Sure. > (It looks like Mani's series only updated sm8450 and I guess Bjorn > hasn't picked up that one up yet either.) I applied that series today to my cpufreq/arm/linux-next, since it had cpufreq updates too and these patches are rebased on top of them.
On Mon, Nov 21, 2022 at 08:22:01AM +0100, Johan Hovold wrote: > On Mon, Nov 21, 2022 at 12:27:48PM +0530, Viresh Kumar wrote: > > This removes the special code added by the commit 2083da24eb56 ("OPP: > > Allow multiple clocks for a device"), to make it work for Qcom SoC. > > > > In qcom-cpufreq-hw driver, we want to skip clk configuration that > > happens via dev_pm_opp_set_opp(), but still want the OPP core to parse > > the "opp-hz" property so we can use the freq based OPP helpers. > > > > The DT for Qcom SoCs is fixed now and contain a valid clk entry, and we > > no longer need the special handling of the same in the OPP core. > > Didn't this affect also sc8280xp? Perhaps you can hold off with applying > this one for a bit until the needed devicetree changes are in linux-next > for all the affected platforms. > > (It looks like Mani's series only updated sm8450 and I guess Bjorn > hasn't picked up that one up yet either.) > That's right. I have proposed to do the similar change to other SoCs as well once the series was completely merged. I thought of doing so for 6.3. Btw, there seems to be one more candidate: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/qcom/sm8250.dtsi#n2537 Looks like newer SoCs that has the GMU within the GPU block doesn't have clock property. This is because, GMU is the one supplying clocks to the GPU unlike the old SoCs where the clocks used to come from GCC itself. But we do have a GMU devicetree node, so it should be a matter of adding the clock provider support as done for cpufreq and represent it in devicetree. I'll ping Rob Clark and see how to get it done. Thanks, Mani > Johan
On Mon, Nov 21, 2022 at 01:08:17PM +0530, Viresh Kumar wrote: > On 21-11-22, 08:22, Johan Hovold wrote: > > On Mon, Nov 21, 2022 at 12:27:48PM +0530, Viresh Kumar wrote: > > > This removes the special code added by the commit 2083da24eb56 ("OPP: > > > Allow multiple clocks for a device"), to make it work for Qcom SoC. > > > > > > In qcom-cpufreq-hw driver, we want to skip clk configuration that > > > happens via dev_pm_opp_set_opp(), but still want the OPP core to parse > > > the "opp-hz" property so we can use the freq based OPP helpers. > > > > > > The DT for Qcom SoCs is fixed now and contain a valid clk entry, and we > > > no longer need the special handling of the same in the OPP core. > > > > Didn't this affect also sc8280xp? > > I assumed Mani fixed all affected Qcom SoCs :( I think he may have been waiting for his suggested solution to be accepted before updating all the affected dtsi:s. > > Perhaps you can hold off with applying > > this one for a bit until the needed devicetree changes are in linux-next > > for all the affected platforms. > > Sure. Thanks. > > (It looks like Mani's series only updated sm8450 and I guess Bjorn > > hasn't picked up that one up yet either.) > > I applied that series today to my cpufreq/arm/linux-next, since it had > cpufreq updates too and these patches are rebased on top of them. Ok, I was expected the devicetree update to through Bjorn's tree as I imagine there may be conflicts otherwise. What was the intention here, Mani? Johan
On Mon, Nov 21, 2022 at 01:08:17PM +0530, Viresh Kumar wrote: > On 21-11-22, 08:22, Johan Hovold wrote: > > On Mon, Nov 21, 2022 at 12:27:48PM +0530, Viresh Kumar wrote: > > > This removes the special code added by the commit 2083da24eb56 ("OPP: > > > Allow multiple clocks for a device"), to make it work for Qcom SoC. > > > > > > In qcom-cpufreq-hw driver, we want to skip clk configuration that > > > happens via dev_pm_opp_set_opp(), but still want the OPP core to parse > > > the "opp-hz" property so we can use the freq based OPP helpers. > > > > > > The DT for Qcom SoCs is fixed now and contain a valid clk entry, and we > > > no longer need the special handling of the same in the OPP core. > > > > Didn't this affect also sc8280xp? > > I assumed Mani fixed all affected Qcom SoCs :( > > > Perhaps you can hold off with applying > > this one for a bit until the needed devicetree changes are in linux-next > > for all the affected platforms. > > Sure. > > > (It looks like Mani's series only updated sm8450 and I guess Bjorn > > hasn't picked up that one up yet either.) > > I applied that series today to my cpufreq/arm/linux-next, since it had > cpufreq updates too and these patches are rebased on top of them. > Ah, I thought you applied only cpufreq patches. DTS and bindings patches are supposed to go through Bjorn's tree. Can you please drop them? Thanks, Mani > -- > viresh
On 21-11-22, 08:42, Johan Hovold wrote: > Ok, I was expected the devicetree update to through Bjorn's tree as I > imagine there may be conflicts otherwise. Dropped the DT patch now. Mani, I believe the first patch in this series is still required. Without that, when the cpufreq driver calls dev_pm_opp_set_opp(), the OPP core may end up calling clk_set_rate(), which shouldn't be done in case of Qcom SoCs. I am not sure though, how it will work with sc8280xp. Can you please check ?
On Mon, Nov 21, 2022 at 02:00:36PM +0530, Viresh Kumar wrote: > On 21-11-22, 08:42, Johan Hovold wrote: > > Ok, I was expected the devicetree update to through Bjorn's tree as I > > imagine there may be conflicts otherwise. > > Dropped the DT patch now. > > Mani, I believe the first patch in this series is still required. > Without that, when the cpufreq driver calls dev_pm_opp_set_opp(), the > OPP core may end up calling clk_set_rate(), which shouldn't be done in > case of Qcom SoCs. > If there is no .set_rate() callback implemented by the clock provider, it won't hurt, right? Thanks, Mani > I am not sure though, how it will work with sc8280xp. Can you please > check ? > > -- > viresh
On 22-11-22, 18:56, Manivannan Sadhasivam wrote: > If there is no .set_rate() callback implemented by the clock provider, it won't > hurt, right? It shouldn't, I guess. Well, in that case, is the first patch even required ? Maybe we should keep it, this makes clear that we won't even call set_rate(), irrespective of the face that it is implemented or not. Also, the clk provider may not be part of this file later on, for other SoC versions, and it is better in that case too.
On Thu, Nov 24, 2022 at 09:53:04AM +0530, Viresh Kumar wrote: > On 22-11-22, 18:56, Manivannan Sadhasivam wrote: > > If there is no .set_rate() callback implemented by the clock provider, it won't > > hurt, right? > > It shouldn't, I guess. Well, in that case, is the first patch even > required ? Maybe we should keep it, this makes clear that we won't > even call set_rate(), irrespective of the face that it is implemented > or not. > I don't think that detail is required to be made explicit. If someone cares, they can easlily find out by glancing through the OPP code. So IMO, we don't need patch 1/2. > Also, the clk provider may not be part of this file later on, for > other SoC versions, and it is better in that case too. > We cannot predict what the HW guys will come up with ;) But as said above, I don't think it is necessary to to make it explicit. Thanks, Mani > -- > viresh
On 21-11-22, 13:09, Manivannan Sadhasivam wrote: > That's right. I have proposed to do the similar change to other SoCs as well > once the series was completely merged. I thought of doing so for 6.3. > > Btw, there seems to be one more candidate: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/qcom/sm8250.dtsi#n2537 > > Looks like newer SoCs that has the GMU within the GPU block doesn't have clock > property. This is because, GMU is the one supplying clocks to the GPU unlike the > old SoCs where the clocks used to come from GCC itself. > > But we do have a GMU devicetree node, so it should be a matter of adding the > clock provider support as done for cpufreq and represent it in devicetree. > > I'll ping Rob Clark and see how to get it done. Any update on this Mani ? I want to get the hack removed if possible.
+ Rob Clark On Wed, Jan 25, 2023 at 09:51:45AM +0530, Viresh Kumar wrote: > On 21-11-22, 13:09, Manivannan Sadhasivam wrote: > > That's right. I have proposed to do the similar change to other SoCs as well > > once the series was completely merged. I thought of doing so for 6.3. > > > > Btw, there seems to be one more candidate: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/qcom/sm8250.dtsi#n2537 > > > > Looks like newer SoCs that has the GMU within the GPU block doesn't have clock > > property. This is because, GMU is the one supplying clocks to the GPU unlike the > > old SoCs where the clocks used to come from GCC itself. > > > > But we do have a GMU devicetree node, so it should be a matter of adding the > > clock provider support as done for cpufreq and represent it in devicetree. > > > > I'll ping Rob Clark and see how to get it done. > > Any update on this Mani ? I want to get the hack removed if possible. > Hi Viresh, Sorry for the delay. I've submitted the dts changes [1] to handle the CPU clocks for the rest of the Qcom SoCs. For the Qcom GPUs, I've CCed Rob Clark who is the maintainer. Rob, here is the background on the issue that is being discussed in this thread: Viresh submitted a series [2] back in July to improve the OPP framework, but that ended up breaking cpufreq on multiple Qcom SoCs. After investigation, it was found that the series was expecting the clocks supplied to the OPP end devices like CPUs/GPUs to be modeled in DT. But on Qcom platforms even though the clocks for these nodes are supplied by a separate entity, like CPUFreq (EPSS/OSM) for CPUs and GMU for GPUs, there was no clock property present in the respective nodes. And these nodes are using OPP table to switch frequencies dynamically. While the series was merged with a hack that still allows the OPP nodes without clock property in DT, we came to an agreement that the clock hierarchy should be modeled properly. So I submitted a series [3] that added clock provider support to cpufreq driver and sourced the clock from cpufreq node to CPU nodes in DT. Likewise, it should be handled for the adreno GPUs whose clock is managed by GMU on newer SoCs. Can you take a look at this? Thanks, Mani [1] https://lore.kernel.org/linux-arm-msm/20230215070400.5901-1-manivannan.sadhasivam@linaro.org/ [2] https://lore.kernel.org/lkml/cover.1657003420.git.viresh.kumar@linaro.org/ [3] https://lore.kernel.org/linux-arm-msm/20221117053145.10409-1-manivannan.sadhasivam@linaro.org/ > -- > viresh
On 16-02-23, 12:17, Manivannan Sadhasivam wrote: > Sorry for the delay. I've submitted the dts changes [1] to handle the CPU clocks > for the rest of the Qcom SoCs. > > For the Qcom GPUs, I've CCed Rob Clark who is the maintainer. > > Rob, here is the background on the issue that is being discussed in this > thread: > > Viresh submitted a series [2] back in July to improve the OPP framework, but > that ended up breaking cpufreq on multiple Qcom SoCs. After investigation, it > was found that the series was expecting the clocks supplied to the OPP end > devices like CPUs/GPUs to be modeled in DT. But on Qcom platforms even though > the clocks for these nodes are supplied by a separate entity, like CPUFreq > (EPSS/OSM) for CPUs and GMU for GPUs, there was no clock property present in > the respective nodes. And these nodes are using OPP table to switch frequencies > dynamically. > > While the series was merged with a hack that still allows the OPP nodes without > clock property in DT, we came to an agreement that the clock hierarchy should > be modeled properly. > > So I submitted a series [3] that added clock provider support to cpufreq driver > and sourced the clock from cpufreq node to CPU nodes in DT. > > Likewise, it should be handled for the adreno GPUs whose clock is managed by > GMU on newer SoCs. Can you take a look at this? Any update on this ?
On 11-10-23, 11:18, Viresh Kumar wrote: > On 16-02-23, 12:17, Manivannan Sadhasivam wrote: > > Sorry for the delay. I've submitted the dts changes [1] to handle the CPU clocks > > for the rest of the Qcom SoCs. > > > > For the Qcom GPUs, I've CCed Rob Clark who is the maintainer. > > > > Rob, here is the background on the issue that is being discussed in this > > thread: > > > > Viresh submitted a series [2] back in July to improve the OPP framework, but > > that ended up breaking cpufreq on multiple Qcom SoCs. After investigation, it > > was found that the series was expecting the clocks supplied to the OPP end > > devices like CPUs/GPUs to be modeled in DT. But on Qcom platforms even though > > the clocks for these nodes are supplied by a separate entity, like CPUFreq > > (EPSS/OSM) for CPUs and GMU for GPUs, there was no clock property present in > > the respective nodes. And these nodes are using OPP table to switch frequencies > > dynamically. > > > > While the series was merged with a hack that still allows the OPP nodes without > > clock property in DT, we came to an agreement that the clock hierarchy should > > be modeled properly. > > > > So I submitted a series [3] that added clock provider support to cpufreq driver > > and sourced the clock from cpufreq node to CPU nodes in DT. > > > > Likewise, it should be handled for the adreno GPUs whose clock is managed by > > GMU on newer SoCs. Can you take a look at this? > > Any update on this ? Mani, Ping.
+ Dmitry On Wed, Nov 15, 2023 at 12:02:01PM +0530, Viresh Kumar wrote: > On 11-10-23, 11:18, Viresh Kumar wrote: > > On 16-02-23, 12:17, Manivannan Sadhasivam wrote: > > > Sorry for the delay. I've submitted the dts changes [1] to handle the CPU clocks > > > for the rest of the Qcom SoCs. > > > > > > For the Qcom GPUs, I've CCed Rob Clark who is the maintainer. > > > > > > Rob, here is the background on the issue that is being discussed in this > > > thread: > > > > > > Viresh submitted a series [2] back in July to improve the OPP framework, but > > > that ended up breaking cpufreq on multiple Qcom SoCs. After investigation, it > > > was found that the series was expecting the clocks supplied to the OPP end > > > devices like CPUs/GPUs to be modeled in DT. But on Qcom platforms even though > > > the clocks for these nodes are supplied by a separate entity, like CPUFreq > > > (EPSS/OSM) for CPUs and GMU for GPUs, there was no clock property present in > > > the respective nodes. And these nodes are using OPP table to switch frequencies > > > dynamically. > > > > > > While the series was merged with a hack that still allows the OPP nodes without > > > clock property in DT, we came to an agreement that the clock hierarchy should > > > be modeled properly. > > > > > > So I submitted a series [3] that added clock provider support to cpufreq driver > > > and sourced the clock from cpufreq node to CPU nodes in DT. > > > > > > Likewise, it should be handled for the adreno GPUs whose clock is managed by > > > GMU on newer SoCs. Can you take a look at this? > > > > Any update on this ? > > Mani, > > Ping. > Dmitry, can you please look into this? Please read my above reply to Rob to get the background. - Mani > -- > viresh
On Wed, 15 Nov 2023 at 09:55, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> wrote: > > + Dmitry > > On Wed, Nov 15, 2023 at 12:02:01PM +0530, Viresh Kumar wrote: > > On 11-10-23, 11:18, Viresh Kumar wrote: > > > On 16-02-23, 12:17, Manivannan Sadhasivam wrote: > > > > Sorry for the delay. I've submitted the dts changes [1] to handle the CPU clocks > > > > for the rest of the Qcom SoCs. > > > > > > > > For the Qcom GPUs, I've CCed Rob Clark who is the maintainer. > > > > > > > > Rob, here is the background on the issue that is being discussed in this > > > > thread: > > > > > > > > Viresh submitted a series [2] back in July to improve the OPP framework, but > > > > that ended up breaking cpufreq on multiple Qcom SoCs. After investigation, it > > > > was found that the series was expecting the clocks supplied to the OPP end > > > > devices like CPUs/GPUs to be modeled in DT. But on Qcom platforms even though > > > > the clocks for these nodes are supplied by a separate entity, like CPUFreq > > > > (EPSS/OSM) for CPUs and GMU for GPUs, there was no clock property present in > > > > the respective nodes. And these nodes are using OPP table to switch frequencies > > > > dynamically. > > > > > > > > While the series was merged with a hack that still allows the OPP nodes without > > > > clock property in DT, we came to an agreement that the clock hierarchy should > > > > be modeled properly. > > > > > > > > So I submitted a series [3] that added clock provider support to cpufreq driver > > > > and sourced the clock from cpufreq node to CPU nodes in DT. > > > > > > > > Likewise, it should be handled for the adreno GPUs whose clock is managed by > > > > GMU on newer SoCs. Can you take a look at this? > > > > > > Any update on this ? > > > > Mani, > > > > Ping. > > > > Dmitry, can you please look into this? Please read my above reply to Rob > to get the background. The issue is that we don't have an actual clock that corresponds to the GPU frequency. Not even a read-only one. Can we get away by manually setting config_clocks()? Also could you please remind me, can we sleep inside the config_clks() callback?
diff --git a/drivers/opp/core.c b/drivers/opp/core.c index e87567dbe99f..b7158d33c13d 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1384,20 +1384,6 @@ static struct opp_table *_update_opp_table_clk(struct device *dev, } if (ret == -ENOENT) { - /* - * There are few platforms which don't want the OPP core to - * manage device's clock settings. In such cases neither the - * platform provides the clks explicitly to us, nor the DT - * contains a valid clk entry. The OPP nodes in DT may still - * contain "opp-hz" property though, which we need to parse and - * allow the platform to find an OPP based on freq later on. - * - * This is a simple solution to take care of such corner cases, - * i.e. make the clk_count 1, which lets us allocate space for - * frequency in opp->rates and also parse the entries in DT. - */ - opp_table->clk_count = 1; - dev_dbg(dev, "%s: Couldn't find clock: %d\n", __func__, ret); return opp_table; } diff --git a/drivers/opp/debugfs.c b/drivers/opp/debugfs.c index 96a30a032c5f..402c507edac7 100644 --- a/drivers/opp/debugfs.c +++ b/drivers/opp/debugfs.c @@ -138,7 +138,7 @@ void opp_debug_create_one(struct dev_pm_opp *opp, struct opp_table *opp_table) * - For some devices rate isn't available or there are multiple, use * index instead for them. */ - if (likely(opp_table->clk_count == 1 && opp->rates[0])) + if (likely(opp_table->clk_count == 1)) id = opp->rates[0]; else id = _get_opp_count(opp_table);