lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9c9c374c-3c4f-f2d4-93e6-751176e8d493@codeaurora.org>
Date:   Sat, 17 Oct 2020 00:10:45 +0530
From:   Taniya Das <tdas@...eaurora.org>
To:     Stephen Boyd <sboyd@...nel.org>,
        Michael Turquette <mturquette@...libre.com>
Cc:     David Brown <david.brown@...aro.org>,
        Rajendra Nayak <rnayak@...eaurora.org>,
        linux-arm-msm@...r.kernel.org, linux-soc@...r.kernel.org,
        linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
        Andy Gross <agross@...nel.org>, devicetree@...r.kernel.org,
        robh@...nel.org, robh+dt@...nel.org
Subject: Re: [PATCH v2 3/3] clk: qcom: camcc: Add camera clock controller
 driver for SC7180

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.

--

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ