From patchwork Mon Nov 25 13:59:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 180156 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3187872ilf; Mon, 25 Nov 2019 05:59:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwH8Kl/W5S0CfWOoKF9M2H7bemLEidH+yjf7nb0wppNRh8SsiCQR25Lq+2CP7rMnoti7JVM X-Received: by 2002:a17:906:d052:: with SMTP id bo18mr37768348ejb.128.1574690361645; Mon, 25 Nov 2019 05:59:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574690361; cv=none; d=google.com; s=arc-20160816; b=kyB4dIU2acSfgnK9iIT0xvS4BpmN4fREmih02Mw+MvjGijLm0BG2W0E2s718IeIFVO xkv0qRm0njrVw1iIaUy+JX5Ur3HARhsMTSmYiH6qacCKECBSikAblJQWdhHUnuRPeo+V 4LsbkcSNokogINzW9UehQAhzIrEtOlkL+b3iUrWfpwUmSZoj7oywjsv964xqJK83oQhd Jkg0rqTdw9GI2KXHc3yLLq7bdBpT28xF1N3DlI3YpKvNz+fK1aNgi8KgJl1GpSLrw/qg 2JF7/+XyXYquDYKIi7v8gLw29RgijCraL7F3QlIS116aebtFcOJI1ObU7i/2S6ncL6s5 9qVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UyfsDOjViaLy31rOpDuIJP2/tnh70uuMePmLyotTbkw=; b=ei52gQGeroroFSlp8+WSuA1fgRBEOjwpteldoXrrckcAWrPsTyo5WsOI9i43mKzhy+ G81s96bSh0Y2ZHe+ciKtA/P+g/UXFCE2vlQNV9y/fDFGOdHls0zmhlsiBZyZxCMfr6ZS /sSaT6aXO8kD9vgnSNz4GHA3I1lfqHqmLAMXwxC8X51ygyjhxbc6SfayLBy2bqKwg+hw VS1kHmIyidK1HEh1iFxbM8AgBKFSMQyibAkMaKaFTaY08WviaOnZj9FfY6dcDHZeCRMG TxGjZKXK5mm2i/PtxIrR2ThCtLZZd68mmp/cAB/g4prjWX4Jj5TVEBx8A94kS6evjjFs kcCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MHDvRHjk; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hh7si4535772ejb.57.2019.11.25.05.59.21; Mon, 25 Nov 2019 05:59:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MHDvRHjk; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1727869AbfKYN7S (ORCPT + 15 others); Mon, 25 Nov 2019 08:59:18 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:39039 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727666AbfKYN7R (ORCPT ); Mon, 25 Nov 2019 08:59:17 -0500 Received: by mail-lf1-f68.google.com with SMTP id f18so11087613lfj.6 for ; Mon, 25 Nov 2019 05:59:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UyfsDOjViaLy31rOpDuIJP2/tnh70uuMePmLyotTbkw=; b=MHDvRHjkJIFUfMfGegrgrKlpv2zmfBLohiOLgx4UIyE3n0riOQHx0+AxlRvu1q3eHT S1AtdURFgmdpIPgJ7Jt2UK95EnVyTpKWD53sQMm4saA3p1Wd5XW65dWl0j69khJJ1x9w W3AJkht1Xclp90KZZRtanNu5SNy5FKDpU+cJ+uWbUVsQM8mqJ5IVJPinTI6v52fySDiO dai+VItWn95ik4QZJvLT+WpGGcVYcJ3aMFL9evIZC+FN1iXfnmBCM3ll1SEkcmRChedn kSv3FSkifhhu9wjRMdYpeegX9xx5TwfRxzlTzj06ZGM1K6bBInBBg+H0jNENGb4a+fxH AZpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UyfsDOjViaLy31rOpDuIJP2/tnh70uuMePmLyotTbkw=; b=c5galsTK7qp3/7Pxk6h4rr4Z4hSHQxdlFmL7Fprnc4oey3qMsHysuOMzucTRNLBq9V T6cgpPr8czgSbxrRi2Wy3JU0Mq5ZgtBckH7h9W0mTCCAgzEu+E8wlSkE9WZ22qL1A0WW K/QsqzojhXiMKh+1ldV4s1ABeNQviv3BXJwg/eLE9AVfVqpb9D8gCjHY+5bxhBzQBo83 9R0aX4cJ1lvINkVrqp1Wd6LfPeDALKQGOQQOwKjNjLZM7w+R8SCIxebkOlh/sG4yjeAu EZiR1F3fHrhKHGUvR9dw9GrbuECk7ajBj0Rn21VOSqmqqGzwBa6RC0R76BQRowKA2i1D Ouew== X-Gm-Message-State: APjAAAWt/Rzt4wp6bYPKP+SltLu1sPkLwFEn0TMAn4owSFpu9zMnOiYT /lUdC7/XifGnj0Ok0fEAAk3lllb87KLl3A== X-Received: by 2002:a19:520b:: with SMTP id m11mr20364369lfb.77.1574690355801; Mon, 25 Nov 2019 05:59:15 -0800 (PST) Received: from centauri.lan (ua-84-217-220-205.bbcust.telenor.se. [84.217.220.205]) by smtp.gmail.com with ESMTPSA id w71sm4189705lff.0.2019.11.25.05.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2019 05:59:15 -0800 (PST) From: Niklas Cassel To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, amit.kucheria@linaro.org, sboyd@kernel.org, Jorge Ramirez-Ortiz , Niklas Cassel , Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/7] clk: qcom: gcc: limit GPLL0_AO_OUT operating frequency Date: Mon, 25 Nov 2019 14:59:04 +0100 Message-Id: <20191125135910.679310-3-niklas.cassel@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191125135910.679310-1-niklas.cassel@linaro.org> References: <20191125135910.679310-1-niklas.cassel@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Jorge Ramirez-Ortiz Limit the GPLL0_AO_OUT_MAIN operating frequency as per its hardware specifications. Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Bjorn Andersson Acked-by: Stephen Boyd --- Changes since v2: -None drivers/clk/qcom/clk-alpha-pll.c | 8 ++++++++ drivers/clk/qcom/clk-alpha-pll.h | 1 + drivers/clk/qcom/gcc-qcs404.c | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) -- 2.23.0 diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index 055318f97991..9228b7b1f56e 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -878,6 +878,14 @@ static long clk_trion_pll_round_rate(struct clk_hw *hw, unsigned long rate, return clamp(rate, min_freq, max_freq); } +const struct clk_ops clk_alpha_pll_fixed_ops = { + .enable = clk_alpha_pll_enable, + .disable = clk_alpha_pll_disable, + .is_enabled = clk_alpha_pll_is_enabled, + .recalc_rate = clk_alpha_pll_recalc_rate, +}; +EXPORT_SYMBOL_GPL(clk_alpha_pll_fixed_ops); + const struct clk_ops clk_alpha_pll_ops = { .enable = clk_alpha_pll_enable, .disable = clk_alpha_pll_disable, diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h index 15f27f4b06df..c28eb1a08c0c 100644 --- a/drivers/clk/qcom/clk-alpha-pll.h +++ b/drivers/clk/qcom/clk-alpha-pll.h @@ -109,6 +109,7 @@ struct alpha_pll_config { }; extern const struct clk_ops clk_alpha_pll_ops; +extern const struct clk_ops clk_alpha_pll_fixed_ops; extern const struct clk_ops clk_alpha_pll_hwfsm_ops; extern const struct clk_ops clk_alpha_pll_postdiv_ops; extern const struct clk_ops clk_alpha_pll_huayra_ops; diff --git a/drivers/clk/qcom/gcc-qcs404.c b/drivers/clk/qcom/gcc-qcs404.c index 9b0c4ce2ef4e..46d314d69250 100644 --- a/drivers/clk/qcom/gcc-qcs404.c +++ b/drivers/clk/qcom/gcc-qcs404.c @@ -330,7 +330,7 @@ static struct clk_alpha_pll gpll0_ao_out_main = { .parent_names = (const char *[]){ "cxo" }, .num_parents = 1, .flags = CLK_IS_CRITICAL, - .ops = &clk_alpha_pll_ops, + .ops = &clk_alpha_pll_fixed_ops, }, }, }; From patchwork Mon Nov 25 13:59:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 180157 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3188183ilf; Mon, 25 Nov 2019 05:59:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyvlU6OeCZlxjH64jHFB4X6guqUim+bcwyAJh2s5BpMqOLwzd4vc7j7OI1SmlXmvkRbXo1/ X-Received: by 2002:a17:906:c293:: with SMTP id r19mr37021643ejz.69.1574690376072; Mon, 25 Nov 2019 05:59:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574690376; cv=none; d=google.com; s=arc-20160816; b=KvWZ6/Bs8ydKYDTPW5cw0Z5kzdhJOAenW/OVBIkwd5q2NhaRAYaAfOeyApGiZn476j LLQXlPsvpCh9KwICLujGMT1JoMOEv/9NyzZ5gm3f5U++i4AW8HUSO57KdK9TdaTL5Ng0 JwACnmkzdEYgWKKv5dpGvyo7gDAjUqTdQA7tkLiNdmove0Dv/y8DksB2X5iAne0FyFgk zT+GhvoWHuIDoQ8ugx4y2wzcFpjFsJioi3ljcHy7fx6Nrju1mKv1FO9+TAxamiGlfSQE gH7RXlYoG3/6ueNvmbdC+TbCQwFuwac2Gn/n9392IJPQuKiVokNJpAir/fWhwZHnzdMm Se9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mFx2G6rwu7kpdvcXD41l6BM92KOVYIpnpySewMnY058=; b=K+0/EfT8AKscqAM4sHYiRlF0c7pu1wSdHSui8o9UAa8bMDCSSgIi0X5PPobWim5mrm 6azBkUD49dY7Dbg5/1/kXbtAbcPvuf4in7tOFj4uF9CwDcB8APuOk1shXxJn75lE9c/s kn0EaLvC0bLriIVXAzhevzYMEhN4oahmRpqs7y6WgCB4bn/98yg55aSfcvte5h8m76YN EABbqL51JbXLxPE8uF93Yfy9x8a+SF9nI2zY3DtSPnsKMT2kMCw3cibgspc2qdOny5Fg IvwUe1SZYR0Qs0lkKpWkgUnVq1TktENckFwFNhpaD2RPXThVEaVKf4BZK1y9PapksfUF Hbbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zmgWdTfe; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10si5105709edv.360.2019.11.25.05.59.35; Mon, 25 Nov 2019 05:59:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zmgWdTfe; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1727907AbfKYN7e (ORCPT + 15 others); Mon, 25 Nov 2019 08:59:34 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:33372 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727904AbfKYN7e (ORCPT ); Mon, 25 Nov 2019 08:59:34 -0500 Received: by mail-lj1-f195.google.com with SMTP id t5so16005950ljk.0 for ; Mon, 25 Nov 2019 05:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mFx2G6rwu7kpdvcXD41l6BM92KOVYIpnpySewMnY058=; b=zmgWdTfearD+sHjWeRlK/bx0dgy/bakLlEYxv8GGf+siHKTg8Pd29fjMZvoTWR5uS7 Pv7/bI+YTelbau7+aLwKBalnifKR5722jLwOg9/+0nRfFVE4bv7QWmUyupBm123opiZw LzPE7f/aWEugYp1FYSUNUyfZCVWJXnrAwcsjeR3p5f3LWlTfuY3uLWhx4HjaCtjW1INw 3bAMgT0va6MHiOYgdrTP5MQQT0R/aODxvK/vi3aFRW+tojJkrsJPMlMf+gy/UmteOfbF W2/HXRW/Nnod0De3hIAseGbAiGbExUflxWVqtbM9uXV1rjs/qC/1TtDPoiOabAAmvqTQ lzxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mFx2G6rwu7kpdvcXD41l6BM92KOVYIpnpySewMnY058=; b=mWGWPqZjCKFz5Sv5aGxBjtHb1I71UXmDKI1+JEtbi4XRCdLfNhkUNAz4YAdzKvW2ah QUulGynkmcyp+ly8epBvwObNiVFZwju+aw3IwvV139ghXdbO+ax/4PNzfF9ZCgrajOkD fzf/U8ma+hr9iWQ2ndboRXCZOTPRndDwidSKCzbbOzl2an8UPPGzWNqWeO/jx3hZVKa3 RDylrY1JaZsdeg4BOVrUKzlG3X3DYn/Sx4yj9tbDWQ6r+h5dGu35RrPTkp8isjOYMsoO Y/Di2/zAs+gEIXmoogyGrqC6WIC01Zl6wufRCjZfv3xqU+xBR5dY0wzdpte9S4g+8Rx1 rzQQ== X-Gm-Message-State: APjAAAUrMTI55oJFLjNhjtJToa7kUb2Z5qp18yeJuYaVsQCHVNk/CcSi nVoJFPUXD7qR6xOBfopMGCIcwg== X-Received: by 2002:a2e:7016:: with SMTP id l22mr22669006ljc.227.1574690371750; Mon, 25 Nov 2019 05:59:31 -0800 (PST) Received: from centauri.lan (ua-84-217-220-205.bbcust.telenor.se. [84.217.220.205]) by smtp.gmail.com with ESMTPSA id s23sm4041871ljm.20.2019.11.25.05.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2019 05:59:31 -0800 (PST) From: Niklas Cassel To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, amit.kucheria@linaro.org, sboyd@kernel.org, Jorge Ramirez-Ortiz , Niklas Cassel , Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/7] clk: qcom: hfpll: register as clock provider Date: Mon, 25 Nov 2019 14:59:05 +0100 Message-Id: <20191125135910.679310-4-niklas.cassel@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191125135910.679310-1-niklas.cassel@linaro.org> References: <20191125135910.679310-1-niklas.cassel@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Jorge Ramirez-Ortiz Make the output of the high frequency pll a clock provider. On the QCS404 this PLL controls cpu frequency scaling. Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Bjorn Andersson Acked-by: Stephen Boyd --- Changes since v2: -None drivers/clk/qcom/hfpll.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.23.0 diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c index a6de7101430c..e64c0fd82fe4 100644 --- a/drivers/clk/qcom/hfpll.c +++ b/drivers/clk/qcom/hfpll.c @@ -57,6 +57,7 @@ static int qcom_hfpll_probe(struct platform_device *pdev) .num_parents = 1, .ops = &clk_ops_hfpll, }; + int ret; h = devm_kzalloc(dev, sizeof(*h), GFP_KERNEL); if (!h) @@ -79,7 +80,14 @@ static int qcom_hfpll_probe(struct platform_device *pdev) h->clkr.hw.init = &init; spin_lock_init(&h->lock); - return devm_clk_register_regmap(&pdev->dev, &h->clkr); + ret = devm_clk_register_regmap(dev, &h->clkr); + if (ret) { + dev_err(dev, "failed to register regmap clock: %d\n", ret); + return ret; + } + + return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, + &h->clkr.hw); } static struct platform_driver qcom_hfpll_driver = { From patchwork Mon Nov 25 13:59:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 180158 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3188218ilf; Mon, 25 Nov 2019 05:59:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzOCiUmlHsU0gZGSgwqFpoGRTVKYROKYsfofcFddTc9Jj+8GUzOjXsPWhXnUzugXPQSHuOr X-Received: by 2002:a17:906:12d3:: with SMTP id l19mr35625203ejb.165.1574690377241; Mon, 25 Nov 2019 05:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574690377; cv=none; d=google.com; s=arc-20160816; b=tt5TZXmewhhPk9YB0b9Y/+7LdmWanriNwZFNG7gRmDk31tG+pbjSKiRBCQKlJYyxxL hJeXFbyOMYEAtidzAmFf4qgOLhoz9Tpyv/cxEX2OMDaYD0KM2S0nRiQjvLp3NEZBGU1q ObVHWdZvsmuCuWFcv2NWet4iGNULmH0OualeeiQPjIa9c4GeVtmzgW8UwB6BLv4tF4Bb 9jQRbwCKRH4sZn7QFw8hN8RKCRX/Bt8p3RRycl8+IM3lET/1+QxD4ymR0ypFeoKn5nFN oHLvs/zNfo6b7zuXdJYr7u3ddGnUboNnoKPylQzfQb8LwFhR9fnrDWFMLJ+ncoGOZYOt e+HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WZkXKWPlxV38+RGHoXYmkSG5VWJOb6ms6DI9j57Q8ak=; b=0aETkIrbHlTqjPqVd960Wj/gUh4nPMkPRYk/S8FOnjmgYlwJo1ATmQFmSUunpIIdyV 6dSr7g/QG/1U952jYWj0qoNRDTABWOBgXC8Kl0Ti0d7UeDXvk9Ff7vPViafQ2fIuBBMc w9Zeyq6B54ME3gnChiQ57u9p3Zytn4fyALM0jEkXlp7OfdtWnYdRKj7tCa8wId+mjfwL 6MVfs+OIXYC37CNeT+LfLo+WG+mxo4hpIkohtyzvc0LBe+Z7p4g0+rAmbx3EGRsS1aV2 0HnAEJy/iHyh39A8DqVttgtmutYa9/3pJvz8J/RapV1dp4J+q98DEbW3LlPgIJGacG4A t8lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VVW80aUa; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10si5105709edv.360.2019.11.25.05.59.37; Mon, 25 Nov 2019 05:59:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VVW80aUa; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1727922AbfKYN7f (ORCPT + 15 others); Mon, 25 Nov 2019 08:59:35 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:40280 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727901AbfKYN7f (ORCPT ); Mon, 25 Nov 2019 08:59:35 -0500 Received: by mail-lj1-f193.google.com with SMTP id q2so15996705ljg.7 for ; Mon, 25 Nov 2019 05:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WZkXKWPlxV38+RGHoXYmkSG5VWJOb6ms6DI9j57Q8ak=; b=VVW80aUaA6CDpUPPAiJcUsgChOZb4zTH0QwFYFtR7JP+HUKkuPJ+i9XWLXyhyQVr50 AWdwJCtNYXP26uSH5xqPCKA769xOd4tpgEP7RC+Y+aDCtOALI8Gy5Ert/WtaDJkTBXmE ezomzfwvrwM6f761uHxxpEbTxUVd3gNfpLKN6N62wxJrPGGSwne7XIZTga8QNCHC/tQc 9h0HyfzZimccS4kViSljdHy/VnqV6TvXAkwYbDDD7U9GqOZ8IRxnVLx1Ku//fVs1tbRR M+8UCF0XyoGB1sYLNH18gnEXmgTTwYQ0nySr2W0IHkcRyrh2+NsailaBHpPcCEkfAQZq M7hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WZkXKWPlxV38+RGHoXYmkSG5VWJOb6ms6DI9j57Q8ak=; b=FFkJwaq+/JlFDsIsVWMxOChknOSHAVCQ8nthGflVxc25TSwSfzFPQMuYmgda4txnv5 2i1Gqk69IHRUzSeVMwzq+fLL6VOasyP9ilWjnEFA33sVd/0TyYfliRvdiTCJDuWFvnOd qUt7bKPoI+hnMPoDs7Csy7Pu3UdR5R2a5YXAeByIRrM46D6TsDU06zF9wT9F6fnxgLzK 1AXm/0IjlAarlYULBoP7svfQTy+MzbearL0Fv8t/zkwOaqsBdBAkLtfMOckYbqxREkJa I+pKfh5/s1KS/JWumjZ3OPtyeq/DqpVFTfqtQM2EV2SbK3Mp5ym4dKSk5JKQcguU5QAe PU7A== X-Gm-Message-State: APjAAAUOvXIjsYOky90MAffm/R+L4kZnRQsrbF+pfpzelN53sGtKk+Cp FcKO+7b+zXGGk3YzV1isoBsLKg== X-Received: by 2002:a2e:844e:: with SMTP id u14mr9142325ljh.17.1574690373313; Mon, 25 Nov 2019 05:59:33 -0800 (PST) Received: from centauri.lan (ua-84-217-220-205.bbcust.telenor.se. [84.217.220.205]) by smtp.gmail.com with ESMTPSA id s23sm4041871ljm.20.2019.11.25.05.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2019 05:59:32 -0800 (PST) From: Niklas Cassel To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, amit.kucheria@linaro.org, sboyd@kernel.org, Jorge Ramirez-Ortiz , Niklas Cassel , Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/7] clk: qcom: hfpll: CLK_IGNORE_UNUSED Date: Mon, 25 Nov 2019 14:59:06 +0100 Message-Id: <20191125135910.679310-5-niklas.cassel@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191125135910.679310-1-niklas.cassel@linaro.org> References: <20191125135910.679310-1-niklas.cassel@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Jorge Ramirez-Ortiz When COMMON_CLK_DISABLED_UNUSED is set, in an effort to save power and to keep the software model of the clock in line with reality, the framework transverses the clock tree and disables those clocks that were enabled by the firmware but have not been enabled by any device driver. If CPUFREQ is enabled, early during the system boot, it might attempt to change the CPU frequency ("set_rate"). If the HFPLL is selected as a provider, it will then change the rate for this clock. As boot continues, clk_disable_unused_subtree will run. Since it wont find a valid counter (enable_count) for a clock that is actually enabled it will attempt to disable it which will cause the CPU to stop. Notice that in this driver, calls to check whether the clock is enabled are routed via the is_enabled callback which queries the hardware. The following commit, rather than marking the clock critical and forcing the clock to be always enabled, addresses the above scenario making sure the clock is not disabled but it continues to rely on the firmware to enable the clock. Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Bjorn Andersson --- Changes since v2: -None drivers/clk/qcom/hfpll.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.23.0 diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c index e64c0fd82fe4..225c675f6779 100644 --- a/drivers/clk/qcom/hfpll.c +++ b/drivers/clk/qcom/hfpll.c @@ -56,6 +56,13 @@ static int qcom_hfpll_probe(struct platform_device *pdev) .parent_names = (const char *[]){ "xo" }, .num_parents = 1, .ops = &clk_ops_hfpll, + /* + * rather than marking the clock critical and forcing the clock + * to be always enabled, we make sure that the clock is not + * disabled: the firmware remains responsible of enabling this + * clock (for more info check the commit log) + */ + .flags = CLK_IGNORE_UNUSED, }; int ret; From patchwork Mon Nov 25 13:59:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 180159 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3188299ilf; Mon, 25 Nov 2019 05:59:41 -0800 (PST) X-Google-Smtp-Source: APXvYqyaq69A68pjCuWKXAarOmGY0rCEzmgTLtqzzoAF4YVJJb37Okl2bfNHiQfag/fcVJi35cBW X-Received: by 2002:a17:906:4910:: with SMTP id b16mr36925974ejq.133.1574690381370; Mon, 25 Nov 2019 05:59:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574690381; cv=none; d=google.com; s=arc-20160816; b=BT06OPShLxpu+beg22vuyyloJ9P+dgBSYhnSP5Jo14wBeSbmno/e/Gs3S0dZldPExb Sszzf4SpEjK2gqaniULwg+L6kAOeEsbzJrAsrJ29joDPDC8se3NjchWd8bqPCV4TowjE LQauUksiPPq7JDwq6k4s1jhxRxsrpN9waupk1ExY/ujMcHoYwIAfoWWSYyBEK+lQCF1/ eJjHVhn9hmLHDCwtpLF/Rt8aZQCzcsqk8az310hwbcyCe4vu3B6ntzOBA+qKA41b3lb9 Rc1q5+b18NhhbWfJD+arucmtXkUfh6hByZZ1k3VkgawWqEu1PNuMQqfKbu4KCe2wPAy2 uGTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4n0b7csmummMNxZyeaSszKbcnCZgkdyzjnJK7yDR57M=; b=p4eXmnXmlXJfDrxbgiDWPQaphdi/I+UmJJg0y0JgGk4TrXI/EsNFBCui6VEaYxTbcT pliHtkq7r84TnBZXfdIb3KhXoV2n4EEaQdStMOXMCPY1Zip0vfuS+/wnpyC3DEwfG3ec OO3O451SzrERBB9uZI7UQ8k5NNza5UvFUvEOqfpAXlveeaa1ukNqTrOELILxQoqvBrAy 2Ld+4rrasdi1fbbK8e6YRXo6MTWzO6kF54w+IjI2yUcHOOGf+RnkyYCUy//BojDJx5+h 0w2nyDoKrhnSzLn9z9PT4925r1KOb0mmPeDaHIpnw0pQgTL/Rsusoku3J0zhFkuFeVZN uNug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k9ZRUQYD; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si4805871edp.264.2019.11.25.05.59.41; Mon, 25 Nov 2019 05:59:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k9ZRUQYD; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1727722AbfKYN7i (ORCPT + 15 others); Mon, 25 Nov 2019 08:59:38 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:44097 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727901AbfKYN7i (ORCPT ); Mon, 25 Nov 2019 08:59:38 -0500 Received: by mail-lf1-f68.google.com with SMTP id v201so10052144lfa.11 for ; Mon, 25 Nov 2019 05:59:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4n0b7csmummMNxZyeaSszKbcnCZgkdyzjnJK7yDR57M=; b=k9ZRUQYDRGLuJPThscWn5IqxsfcWQDaQNqRK8f+eV8GDXkdsHk7cLxpS1kIb7q/TK9 doPl76pMJCXckPDBFOzdRQr3C7Wi2JVgxyFnVsl7NOXHGiUQoa8fEXoybWLyMiJqjo8U s+pKy6+ty7tBmr8QqFWAzRuvPPvh9/EbUX8nXGO8HBjTHjiK6ciyITdid+9OZI7nLLQe 1jjYyrsMn/ufrJQ4b5A36nNfwz4R/PxnMoNRUGPOUYogvGMIUnC53s5VZFGg2vON5xag tDndGeXXm/WjVSYKyWx9qXaO8zaMxqOaTVUNQhMmGG+vWczNUwpjQBAqquoO3sJ5m7gI n/AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4n0b7csmummMNxZyeaSszKbcnCZgkdyzjnJK7yDR57M=; b=dWdpH/N3BzakPPzh0zYJLqc444F/+XDbk6Dd5V0kz2lfWglMRKVuYlsrdn7FmiXkoU w4l5izzoU/5KmjjxefW9pKYE8MY7OjD7QgJwLU9l9h1CheN46IZZgZ2wBpJp1x/Bkj+n iAuZg5Gx28oBu6p0entpxYm281kxO5lcnYwJWjnH3An7+BnEK8juc24jkWqmOH++CWQV LV09hVRLwyaUOMpHZLMYyR6pAZZLqdc0B/AvxU4ha0ZMY/vsdGJrPIA0HS2BSMdpB3m+ 3pJpptWtoNSfT1nwO933SIGCEQVWcXm++h8HywDjZkY2s7wMXG13mik26OnjSNF1akoK E5GQ== X-Gm-Message-State: APjAAAUOODKCMEFAKKRVQ7ha416IlhgBCdMKZH/vkqUahJ2Kq+7KhbT7 +NN/Pp0k2qhJ1u8uF6bMPmKNKg== X-Received: by 2002:ac2:5305:: with SMTP id c5mr20326251lfh.55.1574690374722; Mon, 25 Nov 2019 05:59:34 -0800 (PST) Received: from centauri.lan (ua-84-217-220-205.bbcust.telenor.se. [84.217.220.205]) by smtp.gmail.com with ESMTPSA id s23sm4041871ljm.20.2019.11.25.05.59.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2019 05:59:34 -0800 (PST) From: Niklas Cassel To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, amit.kucheria@linaro.org, sboyd@kernel.org, Jorge Ramirez-Ortiz , Niklas Cassel , Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/7] clk: qcom: hfpll: use clk_parent_data to specify the parent Date: Mon, 25 Nov 2019 14:59:07 +0100 Message-Id: <20191125135910.679310-6-niklas.cassel@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191125135910.679310-1-niklas.cassel@linaro.org> References: <20191125135910.679310-1-niklas.cassel@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Jorge Ramirez-Ortiz This permits extending the driver to other platforms without having to modify its source code. Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Signed-off-by: Jorge Ramirez-Ortiz --- Changes since v2: -None drivers/clk/qcom/hfpll.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.23.0 diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c index 225c675f6779..5ff7f5a60620 100644 --- a/drivers/clk/qcom/hfpll.c +++ b/drivers/clk/qcom/hfpll.c @@ -53,7 +53,6 @@ static int qcom_hfpll_probe(struct platform_device *pdev) struct regmap *regmap; struct clk_hfpll *h; struct clk_init_data init = { - .parent_names = (const char *[]){ "xo" }, .num_parents = 1, .ops = &clk_ops_hfpll, /* @@ -65,6 +64,7 @@ static int qcom_hfpll_probe(struct platform_device *pdev) .flags = CLK_IGNORE_UNUSED, }; int ret; + struct clk_parent_data pdata = { .index = 0 }; h = devm_kzalloc(dev, sizeof(*h), GFP_KERNEL); if (!h) @@ -83,6 +83,8 @@ static int qcom_hfpll_probe(struct platform_device *pdev) 0, &init.name)) return -ENODEV; + init.parent_data = &pdata; + h->d = &hdata; h->clkr.hw.init = &init; spin_lock_init(&h->lock); From patchwork Mon Nov 25 13:59:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 180160 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3188506ilf; Mon, 25 Nov 2019 05:59:53 -0800 (PST) X-Google-Smtp-Source: APXvYqygIhcfc/rLs5M4/D4aM7kn3Abey1ZnNQ+f0+OZ54Ya3/vFQLkzAsF9ZtL16XzIEJAS8Of0 X-Received: by 2002:aa7:d356:: with SMTP id m22mr18147590edr.170.1574690393724; Mon, 25 Nov 2019 05:59:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574690393; cv=none; d=google.com; s=arc-20160816; b=IOcBQHOVK9VfOGOiS4KKPUOwIPHOPJRIul2nZLEhYvtwbSR2lzqHUfTYgKsA4kDuM3 KpOe/6X6QbSwqIOPPh97fgV9JTgNAH/9FkLM5205kmAGxnGejFgDoonRmL+PuDA+WRjf T0XVipHgZ+Q+S/iiCQyF3cptx7iJYimvgOVvACieGdAASwXJXFH9c+VRkwgnYMNsEcDx 32/LHqR3xlawBrFKW+TfUuyVjBSDqSIUpZ0PUvPXKYOIK5kq3EcDxmpUpbM6LO5TJRVM 4k+DikxDisrA9H4ZE4BZVxvlf5MDg9KpA29aooheKLc9Q8R3Gq2vBKrSuEed7lNTzWjM 9SKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wJXgU1Ng7cyLAs4JFhWANoeuEktL+F9+1MeqR48Alzc=; b=DUmGrXXPGx3xlUGvr4sHNwLL/4O7xhPm7yngPs7Pvn7MCEBG3a3GtBmRw1eIgj1YHD 76+nJxjCBN6m/SAdbrF1O7XPmohxHk8fholOwF6AgLTkaGQASuOqAlkjk+g6ojKomMMF UV7VwfIFjmic3rOb4NEYU4z8g8pydQpy/exKwl2XRBVdKNBtAfKkGbpi40g7JEj3btYZ rAb1zL7aaX8PFu5nqrQSxrFx4LdbPj1O5m0ygo5cZgltL7rouav7PPL6B4Klcpb/FN5+ roPSUET/upoZDQ4mygROXHygW1rTyVC3OECpaDiglIqOqGonjqIJLJFdkUwFoupqxOkN OCtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="jY4XKY/9"; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si4826613ejj.367.2019.11.25.05.59.53; Mon, 25 Nov 2019 05:59:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="jY4XKY/9"; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1727948AbfKYN7x (ORCPT + 15 others); Mon, 25 Nov 2019 08:59:53 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:37549 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727877AbfKYN7w (ORCPT ); Mon, 25 Nov 2019 08:59:52 -0500 Received: by mail-lf1-f67.google.com with SMTP id b20so11111725lfp.4 for ; Mon, 25 Nov 2019 05:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wJXgU1Ng7cyLAs4JFhWANoeuEktL+F9+1MeqR48Alzc=; b=jY4XKY/91dQiNFPe3L28KbxvxKBrbFtLaZUgSfddAtxodbkHZ/5fHWRIsna8DA7F5H miUjEE5uOvc5q98pK6uq7K1CFVeJNxQVGYLF/8tUhfoBQFknfL42uEI3ux8tT8A5SJkE suN+xr+gBO5ofHQDROHoK47oIsE6kTvX5JFZ6+toL498YiRRb8hI9KaVo0gj3KUYIu/c VW/lgGSdP6dhTZ6H4lT2ERz58FjnvUYva+MBYjt+j78jMD0l71zjGKD4vK0IZm/7vdJc hBlSiFQvqSMgCDISmW/RItDQrV9pPchpHpmY89mzDj/9+HBCY6m5NFfi09aA3iJlDMRz 9I9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wJXgU1Ng7cyLAs4JFhWANoeuEktL+F9+1MeqR48Alzc=; b=IT1ay90WqqrZL7epWGjNez44PC0DmR+wxbozbQrI6pQElgkAsEylbNxWOOulPQqVzg 8IjSnmwTw+hR6BE4qDO/PUqXM4Pv0PoagkYco26Gj/CHTeh9eykwu5rIKbC3l3qFRSBr DcKTVx//gQDtMHHUrqd/Iww76xBPBbNSxZ6ijfhMBf48k89YcN7s1rvjvDfFaOCU+KaD SD4j8Z1dyzxBOJJv7A4ajyhRbF8C2lfV+3jnzUICrtEzy+LS8ncie5QR7ov8Tl1Hos60 H4XNd4JDQcO5n1UcGJkxMRTfEuehkgpfRC3VaCF99UDCSk8U481TRIjL7sDpqzRVqA/H 9VMA== X-Gm-Message-State: APjAAAV35IQBtuaFWPWlKRVamgQotENvDRPol7Zu+3mD7r/lWZ2Tm+fb yaVAyExELgeaqM7bscmtPRUBTg== X-Received: by 2002:ac2:5a08:: with SMTP id q8mr20791341lfn.106.1574690390726; Mon, 25 Nov 2019 05:59:50 -0800 (PST) Received: from centauri.lan (ua-84-217-220-205.bbcust.telenor.se. [84.217.220.205]) by smtp.gmail.com with ESMTPSA id g11sm3688529lfb.94.2019.11.25.05.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2019 05:59:50 -0800 (PST) From: Niklas Cassel To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, amit.kucheria@linaro.org, sboyd@kernel.org, Jorge Ramirez-Ortiz , Niklas Cassel , Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/7] clk: qcom: apcs-msm8916: silently error out on EPROBE_DEFER Date: Mon, 25 Nov 2019 14:59:08 +0100 Message-Id: <20191125135910.679310-7-niklas.cassel@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191125135910.679310-1-niklas.cassel@linaro.org> References: <20191125135910.679310-1-niklas.cassel@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Jorge Ramirez-Ortiz If devm_clk_get() fails due to probe deferral, we shouldn't print an error message. Just be silent in this case. Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Signed-off-by: Jorge Ramirez-Ortiz --- Changes since v2: -New patch. (This change was previously part of another patch in this series.) drivers/clk/qcom/apcs-msm8916.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.23.0 diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index a6c89a310b18..46061b3d230e 100644 --- a/drivers/clk/qcom/apcs-msm8916.c +++ b/drivers/clk/qcom/apcs-msm8916.c @@ -79,7 +79,8 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) a53cc->pclk = devm_clk_get(parent, NULL); if (IS_ERR(a53cc->pclk)) { ret = PTR_ERR(a53cc->pclk); - dev_err(dev, "failed to get clk: %d\n", ret); + if (ret != -EPROBE_DEFER) + dev_err(dev, "failed to get clk: %d\n", ret); return ret; } From patchwork Mon Nov 25 13:59:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 180161 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3188578ilf; Mon, 25 Nov 2019 05:59:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxBiRbDKACG3380x+f/drJZoTXkv3S/Jr10N7o8CzhawY9E94mcvDB7Rsh4nvut2oTYZhPv X-Received: by 2002:aa7:d496:: with SMTP id b22mr18614784edr.122.1574690397400; Mon, 25 Nov 2019 05:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574690397; cv=none; d=google.com; s=arc-20160816; b=qrveMW+4iGfsGlZQob9giU0ZEoW8cpeuaX3+M19Bz1Y6yv21i7y3um4ZOxrSV8/m6w YpYJlor6WTXq0xj6pOGgul0Tz/+tfYHFLrQaLER+5TnSlgf6rAVEf8qNQ3QLzKBtf4Em 4e46C4N5vGDBU11xM6ddvsVr9uD1QQXKMAwoG8igE98RLoaUImfyL35vm2lYQOKQXPXm u5ZutsiAX9MA2Ug9li/Aw3vGqiBOvWyMWuWuZHvAY1m2otn//mfnEUInbOpHjP5tYJU6 PdomzqJNTbZMAz2KJSoL7gDUnhizmEu9hN/OoVX3GJt096Vze/Ua+GB4nQT54b9t3o+1 bhhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YXy+WuvOjN2rxo0woDxe37oYVujdXQVJsXHamcAJo8s=; b=SHEFWWw+YqSrZf3zEvgmNSG/+bJ7DU0jFedWzd01DSWJbvZp+JLua8tXLF7jzdtZdY NUATyO8Y5VDtoOINCE0fsyxWyzcq2Mffbgro3kkY7mPCEMceMcsJ1YlJfn3zJfG0HCN2 IASOmZNpFc8YbL/7eMmKX9b4PWn0fvgWDFK/UUzD5NGmOzFFrGDBFVm3XjvF35AjTfUt ZW/7JSq4pDPQQcD82kWTCufLNIEoBnDrACFDcw3Ph2qHAr3PnCYjcFm1zEF5MPoraaIF f2DMnJh27DyN6ysGrBvmatxCq/U6+Fz8UgLd9tu4K5qhk5HQcZ1/rPhhQNCF3KuhpWsz Ddpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pSp7Ol94; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si4403441ejr.119.2019.11.25.05.59.57; Mon, 25 Nov 2019 05:59:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pSp7Ol94; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1727896AbfKYN74 (ORCPT + 15 others); Mon, 25 Nov 2019 08:59:56 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:33530 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727767AbfKYN7y (ORCPT ); Mon, 25 Nov 2019 08:59:54 -0500 Received: by mail-lf1-f65.google.com with SMTP id d6so11128111lfc.0 for ; Mon, 25 Nov 2019 05:59:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YXy+WuvOjN2rxo0woDxe37oYVujdXQVJsXHamcAJo8s=; b=pSp7Ol94mVOT8XSa+yWvPEG7xUJEajtbNYMQyAaZdDVkeRekCsbedXVcnvPoSUieBn P/tLgljfOm7z0c6wH2TS8UMcwLqPFrPDehoM8jVdnnKgc5w77nQdjnB12JytOPc3nA6Q YFbGrKPyq2H15ektCpj8/4MeEJKfOsbPJ87kXqS5OA/cjTkSA/UFHxDEGF6B1DHwe81m GX0fEADDRQHmsdsyhIdT8PmmO9eIXM6DFb0kaYuoPvswX1QUh0EssgW2gXcK+Kqo5ObC +gqngfzNrQqNpk0Ff9kgQoOKZ4mkBd3aJbWNUQUDS/tDesp/kYgGJf8/WgST3sutuVof BqLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YXy+WuvOjN2rxo0woDxe37oYVujdXQVJsXHamcAJo8s=; b=kEeK8jvLiJ3+GexfMEzGk8zroh/vWIkEv774NvFg596cpJMfdKDP7dnm0ffQ1KcTsR J1nr32v9pquK+r7Jo/GTa1vW4q0YXgg/sYv9QVEMv1y9Lkw8Ws0DXh3r4C0u/gAe08Vg bA0BQV5qoVH/fgSuAe4fGGiJfU8HVKxDZS8zp9Ew+HBBgCQiobukoC8bshOcSrs0TYLz A6wqaz1wasvzah6Wcg9eCNul7kzIDP31pO56jtN5uiJe4pN4/T7q5QkrZNcrodh66T/j qXsfh4NVb0rz4jx5+EF/uL89nPl941dYyIHETR2i5ylBFdUXYxUOe/uiM01Rhaa/MYtp Q6qw== X-Gm-Message-State: APjAAAUdrxaEooyhu8VHmajk9P3f1bHLfBq+tPBLuvX8ujuP9CKo1St3 vGYS+YzxM5I7P/atPi3NYKkZPQ== X-Received: by 2002:a19:7d02:: with SMTP id y2mr19657341lfc.86.1574690392148; Mon, 25 Nov 2019 05:59:52 -0800 (PST) Received: from centauri.lan (ua-84-217-220-205.bbcust.telenor.se. [84.217.220.205]) by smtp.gmail.com with ESMTPSA id g11sm3688529lfb.94.2019.11.25.05.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2019 05:59:51 -0800 (PST) From: Niklas Cassel To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, amit.kucheria@linaro.org, sboyd@kernel.org, Niklas Cassel , Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 7/7] clk: qcom: apcs-msm8916: use clk_parent_data to specify the parent Date: Mon, 25 Nov 2019 14:59:09 +0100 Message-Id: <20191125135910.679310-8-niklas.cassel@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191125135910.679310-1-niklas.cassel@linaro.org> References: <20191125135910.679310-1-niklas.cassel@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Allow accessing the parent clock names required for the driver operation by using the device tree node, while falling back to the previous method of using names in the global name space. This permits extending the driver to other platforms without having to modify its source code. Co-developed-by: Jorge Ramirez-Ortiz Signed-off-by: Jorge Ramirez-Ortiz Signed-off-by: Niklas Cassel --- Changes since v2: -Use clk_parent_data when specifying clock parents. drivers/clk/qcom/apcs-msm8916.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) -- 2.23.0 Tested-by: Bjorn Andersson Reviewed-by: Bjorn Andersson diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index 46061b3d230e..bb91644edc00 100644 --- a/drivers/clk/qcom/apcs-msm8916.c +++ b/drivers/clk/qcom/apcs-msm8916.c @@ -19,9 +19,9 @@ static const u32 gpll0_a53cc_map[] = { 4, 5 }; -static const char * const gpll0_a53cc[] = { - "gpll0_vote", - "a53pll", +static const struct clk_parent_data pdata[] = { + { .fw_name = "aux", .name = "gpll0_vote", }, + { .fw_name = "pll", .name = "a53pll", }, }; /* @@ -51,6 +51,19 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) struct clk_init_data init = { }; int ret = -ENODEV; + /* + * This driver is defined by the devicetree binding + * Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt, + * however, this driver is registered as a platform device by + * qcom-apcs-ipc-mailbox.c. Because of this, when this driver + * uses dev_get_regmap() and devm_clk_get(), it has to send the parent + * device as argument. + * When registering with the clock framework, we cannot use this trick, + * since the clock framework always looks at dev->of_node when it tries + * to find parent clock names using clk_parent_data. + */ + dev->of_node = parent->of_node; + regmap = dev_get_regmap(parent, NULL); if (!regmap) { dev_err(dev, "failed to get regmap: %d\n", ret); @@ -62,8 +75,8 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) return -ENOMEM; init.name = "a53mux"; - init.parent_names = gpll0_a53cc; - init.num_parents = ARRAY_SIZE(gpll0_a53cc); + init.parent_data = pdata; + init.num_parents = ARRAY_SIZE(pdata); init.ops = &clk_regmap_mux_div_ops; init.flags = CLK_SET_RATE_PARENT;