linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taniya Das <tdas@codeaurora.org>
To: Stephen Boyd <sboyd@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>
Cc: David Brown <david.brown@linaro.org>,
	Rajendra Nayak <rnayak@codeaurora.org>,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andy Gross <agross@kernel.org>,
	devicetree@vger.kernel.org, robh@kernel.org, robh+dt@kernel.org
Subject: Re: [PATCH v2 3/3] clk: qcom: camcc: Add camera clock controller driver for SC7180
Date: Sat, 17 Oct 2020 00:10:45 +0530	[thread overview]
Message-ID: <9c9c374c-3c4f-f2d4-93e6-751176e8d493@codeaurora.org> (raw)
In-Reply-To: <160264075146.310579.8765964662995263828@swboyd.mtv.corp.google.com>

Thanks for your review Stephen.

On 10/14/2020 7:29 AM, Stephen Boyd wrote:
> Quoting Taniya Das (2020-10-13 10:11:50)
>> diff --git a/drivers/clk/qcom/camcc-sc7180.c b/drivers/clk/qcom/camcc-sc7180.c
>> new file mode 100644
>> index 0000000..e954d21
>> --- /dev/null
>> +++ b/drivers/clk/qcom/camcc-sc7180.c
>> @@ -0,0 +1,1737 @@
> [...]
>> +
>> +enum {
>> +       P_BI_TCXO,
>> +       P_CAM_CC_PLL0_OUT_EVEN,
>> +       P_CAM_CC_PLL1_OUT_EVEN,
>> +       P_CAM_CC_PLL2_OUT_AUX,
>> +       P_CAM_CC_PLL2_OUT_EARLY,
>> +       P_CAM_CC_PLL3_OUT_MAIN,
>> +       P_CORE_BI_PLL_TEST_SE,
>> +};
>> +
>> +static struct pll_vco agera_vco[] = {
> 
> Can this be const?
> 
>> +       { 600000000, 3300000000, 0 },
>> +};
>> +
>> +static struct pll_vco fabia_vco[] = {
> 
> Can this be const?
> 
>> +       { 249600000, 2000000000, 0 },
>> +};
>> +
> [...]

Will take care of the above in the next patch.

>> +
>> +static int cam_cc_sc7180_probe(struct platform_device *pdev)
>> +{
>> +       struct regmap *regmap;
>> +       int ret;
>> +
>> +       pm_runtime_enable(&pdev->dev);
>> +       ret = pm_clk_create(&pdev->dev);
>> +       if (ret)
>> +               return ret;
>> +
>> +       ret = pm_clk_add(&pdev->dev, "xo");
>> +       if (ret < 0) {
>> +               dev_err(&pdev->dev, "Failed to acquire XO clock\n");
>> +               goto disable_pm_runtime;
>> +       }
>> +
>> +       ret = pm_clk_add(&pdev->dev, "iface");
>> +       if (ret < 0) {
>> +               dev_err(&pdev->dev, "Failed to acquire iface clock\n");
>> +               goto disable_pm_runtime;
>> +       }
>> +
>> +       ret = pm_clk_runtime_resume(&pdev->dev);
>> +       if (ret) {
>> +               dev_err(&pdev->dev, "pm runtime resume failed\n");
>> +               goto destroy_pm_clk;
>> +       }
>> +
>> +       regmap = qcom_cc_map(pdev, &cam_cc_sc7180_desc);
>> +       if (IS_ERR(regmap)) {
>> +               ret = PTR_ERR(regmap);
>> +               goto destroy_pm_clk;
>> +       }
>> +
>> +       clk_fabia_pll_configure(&cam_cc_pll0, regmap, &cam_cc_pll0_config);
>> +       clk_fabia_pll_configure(&cam_cc_pll1, regmap, &cam_cc_pll1_config);
>> +       clk_agera_pll_configure(&cam_cc_pll2, regmap, &cam_cc_pll2_config);
>> +       clk_fabia_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config);
>> +
>> +       ret = qcom_cc_really_probe(pdev, &cam_cc_sc7180_desc, regmap);
>> +       if (ret) {
>> +               dev_err(&pdev->dev, "Failed to register CAM CC clocks\n");
>> +               goto suspend_pm_runtime;
> 
> ret is non-zero here
> 
>> +       }
>> +
>> +suspend_pm_runtime:
>> +       ret = pm_clk_runtime_suspend(&pdev->dev);
> 
> But then it is overwritten here.
> 
>> +       if (ret)
>> +               dev_err(&pdev->dev, "pm runtime suspend failed\n");
>> +
>> +       return 0;
> 
> And we return 0 when there was a failure to probe the clks?
> 

I will clean the error path in the next patch.

>> +
>> +destroy_pm_clk:
>> +       pm_clk_destroy(&pdev->dev);
>> +
>> +disable_pm_runtime:
>> +       pm_runtime_disable(&pdev->dev);
>> +
>> +       return ret;
>> +}

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation.

--

      reply	other threads:[~2020-10-16 18:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 17:11 [PATCH v2 0/3] Add Camera clock controller driver for SC7180 Taniya Das
2020-10-13 17:11 ` [PATCH v2 1/3] clk: qcom: clk-alpha-pll: Add support for controlling Agera PLLs Taniya Das
2020-10-14  2:07   ` Stephen Boyd
2020-10-16 18:38     ` Taniya Das
2020-10-13 17:11 ` [PATCH v2 2/3] dt-bindings: clock: Add YAML schemas for the QCOM Camera clock bindings Taniya Das
2020-10-14  2:09   ` Stephen Boyd
2020-10-16 18:39     ` Taniya Das
2020-10-16 17:25   ` Rob Herring
2020-10-13 17:11 ` [PATCH v2 3/3] clk: qcom: camcc: Add camera clock controller driver for SC7180 Taniya Das
2020-10-14  1:59   ` Stephen Boyd
2020-10-16 18:40     ` Taniya Das [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9c9c374c-3c4f-f2d4-93e6-751176e8d493@codeaurora.org \
    --to=tdas@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=rnayak@codeaurora.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).