diff options
author | Odelu Kukatla <quic_okukatla@quicinc.com> | 2024-07-04 18:25:15 +0530 |
---|---|---|
committer | Georgi Djakov <djakov@kernel.org> | 2024-07-04 22:43:59 +0300 |
commit | 8b6bd8391f91dc85621547fe3c0af8086a012bcb (patch) | |
tree | 30d5e94f2b012a873828feb1e556929d1967d7fd | |
parent | fbd908bb8bc0e3714731467ac130d35492ed2187 (diff) | |
download | linux-stable-8b6bd8391f91dc85621547fe3c0af8086a012bcb.tar.gz linux-stable-8b6bd8391f91dc85621547fe3c0af8086a012bcb.tar.bz2 linux-stable-8b6bd8391f91dc85621547fe3c0af8086a012bcb.zip |
interconnect: qcom: Fix DT backwards compatibility for QoS
Add qos_clks_required flag to skip QoS configuration if clocks property
is not populated in devicetree for providers which require clocks to be
enabled for accessing registers. This is to keep the QoS configuration
backwards compatible with devices that have older DTB.
Reported-by: Bjorn Andersson <andersson@kernel.org>
Closes: https://lore.kernel.org/all/ciji6nlxn752ina4tmh6kwvek52nxpnguomqek6plwvwgvoqef@yrtexkpmn5br/
Signed-off-by: Odelu Kukatla <quic_okukatla@quicinc.com>
Tested-by: Bjorn Andersson <andersson@kernel.org>
Fixes: fbd908bb8bc0 ("interconnect: qcom: sc7280: enable QoS configuration")
Link: https://lore.kernel.org/r/20240704125515.22194-1-quic_okukatla@quicinc.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
-rw-r--r-- | drivers/interconnect/qcom/icc-rpmh.c | 2 | ||||
-rw-r--r-- | drivers/interconnect/qcom/icc-rpmh.h | 1 | ||||
-rw-r--r-- | drivers/interconnect/qcom/sc7280.c | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/drivers/interconnect/qcom/icc-rpmh.c b/drivers/interconnect/qcom/icc-rpmh.c index ceea9522df83..b8f49cfca6e0 100644 --- a/drivers/interconnect/qcom/icc-rpmh.c +++ b/drivers/interconnect/qcom/icc-rpmh.c @@ -311,7 +311,7 @@ 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) { + 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; } diff --git a/drivers/interconnect/qcom/icc-rpmh.h b/drivers/interconnect/qcom/icc-rpmh.h index 9a5142c70486..14db89850fb3 100644 --- a/drivers/interconnect/qcom/icc-rpmh.h +++ b/drivers/interconnect/qcom/icc-rpmh.h @@ -153,6 +153,7 @@ struct qcom_icc_desc { size_t num_nodes; struct qcom_icc_bcm * const *bcms; size_t num_bcms; + bool qos_clks_required; }; 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 759c609a20bf..167971f8e8be 100644 --- a/drivers/interconnect/qcom/sc7280.c +++ b/drivers/interconnect/qcom/sc7280.c @@ -1691,6 +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, }; static struct qcom_icc_bcm * const aggre2_noc_bcms[] = { @@ -1722,6 +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, }; static struct qcom_icc_bcm * const clk_virt_bcms[] = { |