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=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 5E86AC43381 for ; Wed, 13 Mar 2019 16:36:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28DD72146E for ; Wed, 13 Mar 2019 16:36:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726872AbfCMQgW (ORCPT ); Wed, 13 Mar 2019 12:36:22 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:42669 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfCMQgT (ORCPT ); Wed, 13 Mar 2019 12:36:19 -0400 Received: from localhost (alyon-652-1-66-9.w109-213.abo.wanadoo.fr [109.213.209.9]) (Authenticated sender: gregory.clement@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 9191620000E; Wed, 13 Mar 2019 16:36:12 +0000 (UTC) From: Gregory CLEMENT To: Stephen Boyd , Mike Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org, Christian Neubert , Ilias Apalodimas , Vincent Guittot , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Gregory CLEMENT , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, Antoine Tenart , =?UTF-8?q?Miqu=C3=A8l=20Raynal?= , Maxime Chevallier , stable@vger.kernel.org Subject: [PATCH] clk: mvebu: armada-37xx-periph: Fix initialization for cpu clocks Date: Wed, 13 Mar 2019 17:35:58 +0100 Message-Id: <20190313163558.6705-1-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The clock parenting was not setup properly when DVFS was enabled. It was expected that the same clock source was used with and without DVFS which was not the case. This patch fixes this issue, allowing to make the cpufreq support work when the CPU clocks source are not the default ones. Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx") Cc: Reported-by: Christian Neubert Reported-by: Ilias Apalodimas Signed-off-by: Gregory CLEMENT --- drivers/clk/mvebu/armada-37xx-periph.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c index 1f1cff428d78..26ed3c18a239 100644 --- a/drivers/clk/mvebu/armada-37xx-periph.c +++ b/drivers/clk/mvebu/armada-37xx-periph.c @@ -671,6 +671,17 @@ static int armada_3700_add_composite_clk(const struct clk_periph_data *data, map = syscon_regmap_lookup_by_compatible( "marvell,armada-3700-nb-pm"); pmcpu_clk->nb_pm_base = map; + + /* + * Use the same parent when DVFS is enabled that the + * default parent received at boot time. When this + * function is called, DVFS is not enabled yet, so we + * get the default parent and we can set the parent + * for DVFS. + */ + if (clk_pm_cpu_set_parent(muxrate_hw, + clk_pm_cpu_get_parent(muxrate_hw))) + dev_warn(dev, "Failed to setup default parent clock for DVFS\n"); } *hw = clk_hw_register_composite(dev, data->name, data->parent_names, -- 2.20.1 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=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 50901C43381 for ; Wed, 13 Mar 2019 16:36:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 1A2EB2146E for ; Wed, 13 Mar 2019 16:36:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QQyfceSL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A2EB2146E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=g8p+hrM/apruhM8CqNbBNms3sJJNJ9rSQgUV8Evqse8=; b=QQyfceSL2i/ZDa cRlTUv2w46PTXU1PswCwHUmHPNq9ABKiHwjhNkY6WbSMUSio3LQp8d1sbcUmFZD+vwvu9eL1tL2MI /3AcE3Tc4FmNROZHW2A/AQdSX4z4c5dV90dMGckL19WVjv8oke/olYhWFxiQD0h7uFC6hPq27qauv 0Evbp0utne3NUCV3ol/3n8wFkKOZLYWYDdR9V38VhSgzMESAaHoJGp4dUbhulmaTY57pWpAnyV0dX sZV7IMbFAzQheg3NrYbm+BR0nCEtwIqXiKVelBrb3gHE2fBTB41aEW3ulVd0wA2FDG2Mqtvrdwazy Cw1R9CZLLJLkGM3nQOyw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h46rp-00048Y-Tn; Wed, 13 Mar 2019 16:36:33 +0000 Received: from relay12.mail.gandi.net ([217.70.178.232]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h46rm-00047j-1T for linux-arm-kernel@lists.infradead.org; Wed, 13 Mar 2019 16:36:31 +0000 Received: from localhost (alyon-652-1-66-9.w109-213.abo.wanadoo.fr [109.213.209.9]) (Authenticated sender: gregory.clement@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 9191620000E; Wed, 13 Mar 2019 16:36:12 +0000 (UTC) From: Gregory CLEMENT To: Stephen Boyd , Mike Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: mvebu: armada-37xx-periph: Fix initialization for cpu clocks Date: Wed, 13 Mar 2019 17:35:58 +0100 Message-Id: <20190313163558.6705-1-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190313_093630_232741_EEB927E1 X-CRM114-Status: GOOD ( 11.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Vincent Guittot , Jason Cooper , Christian Neubert , Antoine Tenart , Viresh Kumar , linux-pm@vger.kernel.org, Ilias Apalodimas , "Rafael J. Wysocki" , stable@vger.kernel.org, Maxime Chevallier , Thomas Petazzoni , =?UTF-8?q?Miqu=C3=A8l=20Raynal?= , Gregory CLEMENT , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org The clock parenting was not setup properly when DVFS was enabled. It was expected that the same clock source was used with and without DVFS which was not the case. This patch fixes this issue, allowing to make the cpufreq support work when the CPU clocks source are not the default ones. Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx") Cc: Reported-by: Christian Neubert Reported-by: Ilias Apalodimas Signed-off-by: Gregory CLEMENT --- drivers/clk/mvebu/armada-37xx-periph.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c index 1f1cff428d78..26ed3c18a239 100644 --- a/drivers/clk/mvebu/armada-37xx-periph.c +++ b/drivers/clk/mvebu/armada-37xx-periph.c @@ -671,6 +671,17 @@ static int armada_3700_add_composite_clk(const struct clk_periph_data *data, map = syscon_regmap_lookup_by_compatible( "marvell,armada-3700-nb-pm"); pmcpu_clk->nb_pm_base = map; + + /* + * Use the same parent when DVFS is enabled that the + * default parent received at boot time. When this + * function is called, DVFS is not enabled yet, so we + * get the default parent and we can set the parent + * for DVFS. + */ + if (clk_pm_cpu_set_parent(muxrate_hw, + clk_pm_cpu_get_parent(muxrate_hw))) + dev_warn(dev, "Failed to setup default parent clock for DVFS\n"); } *hw = clk_hw_register_composite(dev, data->name, data->parent_names, -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel