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-next>] [day] [month] [year] [list]
Message-ID: <20240827172524.89-1-quic_rlaggysh@quicinc.com>
Date: Tue, 27 Aug 2024 17:25:24 +0000
From: Raviteja Laggyshetty <quic_rlaggysh@...cinc.com>
To: Georgi Djakov <djakov@...nel.org>
CC: Konrad Dybcio <konradybcio@...nel.org>,
        Jeff Johnson
	<quic_jjohnson@...cinc.com>, <quic_mdtipton@...cinc.com>,
        <quic_okukatla@...cinc.com>, <linux-arm-msm@...r.kernel.org>,
        <linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        "Raviteja
 Laggyshetty" <quic_rlaggysh@...cinc.com>,
        Bjorn Andersson
	<andersson@...nel.org>
Subject: [PATCH] interconnect: qcom: icc-rpmh: probe defer incase of missing QoS clock dependency

Return -EPROBE_DEFER from interconnect provider incase probe defer is
received from devm_clk_bulk_get_all(). This would help in reattempting
the inteconnect driver probe, once the required QoS clocks are
available.
Rename qos_clks_required flag to qos_requires_clocks in qcom_icc_desc
structure. This flag indicates that interconnect provider requires
clocks for programming QoS.

Suggested-by: Bjorn Andersson <andersson@...nel.org>
Signed-off-by: Raviteja Laggyshetty <quic_rlaggysh@...cinc.com>
---
 drivers/interconnect/qcom/icc-rpmh.c | 10 +++++++---
 drivers/interconnect/qcom/icc-rpmh.h |  2 +-
 drivers/interconnect/qcom/sc7280.c   |  4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/interconnect/qcom/icc-rpmh.c b/drivers/interconnect/qcom/icc-rpmh.c
index f49a8e0cb03c..5417abf59e28 100644
--- a/drivers/interconnect/qcom/icc-rpmh.c
+++ b/drivers/interconnect/qcom/icc-rpmh.c
@@ -311,9 +311,13 @@ int qcom_icc_rpmh_probe(struct platform_device *pdev)
 		}
 
 		qp->num_clks = devm_clk_bulk_get_all(qp->dev, &qp->clks);
-		if (qp->num_clks < 0 || (!qp->num_clks && desc->qos_clks_required)) {
-			dev_info(dev, "Skipping QoS, failed to get clk: %d\n", qp->num_clks);
-			goto skip_qos_config;
+		if (qp->num_clks < 0 || (!qp->num_clks && desc->qos_requires_clocks)) {
+			if (qp->num_clks != -EPROBE_DEFER) {
+				dev_info(dev, "Skipping QoS, failed to get clk: %d\n",
+						qp->num_clks);
+				goto skip_qos_config;
+			}
+			return qp->num_clks;
 		}
 
 		ret = qcom_icc_rpmh_configure_qos(qp);
diff --git a/drivers/interconnect/qcom/icc-rpmh.h b/drivers/interconnect/qcom/icc-rpmh.h
index 14db89850fb3..82344c734091 100644
--- a/drivers/interconnect/qcom/icc-rpmh.h
+++ b/drivers/interconnect/qcom/icc-rpmh.h
@@ -153,7 +153,7 @@ struct qcom_icc_desc {
 	size_t num_nodes;
 	struct qcom_icc_bcm * const *bcms;
 	size_t num_bcms;
-	bool qos_clks_required;
+	bool qos_requires_clocks;
 };
 
 int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
diff --git a/drivers/interconnect/qcom/sc7280.c b/drivers/interconnect/qcom/sc7280.c
index 167971f8e8be..6c314e000c3a 100644
--- a/drivers/interconnect/qcom/sc7280.c
+++ b/drivers/interconnect/qcom/sc7280.c
@@ -1691,7 +1691,7 @@ static const struct qcom_icc_desc sc7280_aggre1_noc = {
 	.num_nodes = ARRAY_SIZE(aggre1_noc_nodes),
 	.bcms = aggre1_noc_bcms,
 	.num_bcms = ARRAY_SIZE(aggre1_noc_bcms),
-	.qos_clks_required = true,
+	.qos_requires_clocks = true,
 };
 
 static struct qcom_icc_bcm * const aggre2_noc_bcms[] = {
@@ -1723,7 +1723,7 @@ static const struct qcom_icc_desc sc7280_aggre2_noc = {
 	.num_nodes = ARRAY_SIZE(aggre2_noc_nodes),
 	.bcms = aggre2_noc_bcms,
 	.num_bcms = ARRAY_SIZE(aggre2_noc_bcms),
-	.qos_clks_required = true,
+	.qos_requires_clocks = true,
 };
 
 static struct qcom_icc_bcm * const clk_virt_bcms[] = {
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ