On 10/12/2017 12:28 PM, Rajendra Nayak wrote:
We have atleast some instances of ALWAYS_ON gdscs, which need to
be turned ON *before* some clocks within the gdsc domain marked
with a CLK_IS_CRITICAL can be turned ON.
To facilitate this sequence, register the GDCSs (and hence handle
the ALWAYS_ON gdscs) before we register clocks (and handle the
clocks marked as CLK_IS_CRITICAL)
GDSC registration requires the reset controller to be registered before.
So, the ideal sequence of registration should be:
- register reset controller
- register gdscs
- register clocks
With that:
Reviewed-by: Archit Taneja <architt@xxxxxxxxxxxxxx>
> Signed-off-by: Rajendra Nayak <rnayak@xxxxxxxxxxxxxx>
---
drivers/clk/qcom/common.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
index d523991..d7b0b6b 100644
--- a/drivers/clk/qcom/common.c
+++ b/drivers/clk/qcom/common.c
@@ -232,6 +232,22 @@ int qcom_cc_really_probe(struct platform_device *pdev,
size_t num_clks = desc->num_clks;
struct clk_regmap **rclks = desc->clks;
+ if (desc->gdscs && desc->num_gdscs) {
+ scd = devm_kzalloc(dev, sizeof(*scd), GFP_KERNEL);
+ if (!scd)
+ return -ENOMEM;
+ scd->dev = dev;
+ scd->scs = desc->gdscs;
+ scd->num = desc->num_gdscs;
+ ret = gdsc_register(scd, &reset->rcdev, regmap);
+ if (ret)
+ return ret;
+ ret = devm_add_action_or_reset(dev, qcom_cc_gdsc_unregister,
+ scd);
+ if (ret)
+ return ret;
+ }
+
cc = devm_kzalloc(dev, sizeof(*cc), GFP_KERNEL);
if (!cc)
return -ENOMEM;
@@ -276,22 +292,6 @@ int qcom_cc_really_probe(struct platform_device *pdev,
if (ret)
return ret;
- if (desc->gdscs && desc->num_gdscs) {
- scd = devm_kzalloc(dev, sizeof(*scd), GFP_KERNEL);
- if (!scd)
- return -ENOMEM;
- scd->dev = dev;
- scd->scs = desc->gdscs;
- scd->num = desc->num_gdscs;
- ret = gdsc_register(scd, &reset->rcdev, regmap);
- if (ret)
- return ret;
- ret = devm_add_action_or_reset(dev, qcom_cc_gdsc_unregister,
- scd);
- if (ret)
- return ret;
- }
-
return 0;
}
EXPORT_SYMBOL_GPL(qcom_cc_really_probe);
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html