From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDE5AC388F9 for ; Wed, 11 Nov 2020 11:05:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D613206D9 for ; Wed, 11 Nov 2020 11:05:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jda6UKtJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D613206D9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bzhR55ODLry/2rEQeeD9OwCo09mLfC9xISNy6MkEC94=; b=jda6UKtJLVeF/334ztBWQgpBe zxSjDmsETc+99oDH7BHAiNUuY/IVURiNK1GxlSOoV3zpChqZgGUA5uV2XdzBFTj+QkCAstIW7ksX/ qjnDlMpGiwWDN9WM0pnxDeVp6aSxHrTLWNraIOPYmcBfVpgn2Ya3w/cHbwZhO9SE6aSK1kgsleLWJ hZQkIMGphfwXrQsne5v1YtiyN3qHfCNTGohUhzXCkX/l9/Fg4bnA29TYRLVj/Pd3kg5c3zUWYRZcz V2UIIClkVdSkrsB9hC1FnESCZBnIVP2+Lsz/NHN8Ld9i23tiOaJ1npB+878iHIA/bKlrvIizpSjAN o1ZipcqPA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcnwH-0002hW-47; Wed, 11 Nov 2020 11:05:21 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcnwE-0002gf-Eb for linux-arm-kernel@lists.infradead.org; Wed, 11 Nov 2020 11:05:19 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 42892101E; Wed, 11 Nov 2020 03:05:16 -0800 (PST) Received: from bogus (unknown [10.57.15.107]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D3A53F7BB; Wed, 11 Nov 2020 03:05:15 -0800 (PST) Date: Wed, 11 Nov 2020 11:05:13 +0000 From: Sudeep Holla To: Viresh Kumar Subject: Re: [PATCH] cpufreq: scmi: Fix OPP addition failure with a dummy clock provider Message-ID: <20201111110513.but7tzvmkoxqmwlb@bogus> References: <20201110111040.280231-1-sudeep.holla@arm.com> <20201110112414.abrqtf4v76sth54m@vireshk-i7> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201110112414.abrqtf4v76sth54m@vireshk-i7> User-Agent: NeoMutt/20171215 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201111_060518_897710_06963B91 X-CRM114-Status: GOOD ( 25.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sudeep Holla , "Rafael J . Wysocki" , Cristian Marussi , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 10, 2020 at 04:54:14PM +0530, Viresh Kumar wrote: > On 10-11-20, 11:10, Sudeep Holla wrote: > > Commit dd461cd9183f ("opp: Allow dev_pm_opp_get_opp_table() to return > > -EPROBE_DEFER") handles -EPROBE_DEFER for the clock/interconnects within > > _allocate_opp_table() which is called from dev_pm_opp_add and it > > now propagates the error back to the caller. > > > > SCMI performance domain re-used clock bindings to keep it simple. However > > with the above mentioned change, if clock property is present in a device > > node, opps fails to get added with below errors until clk_get succeeds. > > > > cpu0: failed to add opp 450000000Hz > > cpu0: failed to add opps to the device > > ....(errors on cpu1-cpu4) > > cpu5: failed to add opp 450000000Hz > > cpu5: failed to add opps to the device > > > > So, in order to fix the issue, we need to register dummy clock provider. > > With the dummy clock provider, clk_get returns NULL(no errors!), then opp > > core proceeds to add OPPs for the CPUs. > > > > Cc: Rafael J. Wysocki > > Cc: Viresh Kumar > > Fixes: dd461cd9183f ("opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER") > > Signed-off-by: Sudeep Holla > > --- > > drivers/cpufreq/scmi-cpufreq.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c > > index e855e8612a67..78318508a6d6 100644 > > --- a/drivers/cpufreq/scmi-cpufreq.c > > +++ b/drivers/cpufreq/scmi-cpufreq.c > > @@ -8,6 +8,7 @@ > > > > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > > > > +#include > > #include > > #include > > #include > > @@ -228,12 +229,17 @@ static struct cpufreq_driver scmi_cpufreq_driver = { > > static int scmi_cpufreq_probe(struct scmi_device *sdev) > > { > > int ret; > > + struct device *dev = &sdev->dev; > > > > handle = sdev->handle; > > > > if (!handle || !handle->perf_ops) > > return -ENODEV; > > > > + /* dummy clock provider as needed by OPP if clocks property is used */ > > + if (of_find_property(dev->of_node, "#clock-cells", NULL)) > > + devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL); > > + > > ret = cpufreq_register_driver(&scmi_cpufreq_driver); > > if (ret) { > > dev_err(&sdev->dev, "%s: registering cpufreq failed, err: %d\n", > > For 5.10-rc. > > Acked-by: Viresh Kumar > Thanks Viresh, I assume Rafael will take this directly as fix for v5.10 -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel