linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] clk: qcom: msm8996: handle mmagic gdscs and clocks
@ 2018-03-23  8:26 Rajendra Nayak
  2018-03-23  8:26 ` [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs Rajendra Nayak
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Rajendra Nayak @ 2018-03-23  8:26 UTC (permalink / raw)
  To: sboyd, mturquette
  Cc: linux-arm-msm, linux-clk, stanimir.varbanov, vivek.gautam,
	srinivas.kandagatla, Rajendra Nayak

This is a respin of v1 with minor updates since this series is still
needed for most multimedia usescases to work on msm8996.

With no bus driver to handle the mmagic bus clocks and gdscs on msm8996,
its best to just turn them all ON at gdsc/clk driver probe and leave
them ON thereafter. This should unblock a lot of multimedia support on
msm8996 which rely on these to be ON and have no way to control them at
this point. Once we do have better noc/bus management drivers in place
we can avoid leaving these ON always and turn them ON/OFF as needed.

Rajendra Nayak (3):
  clk: qcom: gdsc: Add support for ALWAYS_ON gdscs
  clk: qcom: Register the gdscs before the clocks
  clk: qcom: mmcc-msm8996: leave all mmagic gdscs and clocks always
    enabled

 drivers/clk/qcom/common.c       | 32 ++++++++++++++++----------------
 drivers/clk/qcom/gcc-msm8996.c  |  2 +-
 drivers/clk/qcom/gdsc.c         |  8 ++++++++
 drivers/clk/qcom/gdsc.h         |  1 +
 drivers/clk/qcom/mmcc-msm8996.c | 22 +++++++++++-----------
 5 files changed, 37 insertions(+), 28 deletions(-)

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs
  2018-03-23  8:26 [PATCH v2 0/3] clk: qcom: msm8996: handle mmagic gdscs and clocks Rajendra Nayak
@ 2018-03-23  8:26 ` Rajendra Nayak
  2018-05-25 18:18   ` Bjorn Andersson
                     ` (2 more replies)
  2018-03-23  8:26 ` [PATCH v2 2/3] clk: qcom: Register the gdscs before the clocks Rajendra Nayak
  2018-03-23  8:26 ` [PATCH v2 3/3] clk: qcom: mmcc-msm8996: leave all mmagic gdscs and clocks always enabled Rajendra Nayak
  2 siblings, 3 replies; 12+ messages in thread
From: Rajendra Nayak @ 2018-03-23  8:26 UTC (permalink / raw)
  To: sboyd, mturquette
  Cc: linux-arm-msm, linux-clk, stanimir.varbanov, vivek.gautam,
	srinivas.kandagatla, Rajendra Nayak

Some GDSCs might have software control to turn them off, but we might
want to keep them enabled always, in some cases because of lack of
support in kernel to handle a graceful turning off/on of such GDSCs.
Most common instances would be the GDCSs which power up the noc/bus
fabrics, which need bus drivers to handle them and atleast support for
which is missing on all qcom SoCs.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
---
 drivers/clk/qcom/gdsc.c | 8 ++++++++
 drivers/clk/qcom/gdsc.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c
index a4f3580587b7..15f4bb5efd68 100644
--- a/drivers/clk/qcom/gdsc.c
+++ b/drivers/clk/qcom/gdsc.c
@@ -291,6 +291,14 @@ static int gdsc_init(struct gdsc *sc)
 	if ((sc->flags & VOTABLE) && on)
 		gdsc_enable(&sc->pd);
 
+	/* If ALWAYS_ON GDSCs are not ON, turn them ON */
+	if (sc->flags & ALWAYS_ON) {
+		if (!on)
+			gdsc_enable(&sc->pd);
+		on = true;
+		sc->pd.flags |= GENPD_FLAG_ALWAYS_ON;
+	}
+
 	if (on || (sc->pwrsts & PWRSTS_RET))
 		gdsc_force_mem_on(sc);
 	else
diff --git a/drivers/clk/qcom/gdsc.h b/drivers/clk/qcom/gdsc.h
index 39648348e5ec..7fd78cec7e5b 100644
--- a/drivers/clk/qcom/gdsc.h
+++ b/drivers/clk/qcom/gdsc.h
@@ -53,6 +53,7 @@ struct gdsc {
 #define VOTABLE		BIT(0)
 #define CLAMP_IO	BIT(1)
 #define HW_CTRL		BIT(2)
+#define ALWAYS_ON	BIT(3)
 	struct reset_controller_dev	*rcdev;
 	unsigned int			*resets;
 	unsigned int			reset_count;
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 2/3] clk: qcom: Register the gdscs before the clocks
  2018-03-23  8:26 [PATCH v2 0/3] clk: qcom: msm8996: handle mmagic gdscs and clocks Rajendra Nayak
  2018-03-23  8:26 ` [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs Rajendra Nayak
@ 2018-03-23  8:26 ` Rajendra Nayak
  2018-05-25 18:18   ` Bjorn Andersson
                     ` (2 more replies)
  2018-03-23  8:26 ` [PATCH v2 3/3] clk: qcom: mmcc-msm8996: leave all mmagic gdscs and clocks always enabled Rajendra Nayak
  2 siblings, 3 replies; 12+ messages in thread
From: Rajendra Nayak @ 2018-03-23  8:26 UTC (permalink / raw)
  To: sboyd, mturquette
  Cc: linux-arm-msm, linux-clk, stanimir.varbanov, vivek.gautam,
	srinivas.kandagatla, Rajendra Nayak

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)

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
---
 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 b8064a336d46..39ce64c2783b 100644
--- a/drivers/clk/qcom/common.c
+++ b/drivers/clk/qcom/common.c
@@ -228,22 +228,6 @@ int qcom_cc_really_probe(struct platform_device *pdev,
 	if (!cc)
 		return -ENOMEM;
 
-	cc->rclks = rclks;
-	cc->num_rclks = num_clks;
-
-	for (i = 0; i < num_clks; i++) {
-		if (!rclks[i])
-			continue;
-
-		ret = devm_clk_register_regmap(dev, rclks[i]);
-		if (ret)
-			return ret;
-	}
-
-	ret = devm_of_clk_add_hw_provider(dev, qcom_cc_clk_hw_get, cc);
-	if (ret)
-		return ret;
-
 	reset = &cc->reset;
 	reset->rcdev.of_node = dev->of_node;
 	reset->rcdev.ops = &qcom_reset_ops;
@@ -272,6 +256,22 @@ int qcom_cc_really_probe(struct platform_device *pdev,
 			return ret;
 	}
 
+	cc->rclks = rclks;
+	cc->num_rclks = num_clks;
+
+	for (i = 0; i < num_clks; i++) {
+		if (!rclks[i])
+			continue;
+
+		ret = devm_clk_register_regmap(dev, rclks[i]);
+		if (ret)
+			return ret;
+	}
+
+	ret = devm_of_clk_add_hw_provider(dev, qcom_cc_clk_hw_get, cc);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(qcom_cc_really_probe);
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 3/3] clk: qcom: mmcc-msm8996: leave all mmagic gdscs and clocks always enabled
  2018-03-23  8:26 [PATCH v2 0/3] clk: qcom: msm8996: handle mmagic gdscs and clocks Rajendra Nayak
  2018-03-23  8:26 ` [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs Rajendra Nayak
  2018-03-23  8:26 ` [PATCH v2 2/3] clk: qcom: Register the gdscs before the clocks Rajendra Nayak
@ 2018-03-23  8:26 ` Rajendra Nayak
  2018-05-25 18:23   ` Bjorn Andersson
  2018-06-01 18:06   ` Stephen Boyd
  2 siblings, 2 replies; 12+ messages in thread
From: Rajendra Nayak @ 2018-03-23  8:26 UTC (permalink / raw)
  To: sboyd, mturquette
  Cc: linux-arm-msm, linux-clk, stanimir.varbanov, vivek.gautam,
	srinivas.kandagatla, Rajendra Nayak

There's no bus infrastructure today to handle all the mmagic bus
clocks and GDSCs needed by all the multimedia blocks in msm8996, like
mdss, video, camera and gpu. Mark all these clocks with a CLK_IS_CRITICAL
and GDSCs with a ALWAYS_ON flag for now so they are left always enabled.
This patch should be reverted at some point when we do have a bus driver
to manage these clocks and GDSCs.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
---
 drivers/clk/qcom/gcc-msm8996.c  |  2 +-
 drivers/clk/qcom/mmcc-msm8996.c | 22 +++++++++++-----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/qcom/gcc-msm8996.c b/drivers/clk/qcom/gcc-msm8996.c
index 5d7451209206..a414ffe906ec 100644
--- a/drivers/clk/qcom/gcc-msm8996.c
+++ b/drivers/clk/qcom/gcc-msm8996.c
@@ -3105,7 +3105,7 @@ static struct gdsc aggre0_noc_gdsc = {
 		.name = "aggre0_noc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = VOTABLE,
+	.flags = VOTABLE | ALWAYS_ON,
 };
 
 static struct gdsc hlos1_vote_aggre0_noc_gdsc = {
diff --git a/drivers/clk/qcom/mmcc-msm8996.c b/drivers/clk/qcom/mmcc-msm8996.c
index 66a2fa4ec93c..1a25ee4f3658 100644
--- a/drivers/clk/qcom/mmcc-msm8996.c
+++ b/drivers/clk/qcom/mmcc-msm8996.c
@@ -1245,7 +1245,7 @@ static struct clk_branch mmss_mmagic_ahb_clk = {
 			.name = "mmss_mmagic_ahb_clk",
 			.parent_names = (const char *[]){ "ahb_clk_src" },
 			.num_parents = 1,
-			.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
+			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
 			.ops = &clk_branch2_ops,
 		},
 	},
@@ -1260,7 +1260,7 @@ static struct clk_branch mmss_mmagic_cfg_ahb_clk = {
 			.name = "mmss_mmagic_cfg_ahb_clk",
 			.parent_names = (const char *[]){ "ahb_clk_src" },
 			.num_parents = 1,
-			.flags = CLK_SET_RATE_PARENT,
+			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
 			.ops = &clk_branch2_ops,
 		},
 	},
@@ -1319,7 +1319,7 @@ static struct clk_branch mmagic_camss_axi_clk = {
 			.name = "mmagic_camss_axi_clk",
 			.parent_names = (const char *[]){ "axi_clk_src" },
 			.num_parents = 1,
-			.flags = CLK_SET_RATE_PARENT,
+			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
 			.ops = &clk_branch2_ops,
 		},
 	},
@@ -1334,7 +1334,7 @@ static struct clk_branch mmagic_camss_noc_cfg_ahb_clk = {
 			.name = "mmagic_camss_noc_cfg_ahb_clk",
 			.parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" },
 			.num_parents = 1,
-			.flags = CLK_SET_RATE_PARENT,
+			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
 			.ops = &clk_branch2_ops,
 		},
 	},
@@ -1439,7 +1439,7 @@ static struct clk_branch mmagic_mdss_axi_clk = {
 			.name = "mmagic_mdss_axi_clk",
 			.parent_names = (const char *[]){ "axi_clk_src" },
 			.num_parents = 1,
-			.flags = CLK_SET_RATE_PARENT,
+			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
 			.ops = &clk_branch2_ops,
 		},
 	},
@@ -1454,7 +1454,7 @@ static struct clk_branch mmagic_mdss_noc_cfg_ahb_clk = {
 			.name = "mmagic_mdss_noc_cfg_ahb_clk",
 			.parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" },
 			.num_parents = 1,
-			.flags = CLK_SET_RATE_PARENT,
+			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
 			.ops = &clk_branch2_ops,
 		},
 	},
@@ -1529,7 +1529,7 @@ static struct clk_branch mmagic_video_axi_clk = {
 			.name = "mmagic_video_axi_clk",
 			.parent_names = (const char *[]){ "axi_clk_src" },
 			.num_parents = 1,
-			.flags = CLK_SET_RATE_PARENT,
+			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
 			.ops = &clk_branch2_ops,
 		},
 	},
@@ -1544,7 +1544,7 @@ static struct clk_branch mmagic_video_noc_cfg_ahb_clk = {
 			.name = "mmagic_video_noc_cfg_ahb_clk",
 			.parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" },
 			.num_parents = 1,
-			.flags = CLK_SET_RATE_PARENT,
+			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
 			.ops = &clk_branch2_ops,
 		},
 	},
@@ -2919,7 +2919,7 @@ static struct gdsc mmagic_video_gdsc = {
 		.name = "mmagic_video",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = VOTABLE,
+	.flags = VOTABLE | ALWAYS_ON,
 };
 
 static struct gdsc mmagic_mdss_gdsc = {
@@ -2929,7 +2929,7 @@ static struct gdsc mmagic_mdss_gdsc = {
 		.name = "mmagic_mdss",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = VOTABLE,
+	.flags = VOTABLE | ALWAYS_ON,
 };
 
 static struct gdsc mmagic_camss_gdsc = {
@@ -2939,7 +2939,7 @@ static struct gdsc mmagic_camss_gdsc = {
 		.name = "mmagic_camss",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = VOTABLE,
+	.flags = VOTABLE | ALWAYS_ON,
 };
 
 static struct gdsc venus_gdsc = {
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs
  2018-03-23  8:26 ` [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs Rajendra Nayak
@ 2018-05-25 18:18   ` Bjorn Andersson
  2018-05-25 18:20   ` Srinivas Kandagatla
  2018-06-01 18:05   ` Stephen Boyd
  2 siblings, 0 replies; 12+ messages in thread
From: Bjorn Andersson @ 2018-05-25 18:18 UTC (permalink / raw)
  To: Rajendra Nayak
  Cc: sboyd, mturquette, linux-arm-msm, linux-clk, stanimir.varbanov,
	vivek.gautam, srinivas.kandagatla

On Fri 23 Mar 01:26 PDT 2018, Rajendra Nayak wrote:

> Some GDSCs might have software control to turn them off, but we might
> want to keep them enabled always, in some cases because of lack of
> support in kernel to handle a graceful turning off/on of such GDSCs.
> Most common instances would be the GDCSs which power up the noc/bus
> fabrics, which need bus drivers to handle them and atleast support for
> which is missing on all qcom SoCs.
> 
> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  drivers/clk/qcom/gdsc.c | 8 ++++++++
>  drivers/clk/qcom/gdsc.h | 1 +
>  2 files changed, 9 insertions(+)
> 
> diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c
> index a4f3580587b7..15f4bb5efd68 100644
> --- a/drivers/clk/qcom/gdsc.c
> +++ b/drivers/clk/qcom/gdsc.c
> @@ -291,6 +291,14 @@ static int gdsc_init(struct gdsc *sc)
>  	if ((sc->flags & VOTABLE) && on)
>  		gdsc_enable(&sc->pd);
>  
> +	/* If ALWAYS_ON GDSCs are not ON, turn them ON */
> +	if (sc->flags & ALWAYS_ON) {
> +		if (!on)
> +			gdsc_enable(&sc->pd);
> +		on = true;
> +		sc->pd.flags |= GENPD_FLAG_ALWAYS_ON;
> +	}
> +
>  	if (on || (sc->pwrsts & PWRSTS_RET))
>  		gdsc_force_mem_on(sc);
>  	else
> diff --git a/drivers/clk/qcom/gdsc.h b/drivers/clk/qcom/gdsc.h
> index 39648348e5ec..7fd78cec7e5b 100644
> --- a/drivers/clk/qcom/gdsc.h
> +++ b/drivers/clk/qcom/gdsc.h
> @@ -53,6 +53,7 @@ struct gdsc {
>  #define VOTABLE		BIT(0)
>  #define CLAMP_IO	BIT(1)
>  #define HW_CTRL		BIT(2)
> +#define ALWAYS_ON	BIT(3)
>  	struct reset_controller_dev	*rcdev;
>  	unsigned int			*resets;
>  	unsigned int			reset_count;
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/3] clk: qcom: Register the gdscs before the clocks
  2018-03-23  8:26 ` [PATCH v2 2/3] clk: qcom: Register the gdscs before the clocks Rajendra Nayak
@ 2018-05-25 18:18   ` Bjorn Andersson
  2018-05-25 18:20   ` Srinivas Kandagatla
  2018-06-01 18:06   ` Stephen Boyd
  2 siblings, 0 replies; 12+ messages in thread
From: Bjorn Andersson @ 2018-05-25 18:18 UTC (permalink / raw)
  To: Rajendra Nayak
  Cc: sboyd, mturquette, linux-arm-msm, linux-clk, stanimir.varbanov,
	vivek.gautam, srinivas.kandagatla

On Fri 23 Mar 01:26 PDT 2018, 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)
> 
> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  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 b8064a336d46..39ce64c2783b 100644
> --- a/drivers/clk/qcom/common.c
> +++ b/drivers/clk/qcom/common.c
> @@ -228,22 +228,6 @@ int qcom_cc_really_probe(struct platform_device *pdev,
>  	if (!cc)
>  		return -ENOMEM;
>  
> -	cc->rclks = rclks;
> -	cc->num_rclks = num_clks;
> -
> -	for (i = 0; i < num_clks; i++) {
> -		if (!rclks[i])
> -			continue;
> -
> -		ret = devm_clk_register_regmap(dev, rclks[i]);
> -		if (ret)
> -			return ret;
> -	}
> -
> -	ret = devm_of_clk_add_hw_provider(dev, qcom_cc_clk_hw_get, cc);
> -	if (ret)
> -		return ret;
> -
>  	reset = &cc->reset;
>  	reset->rcdev.of_node = dev->of_node;
>  	reset->rcdev.ops = &qcom_reset_ops;
> @@ -272,6 +256,22 @@ int qcom_cc_really_probe(struct platform_device *pdev,
>  			return ret;
>  	}
>  
> +	cc->rclks = rclks;
> +	cc->num_rclks = num_clks;
> +
> +	for (i = 0; i < num_clks; i++) {
> +		if (!rclks[i])
> +			continue;
> +
> +		ret = devm_clk_register_regmap(dev, rclks[i]);
> +		if (ret)
> +			return ret;
> +	}
> +
> +	ret = devm_of_clk_add_hw_provider(dev, qcom_cc_clk_hw_get, cc);
> +	if (ret)
> +		return ret;
> +
>  	return 0;
>  }
>  EXPORT_SYMBOL_GPL(qcom_cc_really_probe);
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs
  2018-03-23  8:26 ` [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs Rajendra Nayak
  2018-05-25 18:18   ` Bjorn Andersson
@ 2018-05-25 18:20   ` Srinivas Kandagatla
  2018-06-01 18:05   ` Stephen Boyd
  2 siblings, 0 replies; 12+ messages in thread
From: Srinivas Kandagatla @ 2018-05-25 18:20 UTC (permalink / raw)
  To: Rajendra Nayak, sboyd, mturquette
  Cc: linux-arm-msm, linux-clk, stanimir.varbanov, vivek.gautam



On 23/03/18 08:26, Rajendra Nayak wrote:
> Some GDSCs might have software control to turn them off, but we might
> want to keep them enabled always, in some cases because of lack of
> support in kernel to handle a graceful turning off/on of such GDSCs.
> Most common instances would be the GDCSs which power up the noc/bus
> fabrics, which need bus drivers to handle them and atleast support for
> which is missing on all qcom SoCs.
> 
> Signed-off-by: Rajendra Nayak<rnayak@codeaurora.org>
Tested-by: Srinivas Kandagatla<srinivas.kandagatla@linaro.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/3] clk: qcom: Register the gdscs before the clocks
  2018-03-23  8:26 ` [PATCH v2 2/3] clk: qcom: Register the gdscs before the clocks Rajendra Nayak
  2018-05-25 18:18   ` Bjorn Andersson
@ 2018-05-25 18:20   ` Srinivas Kandagatla
  2018-06-01 18:06   ` Stephen Boyd
  2 siblings, 0 replies; 12+ messages in thread
From: Srinivas Kandagatla @ 2018-05-25 18:20 UTC (permalink / raw)
  To: Rajendra Nayak, sboyd, mturquette
  Cc: linux-arm-msm, linux-clk, stanimir.varbanov, vivek.gautam



On 23/03/18 08:26, 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)
> 
> Signed-off-by: Rajendra Nayak<rnayak@codeaurora.org>
> ---
Tested-by: Srinivas Kandagatla<srinivas.kandagatla@linaro.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 3/3] clk: qcom: mmcc-msm8996: leave all mmagic gdscs and clocks always enabled
  2018-03-23  8:26 ` [PATCH v2 3/3] clk: qcom: mmcc-msm8996: leave all mmagic gdscs and clocks always enabled Rajendra Nayak
@ 2018-05-25 18:23   ` Bjorn Andersson
  2018-06-01 18:06   ` Stephen Boyd
  1 sibling, 0 replies; 12+ messages in thread
From: Bjorn Andersson @ 2018-05-25 18:23 UTC (permalink / raw)
  To: Rajendra Nayak
  Cc: sboyd, mturquette, linux-arm-msm, linux-clk, stanimir.varbanov,
	vivek.gautam, srinivas.kandagatla

On Fri 23 Mar 01:26 PDT 2018, Rajendra Nayak wrote:

> There's no bus infrastructure today to handle all the mmagic bus
> clocks and GDSCs needed by all the multimedia blocks in msm8996, like
> mdss, video, camera and gpu. Mark all these clocks with a CLK_IS_CRITICAL
> and GDSCs with a ALWAYS_ON flag for now so they are left always enabled.
> This patch should be reverted at some point when we do have a bus driver
> to manage these clocks and GDSCs.
> 
> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  drivers/clk/qcom/gcc-msm8996.c  |  2 +-
>  drivers/clk/qcom/mmcc-msm8996.c | 22 +++++++++++-----------
>  2 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/clk/qcom/gcc-msm8996.c b/drivers/clk/qcom/gcc-msm8996.c
> index 5d7451209206..a414ffe906ec 100644
> --- a/drivers/clk/qcom/gcc-msm8996.c
> +++ b/drivers/clk/qcom/gcc-msm8996.c
> @@ -3105,7 +3105,7 @@ static struct gdsc aggre0_noc_gdsc = {
>  		.name = "aggre0_noc",
>  	},
>  	.pwrsts = PWRSTS_OFF_ON,
> -	.flags = VOTABLE,
> +	.flags = VOTABLE | ALWAYS_ON,
>  };
>  
>  static struct gdsc hlos1_vote_aggre0_noc_gdsc = {
> diff --git a/drivers/clk/qcom/mmcc-msm8996.c b/drivers/clk/qcom/mmcc-msm8996.c
> index 66a2fa4ec93c..1a25ee4f3658 100644
> --- a/drivers/clk/qcom/mmcc-msm8996.c
> +++ b/drivers/clk/qcom/mmcc-msm8996.c
> @@ -1245,7 +1245,7 @@ static struct clk_branch mmss_mmagic_ahb_clk = {
>  			.name = "mmss_mmagic_ahb_clk",
>  			.parent_names = (const char *[]){ "ahb_clk_src" },
>  			.num_parents = 1,
> -			.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
> +			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
>  			.ops = &clk_branch2_ops,
>  		},
>  	},
> @@ -1260,7 +1260,7 @@ static struct clk_branch mmss_mmagic_cfg_ahb_clk = {
>  			.name = "mmss_mmagic_cfg_ahb_clk",
>  			.parent_names = (const char *[]){ "ahb_clk_src" },
>  			.num_parents = 1,
> -			.flags = CLK_SET_RATE_PARENT,
> +			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
>  			.ops = &clk_branch2_ops,
>  		},
>  	},
> @@ -1319,7 +1319,7 @@ static struct clk_branch mmagic_camss_axi_clk = {
>  			.name = "mmagic_camss_axi_clk",
>  			.parent_names = (const char *[]){ "axi_clk_src" },
>  			.num_parents = 1,
> -			.flags = CLK_SET_RATE_PARENT,
> +			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
>  			.ops = &clk_branch2_ops,
>  		},
>  	},
> @@ -1334,7 +1334,7 @@ static struct clk_branch mmagic_camss_noc_cfg_ahb_clk = {
>  			.name = "mmagic_camss_noc_cfg_ahb_clk",
>  			.parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" },
>  			.num_parents = 1,
> -			.flags = CLK_SET_RATE_PARENT,
> +			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
>  			.ops = &clk_branch2_ops,
>  		},
>  	},
> @@ -1439,7 +1439,7 @@ static struct clk_branch mmagic_mdss_axi_clk = {
>  			.name = "mmagic_mdss_axi_clk",
>  			.parent_names = (const char *[]){ "axi_clk_src" },
>  			.num_parents = 1,
> -			.flags = CLK_SET_RATE_PARENT,
> +			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
>  			.ops = &clk_branch2_ops,
>  		},
>  	},
> @@ -1454,7 +1454,7 @@ static struct clk_branch mmagic_mdss_noc_cfg_ahb_clk = {
>  			.name = "mmagic_mdss_noc_cfg_ahb_clk",
>  			.parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" },
>  			.num_parents = 1,
> -			.flags = CLK_SET_RATE_PARENT,
> +			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
>  			.ops = &clk_branch2_ops,
>  		},
>  	},
> @@ -1529,7 +1529,7 @@ static struct clk_branch mmagic_video_axi_clk = {
>  			.name = "mmagic_video_axi_clk",
>  			.parent_names = (const char *[]){ "axi_clk_src" },
>  			.num_parents = 1,
> -			.flags = CLK_SET_RATE_PARENT,
> +			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
>  			.ops = &clk_branch2_ops,
>  		},
>  	},
> @@ -1544,7 +1544,7 @@ static struct clk_branch mmagic_video_noc_cfg_ahb_clk = {
>  			.name = "mmagic_video_noc_cfg_ahb_clk",
>  			.parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" },
>  			.num_parents = 1,
> -			.flags = CLK_SET_RATE_PARENT,
> +			.flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
>  			.ops = &clk_branch2_ops,
>  		},
>  	},
> @@ -2919,7 +2919,7 @@ static struct gdsc mmagic_video_gdsc = {
>  		.name = "mmagic_video",
>  	},
>  	.pwrsts = PWRSTS_OFF_ON,
> -	.flags = VOTABLE,
> +	.flags = VOTABLE | ALWAYS_ON,
>  };
>  
>  static struct gdsc mmagic_mdss_gdsc = {
> @@ -2929,7 +2929,7 @@ static struct gdsc mmagic_mdss_gdsc = {
>  		.name = "mmagic_mdss",
>  	},
>  	.pwrsts = PWRSTS_OFF_ON,
> -	.flags = VOTABLE,
> +	.flags = VOTABLE | ALWAYS_ON,
>  };
>  
>  static struct gdsc mmagic_camss_gdsc = {
> @@ -2939,7 +2939,7 @@ static struct gdsc mmagic_camss_gdsc = {
>  		.name = "mmagic_camss",
>  	},
>  	.pwrsts = PWRSTS_OFF_ON,
> -	.flags = VOTABLE,
> +	.flags = VOTABLE | ALWAYS_ON,
>  };
>  
>  static struct gdsc venus_gdsc = {
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs
  2018-03-23  8:26 ` [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs Rajendra Nayak
  2018-05-25 18:18   ` Bjorn Andersson
  2018-05-25 18:20   ` Srinivas Kandagatla
@ 2018-06-01 18:05   ` Stephen Boyd
  2 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2018-06-01 18:05 UTC (permalink / raw)
  To: Rajendra Nayak, mturquette
  Cc: linux-arm-msm, linux-clk, stanimir.varbanov, vivek.gautam,
	srinivas.kandagatla, Rajendra Nayak

Quoting Rajendra Nayak (2018-03-23 01:26:14)
> Some GDSCs might have software control to turn them off, but we might
> want to keep them enabled always, in some cases because of lack of
> support in kernel to handle a graceful turning off/on of such GDSCs.
> Most common instances would be the GDCSs which power up the noc/bus
> fabrics, which need bus drivers to handle them and atleast support for
> which is missing on all qcom SoCs.
> =

> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/3] clk: qcom: Register the gdscs before the clocks
  2018-03-23  8:26 ` [PATCH v2 2/3] clk: qcom: Register the gdscs before the clocks Rajendra Nayak
  2018-05-25 18:18   ` Bjorn Andersson
  2018-05-25 18:20   ` Srinivas Kandagatla
@ 2018-06-01 18:06   ` Stephen Boyd
  2 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2018-06-01 18:06 UTC (permalink / raw)
  To: Rajendra Nayak, mturquette
  Cc: linux-arm-msm, linux-clk, stanimir.varbanov, vivek.gautam,
	srinivas.kandagatla, Rajendra Nayak

Quoting Rajendra Nayak (2018-03-23 01:26:15)
> 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)
> =

> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 3/3] clk: qcom: mmcc-msm8996: leave all mmagic gdscs and clocks always enabled
  2018-03-23  8:26 ` [PATCH v2 3/3] clk: qcom: mmcc-msm8996: leave all mmagic gdscs and clocks always enabled Rajendra Nayak
  2018-05-25 18:23   ` Bjorn Andersson
@ 2018-06-01 18:06   ` Stephen Boyd
  1 sibling, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2018-06-01 18:06 UTC (permalink / raw)
  To: Rajendra Nayak, mturquette
  Cc: linux-arm-msm, linux-clk, stanimir.varbanov, vivek.gautam,
	srinivas.kandagatla, Rajendra Nayak

Quoting Rajendra Nayak (2018-03-23 01:26:16)
> There's no bus infrastructure today to handle all the mmagic bus
> clocks and GDSCs needed by all the multimedia blocks in msm8996, like
> mdss, video, camera and gpu. Mark all these clocks with a CLK_IS_CRITICAL
> and GDSCs with a ALWAYS_ON flag for now so they are left always enabled.
> This patch should be reverted at some point when we do have a bus driver
> to manage these clocks and GDSCs.
> =

> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-06-01 18:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-23  8:26 [PATCH v2 0/3] clk: qcom: msm8996: handle mmagic gdscs and clocks Rajendra Nayak
2018-03-23  8:26 ` [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs Rajendra Nayak
2018-05-25 18:18   ` Bjorn Andersson
2018-05-25 18:20   ` Srinivas Kandagatla
2018-06-01 18:05   ` Stephen Boyd
2018-03-23  8:26 ` [PATCH v2 2/3] clk: qcom: Register the gdscs before the clocks Rajendra Nayak
2018-05-25 18:18   ` Bjorn Andersson
2018-05-25 18:20   ` Srinivas Kandagatla
2018-06-01 18:06   ` Stephen Boyd
2018-03-23  8:26 ` [PATCH v2 3/3] clk: qcom: mmcc-msm8996: leave all mmagic gdscs and clocks always enabled Rajendra Nayak
2018-05-25 18:23   ` Bjorn Andersson
2018-06-01 18:06   ` Stephen Boyd

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).