* [PATCH v2 0/4] Add interconnect driver for IPQ5332 SoC
@ 2024-07-11 11:32 Varadarajan Narayanan
2024-07-11 11:32 ` [PATCH v2 1/4] dt-bindings: interconnect: Add Qualcomm IPQ5332 support Varadarajan Narayanan
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: Varadarajan Narayanan @ 2024-07-11 11:32 UTC (permalink / raw)
To: andersson, mturquette, sboyd, robh, krzk+dt, conor+dt, gregkh,
konrad.dybcio, djakov, quic_wcheng, linux-arm-msm, linux-clk,
devicetree, linux-kernel, linux-usb, linux-pm
Cc: Varadarajan Narayanan
Enable icc-clk based interconnect driver for IPQ5332. This is
similar to IPQ9574's icc-clk based driver.
dt_bindings_check and dtbs_check passed.
Ensured that icc_sync_state is called and relevant clocks are
disabled.
v2: Removed dependency as it is merged
dt-bindings update to accommodate USB clock names change
Use icc-clk for USB also
v1:
Dependency:
[1] https://lore.kernel.org/linux-arm-msm/20240430064214.2030013-1-quic_varada@quicinc.com/
Varadarajan Narayanan (4):
dt-bindings: interconnect: Add Qualcomm IPQ5332 support
dt-bindings: usb: qcom,dwc3: Update ipq5332 clock details
clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks
arm64: dts: qcom: ipq5332: Add icc provider ability to gcc
.../bindings/clock/qcom,ipq5332-gcc.yaml | 2 +
.../devicetree/bindings/usb/qcom,dwc3.yaml | 17 ++++++-
arch/arm64/boot/dts/qcom/ipq5332.dtsi | 7 ++-
drivers/clk/qcom/gcc-ipq5332.c | 36 +++++++++++++--
.../dt-bindings/interconnect/qcom,ipq5332.h | 46 +++++++++++++++++++
5 files changed, 100 insertions(+), 8 deletions(-)
create mode 100644 include/dt-bindings/interconnect/qcom,ipq5332.h
--
2.34.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 1/4] dt-bindings: interconnect: Add Qualcomm IPQ5332 support
2024-07-11 11:32 [PATCH v2 0/4] Add interconnect driver for IPQ5332 SoC Varadarajan Narayanan
@ 2024-07-11 11:32 ` Varadarajan Narayanan
2024-07-11 11:58 ` Krzysztof Kozlowski
2024-07-11 11:32 ` [PATCH v2 2/4] dt-bindings: usb: qcom,dwc3: Update ipq5332 clock details Varadarajan Narayanan
` (2 subsequent siblings)
3 siblings, 1 reply; 14+ messages in thread
From: Varadarajan Narayanan @ 2024-07-11 11:32 UTC (permalink / raw)
To: andersson, mturquette, sboyd, robh, krzk+dt, conor+dt, gregkh,
konrad.dybcio, djakov, quic_wcheng, linux-arm-msm, linux-clk,
devicetree, linux-kernel, linux-usb, linux-pm
Cc: Varadarajan Narayanan
Add interconnect-cells to clock provider so that it can be
used as icc provider.
Add master/slave ids for Qualcomm IPQ5332 Network-On-Chip
interfaces. This will be used by the gcc-ipq5332 driver
for providing interconnect services using the icc-clk
framework.
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
.../bindings/clock/qcom,ipq5332-gcc.yaml | 2 +
.../dt-bindings/interconnect/qcom,ipq5332.h | 46 +++++++++++++++++++
2 files changed, 48 insertions(+)
create mode 100644 include/dt-bindings/interconnect/qcom,ipq5332.h
diff --git a/Documentation/devicetree/bindings/clock/qcom,ipq5332-gcc.yaml b/Documentation/devicetree/bindings/clock/qcom,ipq5332-gcc.yaml
index adc30d84fa8f..9193de681de2 100644
--- a/Documentation/devicetree/bindings/clock/qcom,ipq5332-gcc.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,ipq5332-gcc.yaml
@@ -31,6 +31,8 @@ properties:
- description: USB PCIE wrapper pipe clock source
'#power-domain-cells': false
+ '#interconnect-cells':
+ const: 1
required:
- compatible
diff --git a/include/dt-bindings/interconnect/qcom,ipq5332.h b/include/dt-bindings/interconnect/qcom,ipq5332.h
new file mode 100644
index 000000000000..be4e513bf603
--- /dev/null
+++ b/include/dt-bindings/interconnect/qcom,ipq5332.h
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+#ifndef INTERCONNECT_QCOM_IPQ9574_H
+#define INTERCONNECT_QCOM_IPQ9574_H
+
+#define MASTER_SNOC_PCIE3_1_M 0
+#define SLAVE_SNOC_PCIE3_1_M 1
+#define MASTER_ANOC_PCIE3_1_S 2
+#define SLAVE_ANOC_PCIE3_1_S 3
+#define MASTER_SNOC_PCIE3_2_M 4
+#define SLAVE_SNOC_PCIE3_2_M 5
+#define MASTER_ANOC_PCIE3_2_S 6
+#define SLAVE_ANOC_PCIE3_2_S 7
+#define MASTER_SNOC_USB 8
+#define SLAVE_SNOC_USB 9
+#define MASTER_NSSNOC_NSSCC 10
+#define SLAVE_NSSNOC_NSSCC 11
+#define MASTER_NSSNOC_SNOC_0 12
+#define SLAVE_NSSNOC_SNOC_0 13
+#define MASTER_NSSNOC_SNOC_1 14
+#define SLAVE_NSSNOC_SNOC_1 15
+#define MASTER_NSSNOC_ATB 16
+#define SLAVE_NSSNOC_ATB 17
+#define MASTER_NSSNOC_PCNOC_1 18
+#define SLAVE_NSSNOC_PCNOC_1 19
+#define MASTER_NSSNOC_QOSGEN_REF 20
+#define SLAVE_NSSNOC_QOSGEN_REF 21
+#define MASTER_NSSNOC_TIMEOUT_REF 22
+#define SLAVE_NSSNOC_TIMEOUT_REF 23
+#define MASTER_NSSNOC_XO_DCD 24
+#define SLAVE_NSSNOC_XO_DCD 25
+
+#define MASTER_NSSNOC_PPE 0
+#define SLAVE_NSSNOC_PPE 1
+#define MASTER_NSSNOC_PPE_CFG 2
+#define SLAVE_NSSNOC_PPE_CFG 3
+#define MASTER_NSSNOC_NSS_CSR 4
+#define SLAVE_NSSNOC_NSS_CSR 5
+#define MASTER_NSSNOC_CE_APB 6
+#define SLAVE_NSSNOC_CE_APB 7
+#define MASTER_NSSNOC_CE_AXI 8
+#define SLAVE_NSSNOC_CE_AXI 9
+
+#define MASTER_CNOC_AHB 0
+#define SLAVE_CNOC_AHB 1
+
+#endif /* INTERCONNECT_QCOM_IPQ9574_H */
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2 2/4] dt-bindings: usb: qcom,dwc3: Update ipq5332 clock details
2024-07-11 11:32 [PATCH v2 0/4] Add interconnect driver for IPQ5332 SoC Varadarajan Narayanan
2024-07-11 11:32 ` [PATCH v2 1/4] dt-bindings: interconnect: Add Qualcomm IPQ5332 support Varadarajan Narayanan
@ 2024-07-11 11:32 ` Varadarajan Narayanan
2024-07-11 11:32 ` [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks Varadarajan Narayanan
2024-07-11 11:32 ` [PATCH v2 4/4] arm64: dts: qcom: ipq5332: Add icc provider ability to gcc Varadarajan Narayanan
3 siblings, 0 replies; 14+ messages in thread
From: Varadarajan Narayanan @ 2024-07-11 11:32 UTC (permalink / raw)
To: andersson, mturquette, sboyd, robh, krzk+dt, conor+dt, gregkh,
konrad.dybcio, djakov, quic_wcheng, linux-arm-msm, linux-clk,
devicetree, linux-kernel, linux-usb, linux-pm
Cc: Varadarajan Narayanan
USB uses icc-clk framework to enable the NoC interface clock.
Hence the 'iface' clock is removed from the list of clocks.
Update the clock-names list accordingly.
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
.../devicetree/bindings/usb/qcom,dwc3.yaml | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
index efde47a5b145..6c5f962bbcf9 100644
--- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
@@ -220,6 +220,22 @@ allOf:
- const: sleep
- const: mock_utmi
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qcom,ipq5332-dwc3
+ then:
+ properties:
+ clocks:
+ maxItems: 3
+ clock-names:
+ items:
+ - const: core
+ - const: sleep
+ - const: mock_utmi
+
- if:
properties:
compatible:
@@ -267,7 +283,6 @@ allOf:
contains:
enum:
- qcom,ipq5018-dwc3
- - qcom,ipq5332-dwc3
- qcom,msm8994-dwc3
- qcom,qcs404-dwc3
then:
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks
2024-07-11 11:32 [PATCH v2 0/4] Add interconnect driver for IPQ5332 SoC Varadarajan Narayanan
2024-07-11 11:32 ` [PATCH v2 1/4] dt-bindings: interconnect: Add Qualcomm IPQ5332 support Varadarajan Narayanan
2024-07-11 11:32 ` [PATCH v2 2/4] dt-bindings: usb: qcom,dwc3: Update ipq5332 clock details Varadarajan Narayanan
@ 2024-07-11 11:32 ` Varadarajan Narayanan
2024-07-12 12:24 ` Konrad Dybcio
2024-07-13 16:21 ` Dmitry Baryshkov
2024-07-11 11:32 ` [PATCH v2 4/4] arm64: dts: qcom: ipq5332: Add icc provider ability to gcc Varadarajan Narayanan
3 siblings, 2 replies; 14+ messages in thread
From: Varadarajan Narayanan @ 2024-07-11 11:32 UTC (permalink / raw)
To: andersson, mturquette, sboyd, robh, krzk+dt, conor+dt, gregkh,
konrad.dybcio, djakov, quic_wcheng, linux-arm-msm, linux-clk,
devicetree, linux-kernel, linux-usb, linux-pm
Cc: Varadarajan Narayanan
Use the icc-clk framework to enable few clocks to be able to
create paths and use the peripherals connected on those NoCs.
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
drivers/clk/qcom/gcc-ipq5332.c | 36 +++++++++++++++++++++++++++++-----
1 file changed, 31 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/qcom/gcc-ipq5332.c b/drivers/clk/qcom/gcc-ipq5332.c
index f98591148a97..6d7672cae0f7 100644
--- a/drivers/clk/qcom/gcc-ipq5332.c
+++ b/drivers/clk/qcom/gcc-ipq5332.c
@@ -4,12 +4,14 @@
*/
#include <linux/clk-provider.h>
+#include <linux/interconnect-provider.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <dt-bindings/clock/qcom,ipq5332-gcc.h>
+#include <dt-bindings/interconnect/qcom,ipq5332.h>
#include "clk-alpha-pll.h"
#include "clk-branch.h"
@@ -131,12 +133,14 @@ static struct clk_alpha_pll gpll4_main = {
* (will be added soon), so the clock framework
* disables this source. But some of the clocks
* initialized by boot loaders uses this source. So we
- * need to keep this clock ON. Add the
- * CLK_IGNORE_UNUSED flag so the clock will not be
- * disabled. Once the consumer in kernel is added, we
- * can get rid of this flag.
+ * need to keep this clock ON.
+ *
+ * After initial bootup, when the ICC framework turns
+ * off unused paths, as part of the icc-clk dependencies
+ * this clock gets disabled resulting in a hang. Marking
+ * it as critical to ensure it is not turned off.
*/
- .flags = CLK_IGNORE_UNUSED,
+ .flags = CLK_IS_CRITICAL,
},
},
};
@@ -3628,6 +3632,24 @@ static const struct qcom_reset_map gcc_ipq5332_resets[] = {
[GCC_UNIPHY1_XPCS_ARES] = { 0x16060 },
};
+#define IPQ_APPS_ID 5332 /* some unique value */
+
+static struct qcom_icc_hws_data icc_ipq5332_hws[] = {
+ { MASTER_SNOC_PCIE3_1_M, SLAVE_SNOC_PCIE3_1_M, GCC_SNOC_PCIE3_1LANE_M_CLK },
+ { MASTER_ANOC_PCIE3_1_S, SLAVE_ANOC_PCIE3_1_S, GCC_SNOC_PCIE3_1LANE_S_CLK },
+ { MASTER_SNOC_PCIE3_2_M, SLAVE_SNOC_PCIE3_2_M, GCC_SNOC_PCIE3_2LANE_M_CLK },
+ { MASTER_ANOC_PCIE3_2_S, SLAVE_ANOC_PCIE3_2_S, GCC_SNOC_PCIE3_2LANE_S_CLK },
+ { MASTER_SNOC_USB, SLAVE_SNOC_USB, GCC_SNOC_USB_CLK },
+ { MASTER_NSSNOC_NSSCC, SLAVE_NSSNOC_NSSCC, GCC_NSSNOC_NSSCC_CLK },
+ { MASTER_NSSNOC_SNOC_0, SLAVE_NSSNOC_SNOC_0, GCC_NSSNOC_SNOC_CLK },
+ { MASTER_NSSNOC_SNOC_1, SLAVE_NSSNOC_SNOC_1, GCC_NSSNOC_SNOC_1_CLK },
+ { MASTER_NSSNOC_ATB, SLAVE_NSSNOC_ATB, GCC_NSSNOC_ATB_CLK },
+ { MASTER_NSSNOC_PCNOC_1, SLAVE_NSSNOC_PCNOC_1, GCC_NSSNOC_PCNOC_1_CLK },
+ { MASTER_NSSNOC_QOSGEN_REF, SLAVE_NSSNOC_QOSGEN_REF, GCC_NSSNOC_QOSGEN_REF_CLK },
+ { MASTER_NSSNOC_TIMEOUT_REF, SLAVE_NSSNOC_TIMEOUT_REF, GCC_NSSNOC_TIMEOUT_REF_CLK },
+ { MASTER_NSSNOC_XO_DCD, SLAVE_NSSNOC_XO_DCD, GCC_NSSNOC_XO_DCD_CLK },
+};
+
static const struct regmap_config gcc_ipq5332_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
@@ -3656,6 +3678,9 @@ static const struct qcom_cc_desc gcc_ipq5332_desc = {
.num_resets = ARRAY_SIZE(gcc_ipq5332_resets),
.clk_hws = gcc_ipq5332_hws,
.num_clk_hws = ARRAY_SIZE(gcc_ipq5332_hws),
+ .icc_hws = icc_ipq5332_hws,
+ .num_icc_hws = ARRAY_SIZE(icc_ipq5332_hws),
+ .icc_first_node_id = IPQ_APPS_ID,
};
static int gcc_ipq5332_probe(struct platform_device *pdev)
@@ -3674,6 +3699,7 @@ static struct platform_driver gcc_ipq5332_driver = {
.driver = {
.name = "gcc-ipq5332",
.of_match_table = gcc_ipq5332_match_table,
+ .sync_state = icc_sync_state,
},
};
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2 4/4] arm64: dts: qcom: ipq5332: Add icc provider ability to gcc
2024-07-11 11:32 [PATCH v2 0/4] Add interconnect driver for IPQ5332 SoC Varadarajan Narayanan
` (2 preceding siblings ...)
2024-07-11 11:32 ` [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks Varadarajan Narayanan
@ 2024-07-11 11:32 ` Varadarajan Narayanan
2024-07-12 12:24 ` Konrad Dybcio
3 siblings, 1 reply; 14+ messages in thread
From: Varadarajan Narayanan @ 2024-07-11 11:32 UTC (permalink / raw)
To: andersson, mturquette, sboyd, robh, krzk+dt, conor+dt, gregkh,
konrad.dybcio, djakov, quic_wcheng, linux-arm-msm, linux-clk,
devicetree, linux-kernel, linux-usb, linux-pm
Cc: Varadarajan Narayanan
IPQ SoCs dont involve RPM in managing NoC related clocks and
there is no NoC scaling. Linux itself handles these clocks.
However, these should not be exposed as just clocks and align
with other Qualcomm SoCs that handle these clocks from a
interconnect provider.
Hence include icc provider capability to the gcc node so that
peripherals can use the interconnect facility to enable these
clocks. Change USB to use the icc-clk framework for the iface
clock.
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
arch/arm64/boot/dts/qcom/ipq5332.dtsi | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
index 573656587c0d..f58fd70be826 100644
--- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
@@ -8,6 +8,7 @@
#include <dt-bindings/clock/qcom,apss-ipq.h>
#include <dt-bindings/clock/qcom,ipq5332-gcc.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interconnect/qcom,ipq5332.h>
/ {
interrupt-parent = <&intc>;
@@ -208,6 +209,7 @@ gcc: clock-controller@1800000 {
reg = <0x01800000 0x80000>;
#clock-cells = <1>;
#reset-cells = <1>;
+ #interconnect-cells = <1>;
clocks = <&xo_board>,
<&sleep_clk>,
<0>,
@@ -327,11 +329,9 @@ usb: usb@8af8800 {
"dm_hs_phy_irq";
clocks = <&gcc GCC_USB0_MASTER_CLK>,
- <&gcc GCC_SNOC_USB_CLK>,
<&gcc GCC_USB0_SLEEP_CLK>,
<&gcc GCC_USB0_MOCK_UTMI_CLK>;
clock-names = "core",
- "iface",
"sleep",
"mock_utmi";
@@ -342,6 +342,9 @@ usb: usb@8af8800 {
#address-cells = <1>;
#size-cells = <1>;
ranges;
+ interconnects = <&gcc MASTER_SNOC_USB &gcc SLAVE_SNOC_USB>,
+ <&gcc MASTER_SNOC_USB &gcc SLAVE_SNOC_USB>;
+ interconnect-names = "usb-ddr", "apps-usb";
status = "disabled";
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: interconnect: Add Qualcomm IPQ5332 support
2024-07-11 11:32 ` [PATCH v2 1/4] dt-bindings: interconnect: Add Qualcomm IPQ5332 support Varadarajan Narayanan
@ 2024-07-11 11:58 ` Krzysztof Kozlowski
0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2024-07-11 11:58 UTC (permalink / raw)
To: Varadarajan Narayanan, andersson, mturquette, sboyd, robh,
krzk+dt, conor+dt, gregkh, konrad.dybcio, djakov, quic_wcheng,
linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-usb,
linux-pm
On 11/07/2024 13:32, Varadarajan Narayanan wrote:
> Add interconnect-cells to clock provider so that it can be
> used as icc provider.
>
> Add master/slave ids for Qualcomm IPQ5332 Network-On-Chip
> interfaces. This will be used by the gcc-ipq5332 driver
> for providing interconnect services using the icc-clk
> framework.
>
> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
That's another patchset from Qualcomm where tags get ignored. Maybe it's
the same team? You have very good internal guideline, so read it before
posting.
Expecting us to do the same review we already did, is a waste of
community resources.
<form letter>
This is a friendly reminder during the review process.
It looks like you received a tag and forgot to add it.
If you do not know the process, here is a short explanation:
Please add Acked-by/Reviewed-by/Tested-by tags when posting new
versions, under or above your Signed-off-by tag. Tag is "received", when
provided in a message replied to you on the mailing list. Tools like b4
can help here. However, there's no need to repost patches *only* to add
the tags. The upstream maintainer will do that for tags received on the
version they apply.
https://elixir.bootlin.com/linux/v6.5-rc3/source/Documentation/process/submitting-patches.rst#L577
If a tag was not added on purpose, please state why and what changed.
</form letter>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks
2024-07-11 11:32 ` [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks Varadarajan Narayanan
@ 2024-07-12 12:24 ` Konrad Dybcio
2024-07-13 16:21 ` Dmitry Baryshkov
1 sibling, 0 replies; 14+ messages in thread
From: Konrad Dybcio @ 2024-07-12 12:24 UTC (permalink / raw)
To: Varadarajan Narayanan, andersson, mturquette, sboyd, robh,
krzk+dt, conor+dt, gregkh, djakov, quic_wcheng, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-usb, linux-pm
On 11.07.2024 1:32 PM, Varadarajan Narayanan wrote:
> Use the icc-clk framework to enable few clocks to be able to
> create paths and use the peripherals connected on those NoCs.
>
> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 4/4] arm64: dts: qcom: ipq5332: Add icc provider ability to gcc
2024-07-11 11:32 ` [PATCH v2 4/4] arm64: dts: qcom: ipq5332: Add icc provider ability to gcc Varadarajan Narayanan
@ 2024-07-12 12:24 ` Konrad Dybcio
0 siblings, 0 replies; 14+ messages in thread
From: Konrad Dybcio @ 2024-07-12 12:24 UTC (permalink / raw)
To: Varadarajan Narayanan, andersson, mturquette, sboyd, robh,
krzk+dt, conor+dt, gregkh, djakov, quic_wcheng, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-usb, linux-pm
On 11.07.2024 1:32 PM, Varadarajan Narayanan wrote:
> IPQ SoCs dont involve RPM in managing NoC related clocks and
> there is no NoC scaling. Linux itself handles these clocks.
> However, these should not be exposed as just clocks and align
> with other Qualcomm SoCs that handle these clocks from a
> interconnect provider.
>
> Hence include icc provider capability to the gcc node so that
> peripherals can use the interconnect facility to enable these
> clocks. Change USB to use the icc-clk framework for the iface
> clock.
>
> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> ---
> arch/arm64/boot/dts/qcom/ipq5332.dtsi | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
> index 573656587c0d..f58fd70be826 100644
> --- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi
> +++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
> @@ -8,6 +8,7 @@
> #include <dt-bindings/clock/qcom,apss-ipq.h>
> #include <dt-bindings/clock/qcom,ipq5332-gcc.h>
> #include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/interconnect/qcom,ipq5332.h>
nit: this is not sorted alphabetically
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks
2024-07-11 11:32 ` [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks Varadarajan Narayanan
2024-07-12 12:24 ` Konrad Dybcio
@ 2024-07-13 16:21 ` Dmitry Baryshkov
2024-07-18 10:42 ` Varadarajan Narayanan
1 sibling, 1 reply; 14+ messages in thread
From: Dmitry Baryshkov @ 2024-07-13 16:21 UTC (permalink / raw)
To: Varadarajan Narayanan
Cc: andersson, mturquette, sboyd, robh, krzk+dt, conor+dt, gregkh,
konrad.dybcio, djakov, quic_wcheng, linux-arm-msm, linux-clk,
devicetree, linux-kernel, linux-usb, linux-pm
On Thu, Jul 11, 2024 at 05:02:38PM GMT, Varadarajan Narayanan wrote:
> Use the icc-clk framework to enable few clocks to be able to
> create paths and use the peripherals connected on those NoCs.
>
> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> ---
> drivers/clk/qcom/gcc-ipq5332.c | 36 +++++++++++++++++++++++++++++-----
> 1 file changed, 31 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/clk/qcom/gcc-ipq5332.c b/drivers/clk/qcom/gcc-ipq5332.c
> index f98591148a97..6d7672cae0f7 100644
> --- a/drivers/clk/qcom/gcc-ipq5332.c
> +++ b/drivers/clk/qcom/gcc-ipq5332.c
> @@ -4,12 +4,14 @@
> */
>
> #include <linux/clk-provider.h>
> +#include <linux/interconnect-provider.h>
> #include <linux/mod_devicetable.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> #include <linux/regmap.h>
>
> #include <dt-bindings/clock/qcom,ipq5332-gcc.h>
> +#include <dt-bindings/interconnect/qcom,ipq5332.h>
>
> #include "clk-alpha-pll.h"
> #include "clk-branch.h"
> @@ -131,12 +133,14 @@ static struct clk_alpha_pll gpll4_main = {
> * (will be added soon), so the clock framework
> * disables this source. But some of the clocks
> * initialized by boot loaders uses this source. So we
> - * need to keep this clock ON. Add the
> - * CLK_IGNORE_UNUSED flag so the clock will not be
> - * disabled. Once the consumer in kernel is added, we
> - * can get rid of this flag.
> + * need to keep this clock ON.
> + *
> + * After initial bootup, when the ICC framework turns
> + * off unused paths, as part of the icc-clk dependencies
> + * this clock gets disabled resulting in a hang. Marking
> + * it as critical to ensure it is not turned off.
Previous comment was pretty clear: there are missing consumers, the flag
will be removed once they are added. Current comment doesn't make sense.
What is the reason for the device hang if we have all the consumers in
place?
> */
> - .flags = CLK_IGNORE_UNUSED,
> + .flags = CLK_IS_CRITICAL,
> },
> },
> };
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks
2024-07-13 16:21 ` Dmitry Baryshkov
@ 2024-07-18 10:42 ` Varadarajan Narayanan
2024-07-18 10:47 ` Dmitry Baryshkov
0 siblings, 1 reply; 14+ messages in thread
From: Varadarajan Narayanan @ 2024-07-18 10:42 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: andersson, mturquette, sboyd, robh, krzk+dt, conor+dt, gregkh,
konrad.dybcio, djakov, quic_wcheng, linux-arm-msm, linux-clk,
devicetree, linux-kernel, linux-usb, linux-pm
On Sat, Jul 13, 2024 at 07:21:29PM +0300, Dmitry Baryshkov wrote:
> On Thu, Jul 11, 2024 at 05:02:38PM GMT, Varadarajan Narayanan wrote:
> > Use the icc-clk framework to enable few clocks to be able to
> > create paths and use the peripherals connected on those NoCs.
> >
> > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> > ---
> > drivers/clk/qcom/gcc-ipq5332.c | 36 +++++++++++++++++++++++++++++-----
> > 1 file changed, 31 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/clk/qcom/gcc-ipq5332.c b/drivers/clk/qcom/gcc-ipq5332.c
> > index f98591148a97..6d7672cae0f7 100644
> > --- a/drivers/clk/qcom/gcc-ipq5332.c
> > +++ b/drivers/clk/qcom/gcc-ipq5332.c
> > @@ -4,12 +4,14 @@
> > */
> >
> > #include <linux/clk-provider.h>
> > +#include <linux/interconnect-provider.h>
> > #include <linux/mod_devicetable.h>
> > #include <linux/module.h>
> > #include <linux/platform_device.h>
> > #include <linux/regmap.h>
> >
> > #include <dt-bindings/clock/qcom,ipq5332-gcc.h>
> > +#include <dt-bindings/interconnect/qcom,ipq5332.h>
> >
> > #include "clk-alpha-pll.h"
> > #include "clk-branch.h"
> > @@ -131,12 +133,14 @@ static struct clk_alpha_pll gpll4_main = {
> > * (will be added soon), so the clock framework
> > * disables this source. But some of the clocks
> > * initialized by boot loaders uses this source. So we
> > - * need to keep this clock ON. Add the
> > - * CLK_IGNORE_UNUSED flag so the clock will not be
> > - * disabled. Once the consumer in kernel is added, we
> > - * can get rid of this flag.
> > + * need to keep this clock ON.
> > + *
> > + * After initial bootup, when the ICC framework turns
> > + * off unused paths, as part of the icc-clk dependencies
> > + * this clock gets disabled resulting in a hang. Marking
> > + * it as critical to ensure it is not turned off.
>
> Previous comment was pretty clear: there are missing consumers, the flag
> will be removed once they are added. Current comment doesn't make sense.
> What is the reason for the device hang if we have all the consumers in
> place?
Earlier, since there were no consumers for this clock, it got
disabled via clk_disable_unused() and CLK_IGNORE_UNUSED helped
prevent that.
Now, since this clk is getting used indirectly via icc-clk
framework, it doesn't qualify for being disabled by
clk_disable_unused(). However, when icc_sync_state is called, if
it sees there are no consumers for a path and that path gets
disabled, the relevant clocks get disabled and eventually this
clock also gets disabled. To avoid this have changed 'flags' from
CLK_IGNORE_UNUSED -> CLK_IS_CRITICAL.
Thanks
Varada
> > */
> > - .flags = CLK_IGNORE_UNUSED,
> > + .flags = CLK_IS_CRITICAL,
> > },
> > },
> > };
>
>
> --
> With best wishes
> Dmitry
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks
2024-07-18 10:42 ` Varadarajan Narayanan
@ 2024-07-18 10:47 ` Dmitry Baryshkov
2024-07-20 9:02 ` Varadarajan Narayanan
0 siblings, 1 reply; 14+ messages in thread
From: Dmitry Baryshkov @ 2024-07-18 10:47 UTC (permalink / raw)
To: Varadarajan Narayanan
Cc: andersson, mturquette, sboyd, robh, krzk+dt, conor+dt, gregkh,
konrad.dybcio, djakov, quic_wcheng, linux-arm-msm, linux-clk,
devicetree, linux-kernel, linux-usb, linux-pm
On Thu, 18 Jul 2024 at 13:42, Varadarajan Narayanan
<quic_varada@quicinc.com> wrote:
>
> On Sat, Jul 13, 2024 at 07:21:29PM +0300, Dmitry Baryshkov wrote:
> > On Thu, Jul 11, 2024 at 05:02:38PM GMT, Varadarajan Narayanan wrote:
> > > Use the icc-clk framework to enable few clocks to be able to
> > > create paths and use the peripherals connected on those NoCs.
> > >
> > > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> > > ---
> > > drivers/clk/qcom/gcc-ipq5332.c | 36 +++++++++++++++++++++++++++++-----
> > > 1 file changed, 31 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/clk/qcom/gcc-ipq5332.c b/drivers/clk/qcom/gcc-ipq5332.c
> > > index f98591148a97..6d7672cae0f7 100644
> > > --- a/drivers/clk/qcom/gcc-ipq5332.c
> > > +++ b/drivers/clk/qcom/gcc-ipq5332.c
> > > @@ -4,12 +4,14 @@
> > > */
> > >
> > > #include <linux/clk-provider.h>
> > > +#include <linux/interconnect-provider.h>
> > > #include <linux/mod_devicetable.h>
> > > #include <linux/module.h>
> > > #include <linux/platform_device.h>
> > > #include <linux/regmap.h>
> > >
> > > #include <dt-bindings/clock/qcom,ipq5332-gcc.h>
> > > +#include <dt-bindings/interconnect/qcom,ipq5332.h>
> > >
> > > #include "clk-alpha-pll.h"
> > > #include "clk-branch.h"
> > > @@ -131,12 +133,14 @@ static struct clk_alpha_pll gpll4_main = {
> > > * (will be added soon), so the clock framework
> > > * disables this source. But some of the clocks
> > > * initialized by boot loaders uses this source. So we
> > > - * need to keep this clock ON. Add the
> > > - * CLK_IGNORE_UNUSED flag so the clock will not be
> > > - * disabled. Once the consumer in kernel is added, we
> > > - * can get rid of this flag.
> > > + * need to keep this clock ON.
> > > + *
> > > + * After initial bootup, when the ICC framework turns
> > > + * off unused paths, as part of the icc-clk dependencies
> > > + * this clock gets disabled resulting in a hang. Marking
> > > + * it as critical to ensure it is not turned off.
> >
> > Previous comment was pretty clear: there are missing consumers, the flag
> > will be removed once they are added. Current comment doesn't make sense.
> > What is the reason for the device hang if we have all the consumers in
> > place?
>
> Earlier, since there were no consumers for this clock, it got
> disabled via clk_disable_unused() and CLK_IGNORE_UNUSED helped
> prevent that.
>
> Now, since this clk is getting used indirectly via icc-clk
> framework, it doesn't qualify for being disabled by
> clk_disable_unused(). However, when icc_sync_state is called, if
> it sees there are no consumers for a path and that path gets
> disabled, the relevant clocks get disabled and eventually this
> clock also gets disabled. To avoid this have changed 'flags' from
> CLK_IGNORE_UNUSED -> CLK_IS_CRITICAL.
You don't seem to be answering my question: "What is the reason for
the device hang if we have all the consumers in place?"
Could you please answer it rather than describing the CCF / icc-clk behaviour?
Are there any actual consumers for GPLL4 at this point? If not, why do
you want to keep it running? Usually all PLLs are shut down when there
are no consumers and then restarted when required. This is the
expected and correct behaviour.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks
2024-07-18 10:47 ` Dmitry Baryshkov
@ 2024-07-20 9:02 ` Varadarajan Narayanan
2024-07-20 9:05 ` Dmitry Baryshkov
0 siblings, 1 reply; 14+ messages in thread
From: Varadarajan Narayanan @ 2024-07-20 9:02 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: andersson, mturquette, sboyd, robh, krzk+dt, conor+dt, gregkh,
konrad.dybcio, djakov, quic_wcheng, linux-arm-msm, linux-clk,
devicetree, linux-kernel, linux-usb, linux-pm
On Thu, Jul 18, 2024 at 01:47:32PM +0300, Dmitry Baryshkov wrote:
> On Thu, 18 Jul 2024 at 13:42, Varadarajan Narayanan
> <quic_varada@quicinc.com> wrote:
> >
> > On Sat, Jul 13, 2024 at 07:21:29PM +0300, Dmitry Baryshkov wrote:
> > > On Thu, Jul 11, 2024 at 05:02:38PM GMT, Varadarajan Narayanan wrote:
> > > > Use the icc-clk framework to enable few clocks to be able to
> > > > create paths and use the peripherals connected on those NoCs.
> > > >
> > > > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> > > > ---
> > > > drivers/clk/qcom/gcc-ipq5332.c | 36 +++++++++++++++++++++++++++++-----
> > > > 1 file changed, 31 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/drivers/clk/qcom/gcc-ipq5332.c b/drivers/clk/qcom/gcc-ipq5332.c
> > > > index f98591148a97..6d7672cae0f7 100644
> > > > --- a/drivers/clk/qcom/gcc-ipq5332.c
> > > > +++ b/drivers/clk/qcom/gcc-ipq5332.c
> > > > @@ -4,12 +4,14 @@
> > > > */
> > > >
> > > > #include <linux/clk-provider.h>
> > > > +#include <linux/interconnect-provider.h>
> > > > #include <linux/mod_devicetable.h>
> > > > #include <linux/module.h>
> > > > #include <linux/platform_device.h>
> > > > #include <linux/regmap.h>
> > > >
> > > > #include <dt-bindings/clock/qcom,ipq5332-gcc.h>
> > > > +#include <dt-bindings/interconnect/qcom,ipq5332.h>
> > > >
> > > > #include "clk-alpha-pll.h"
> > > > #include "clk-branch.h"
> > > > @@ -131,12 +133,14 @@ static struct clk_alpha_pll gpll4_main = {
> > > > * (will be added soon), so the clock framework
> > > > * disables this source. But some of the clocks
> > > > * initialized by boot loaders uses this source. So we
> > > > - * need to keep this clock ON. Add the
> > > > - * CLK_IGNORE_UNUSED flag so the clock will not be
> > > > - * disabled. Once the consumer in kernel is added, we
> > > > - * can get rid of this flag.
> > > > + * need to keep this clock ON.
> > > > + *
> > > > + * After initial bootup, when the ICC framework turns
> > > > + * off unused paths, as part of the icc-clk dependencies
> > > > + * this clock gets disabled resulting in a hang. Marking
> > > > + * it as critical to ensure it is not turned off.
> > >
> > > Previous comment was pretty clear: there are missing consumers, the flag
> > > will be removed once they are added. Current comment doesn't make sense.
> > > What is the reason for the device hang if we have all the consumers in
> > > place?
> >
> > Earlier, since there were no consumers for this clock, it got
> > disabled via clk_disable_unused() and CLK_IGNORE_UNUSED helped
> > prevent that.
> >
> > Now, since this clk is getting used indirectly via icc-clk
> > framework, it doesn't qualify for being disabled by
> > clk_disable_unused(). However, when icc_sync_state is called, if
> > it sees there are no consumers for a path and that path gets
> > disabled, the relevant clocks get disabled and eventually this
> > clock also gets disabled. To avoid this have changed 'flags' from
> > CLK_IGNORE_UNUSED -> CLK_IS_CRITICAL.
>
> You don't seem to be answering my question: "What is the reason for
> the device hang if we have all the consumers in place?"
> Could you please answer it rather than describing the CCF / icc-clk behaviour?
Sorry if I hadn't expressed myself clearly. All the consumers are
not there in place yet.
> Are there any actual consumers for GPLL4 at this point? If not, why do
> you want to keep it running? Usually all PLLs are shut down when there
> are no consumers and then restarted when required. This is the
> expected and correct behaviour.
There are consumers for GPLL4, but they are getting disabled by
clk_disable_unused (this is expected). There seems to be some
consumer that got enabled in boot loader itself but not accounted
in Linux because of which we are relying on CLK_IGNORE_UNUSED.
If missing consumer(s) is identified, we can do away with this
flag. Till that is done, was hoping CLK_IS_CRITICAL could help.
Thanks
Varada
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks
2024-07-20 9:02 ` Varadarajan Narayanan
@ 2024-07-20 9:05 ` Dmitry Baryshkov
2024-07-22 6:05 ` Varadarajan Narayanan
0 siblings, 1 reply; 14+ messages in thread
From: Dmitry Baryshkov @ 2024-07-20 9:05 UTC (permalink / raw)
To: Varadarajan Narayanan
Cc: andersson, mturquette, sboyd, robh, krzk+dt, conor+dt, gregkh,
konrad.dybcio, djakov, quic_wcheng, linux-arm-msm, linux-clk,
devicetree, linux-kernel, linux-usb, linux-pm
On Sat, 20 Jul 2024 at 12:02, Varadarajan Narayanan
<quic_varada@quicinc.com> wrote:
>
> On Thu, Jul 18, 2024 at 01:47:32PM +0300, Dmitry Baryshkov wrote:
> > On Thu, 18 Jul 2024 at 13:42, Varadarajan Narayanan
> > <quic_varada@quicinc.com> wrote:
> > >
> > > On Sat, Jul 13, 2024 at 07:21:29PM +0300, Dmitry Baryshkov wrote:
> > > > On Thu, Jul 11, 2024 at 05:02:38PM GMT, Varadarajan Narayanan wrote:
> > > > > Use the icc-clk framework to enable few clocks to be able to
> > > > > create paths and use the peripherals connected on those NoCs.
> > > > >
> > > > > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> > > > > ---
> > > > > drivers/clk/qcom/gcc-ipq5332.c | 36 +++++++++++++++++++++++++++++-----
> > > > > 1 file changed, 31 insertions(+), 5 deletions(-)
> > > > >
> > > > > diff --git a/drivers/clk/qcom/gcc-ipq5332.c b/drivers/clk/qcom/gcc-ipq5332.c
> > > > > index f98591148a97..6d7672cae0f7 100644
> > > > > --- a/drivers/clk/qcom/gcc-ipq5332.c
> > > > > +++ b/drivers/clk/qcom/gcc-ipq5332.c
> > > > > @@ -4,12 +4,14 @@
> > > > > */
> > > > >
> > > > > #include <linux/clk-provider.h>
> > > > > +#include <linux/interconnect-provider.h>
> > > > > #include <linux/mod_devicetable.h>
> > > > > #include <linux/module.h>
> > > > > #include <linux/platform_device.h>
> > > > > #include <linux/regmap.h>
> > > > >
> > > > > #include <dt-bindings/clock/qcom,ipq5332-gcc.h>
> > > > > +#include <dt-bindings/interconnect/qcom,ipq5332.h>
> > > > >
> > > > > #include "clk-alpha-pll.h"
> > > > > #include "clk-branch.h"
> > > > > @@ -131,12 +133,14 @@ static struct clk_alpha_pll gpll4_main = {
> > > > > * (will be added soon), so the clock framework
> > > > > * disables this source. But some of the clocks
> > > > > * initialized by boot loaders uses this source. So we
> > > > > - * need to keep this clock ON. Add the
> > > > > - * CLK_IGNORE_UNUSED flag so the clock will not be
> > > > > - * disabled. Once the consumer in kernel is added, we
> > > > > - * can get rid of this flag.
> > > > > + * need to keep this clock ON.
> > > > > + *
> > > > > + * After initial bootup, when the ICC framework turns
> > > > > + * off unused paths, as part of the icc-clk dependencies
> > > > > + * this clock gets disabled resulting in a hang. Marking
> > > > > + * it as critical to ensure it is not turned off.
> > > >
> > > > Previous comment was pretty clear: there are missing consumers, the flag
> > > > will be removed once they are added. Current comment doesn't make sense.
> > > > What is the reason for the device hang if we have all the consumers in
> > > > place?
> > >
> > > Earlier, since there were no consumers for this clock, it got
> > > disabled via clk_disable_unused() and CLK_IGNORE_UNUSED helped
> > > prevent that.
> > >
> > > Now, since this clk is getting used indirectly via icc-clk
> > > framework, it doesn't qualify for being disabled by
> > > clk_disable_unused(). However, when icc_sync_state is called, if
> > > it sees there are no consumers for a path and that path gets
> > > disabled, the relevant clocks get disabled and eventually this
> > > clock also gets disabled. To avoid this have changed 'flags' from
> > > CLK_IGNORE_UNUSED -> CLK_IS_CRITICAL.
> >
> > You don't seem to be answering my question: "What is the reason for
> > the device hang if we have all the consumers in place?"
> > Could you please answer it rather than describing the CCF / icc-clk behaviour?
>
> Sorry if I hadn't expressed myself clearly. All the consumers are
> not there in place yet.
>
> > Are there any actual consumers for GPLL4 at this point? If not, why do
> > you want to keep it running? Usually all PLLs are shut down when there
> > are no consumers and then restarted when required. This is the
> > expected and correct behaviour.
>
> There are consumers for GPLL4, but they are getting disabled by
> clk_disable_unused (this is expected). There seems to be some
> consumer that got enabled in boot loader itself but not accounted
> in Linux because of which we are relying on CLK_IGNORE_UNUSED.
>
> If missing consumer(s) is identified, we can do away with this
> flag. Till that is done, was hoping CLK_IS_CRITICAL could help.
NAK, please identify missing consumers instead of landing workarounds.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks
2024-07-20 9:05 ` Dmitry Baryshkov
@ 2024-07-22 6:05 ` Varadarajan Narayanan
0 siblings, 0 replies; 14+ messages in thread
From: Varadarajan Narayanan @ 2024-07-22 6:05 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: andersson, mturquette, sboyd, robh, krzk+dt, conor+dt, gregkh,
konrad.dybcio, djakov, quic_wcheng, linux-arm-msm, linux-clk,
devicetree, linux-kernel, linux-usb, linux-pm
On Sat, Jul 20, 2024 at 12:05:59PM +0300, Dmitry Baryshkov wrote:
> On Sat, 20 Jul 2024 at 12:02, Varadarajan Narayanan
> <quic_varada@quicinc.com> wrote:
> >
> > On Thu, Jul 18, 2024 at 01:47:32PM +0300, Dmitry Baryshkov wrote:
> > > On Thu, 18 Jul 2024 at 13:42, Varadarajan Narayanan
> > > <quic_varada@quicinc.com> wrote:
> > > >
> > > > On Sat, Jul 13, 2024 at 07:21:29PM +0300, Dmitry Baryshkov wrote:
> > > > > On Thu, Jul 11, 2024 at 05:02:38PM GMT, Varadarajan Narayanan wrote:
> > > > > > Use the icc-clk framework to enable few clocks to be able to
> > > > > > create paths and use the peripherals connected on those NoCs.
> > > > > >
> > > > > > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> > > > > > ---
> > > > > > drivers/clk/qcom/gcc-ipq5332.c | 36 +++++++++++++++++++++++++++++-----
> > > > > > 1 file changed, 31 insertions(+), 5 deletions(-)
> > > > > >
> > > > > > diff --git a/drivers/clk/qcom/gcc-ipq5332.c b/drivers/clk/qcom/gcc-ipq5332.c
> > > > > > index f98591148a97..6d7672cae0f7 100644
> > > > > > --- a/drivers/clk/qcom/gcc-ipq5332.c
> > > > > > +++ b/drivers/clk/qcom/gcc-ipq5332.c
> > > > > > @@ -4,12 +4,14 @@
> > > > > > */
> > > > > >
> > > > > > #include <linux/clk-provider.h>
> > > > > > +#include <linux/interconnect-provider.h>
> > > > > > #include <linux/mod_devicetable.h>
> > > > > > #include <linux/module.h>
> > > > > > #include <linux/platform_device.h>
> > > > > > #include <linux/regmap.h>
> > > > > >
> > > > > > #include <dt-bindings/clock/qcom,ipq5332-gcc.h>
> > > > > > +#include <dt-bindings/interconnect/qcom,ipq5332.h>
> > > > > >
> > > > > > #include "clk-alpha-pll.h"
> > > > > > #include "clk-branch.h"
> > > > > > @@ -131,12 +133,14 @@ static struct clk_alpha_pll gpll4_main = {
> > > > > > * (will be added soon), so the clock framework
> > > > > > * disables this source. But some of the clocks
> > > > > > * initialized by boot loaders uses this source. So we
> > > > > > - * need to keep this clock ON. Add the
> > > > > > - * CLK_IGNORE_UNUSED flag so the clock will not be
> > > > > > - * disabled. Once the consumer in kernel is added, we
> > > > > > - * can get rid of this flag.
> > > > > > + * need to keep this clock ON.
> > > > > > + *
> > > > > > + * After initial bootup, when the ICC framework turns
> > > > > > + * off unused paths, as part of the icc-clk dependencies
> > > > > > + * this clock gets disabled resulting in a hang. Marking
> > > > > > + * it as critical to ensure it is not turned off.
> > > > >
> > > > > Previous comment was pretty clear: there are missing consumers, the flag
> > > > > will be removed once they are added. Current comment doesn't make sense.
> > > > > What is the reason for the device hang if we have all the consumers in
> > > > > place?
> > > >
> > > > Earlier, since there were no consumers for this clock, it got
> > > > disabled via clk_disable_unused() and CLK_IGNORE_UNUSED helped
> > > > prevent that.
> > > >
> > > > Now, since this clk is getting used indirectly via icc-clk
> > > > framework, it doesn't qualify for being disabled by
> > > > clk_disable_unused(). However, when icc_sync_state is called, if
> > > > it sees there are no consumers for a path and that path gets
> > > > disabled, the relevant clocks get disabled and eventually this
> > > > clock also gets disabled. To avoid this have changed 'flags' from
> > > > CLK_IGNORE_UNUSED -> CLK_IS_CRITICAL.
> > >
> > > You don't seem to be answering my question: "What is the reason for
> > > the device hang if we have all the consumers in place?"
> > > Could you please answer it rather than describing the CCF / icc-clk behaviour?
> >
> > Sorry if I hadn't expressed myself clearly. All the consumers are
> > not there in place yet.
> >
> > > Are there any actual consumers for GPLL4 at this point? If not, why do
> > > you want to keep it running? Usually all PLLs are shut down when there
> > > are no consumers and then restarted when required. This is the
> > > expected and correct behaviour.
> >
> > There are consumers for GPLL4, but they are getting disabled by
> > clk_disable_unused (this is expected). There seems to be some
> > consumer that got enabled in boot loader itself but not accounted
> > in Linux because of which we are relying on CLK_IGNORE_UNUSED.
> >
> > If missing consumer(s) is identified, we can do away with this
> > flag. Till that is done, was hoping CLK_IS_CRITICAL could help.
>
> NAK, please identify missing consumers instead of landing workarounds.
Please review v3, have identified the missing consumer.
Thanks
Varada
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2024-07-22 6:05 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-11 11:32 [PATCH v2 0/4] Add interconnect driver for IPQ5332 SoC Varadarajan Narayanan
2024-07-11 11:32 ` [PATCH v2 1/4] dt-bindings: interconnect: Add Qualcomm IPQ5332 support Varadarajan Narayanan
2024-07-11 11:58 ` Krzysztof Kozlowski
2024-07-11 11:32 ` [PATCH v2 2/4] dt-bindings: usb: qcom,dwc3: Update ipq5332 clock details Varadarajan Narayanan
2024-07-11 11:32 ` [PATCH v2 3/4] clk: qcom: ipq5332: Use icc-clk for enabling NoC related clocks Varadarajan Narayanan
2024-07-12 12:24 ` Konrad Dybcio
2024-07-13 16:21 ` Dmitry Baryshkov
2024-07-18 10:42 ` Varadarajan Narayanan
2024-07-18 10:47 ` Dmitry Baryshkov
2024-07-20 9:02 ` Varadarajan Narayanan
2024-07-20 9:05 ` Dmitry Baryshkov
2024-07-22 6:05 ` Varadarajan Narayanan
2024-07-11 11:32 ` [PATCH v2 4/4] arm64: dts: qcom: ipq5332: Add icc provider ability to gcc Varadarajan Narayanan
2024-07-12 12:24 ` Konrad Dybcio
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).