Skip to content

Commit a867cf9

Browse files
konradybcioGeorgi Djakov
authored andcommitted
interconnect: qcom: icc-rpm: Enforce 2 or 0 bus clocks
For SMD RPM bus scaling to work, we need a pair of sleep-wake clocks. The variable number of them we previously supported was only a hack to keep the clocks required for QoS register access, but now that these are separated, we can leave bus_clks to the actual bus clocks. In cases where there is no actual bus scaling (such as A0NoC on MSM8996 and GNoC on SDM660 where the HLOS is only supposed to program the QoS registers and the bus is either static or controlled remotely), allow for no clock scaling with a boolean property. Remove all the code related to allowing an arbitrary number of bus_clks, replace the number by BUS_CLK_MAX (= 2) and guard the bus clock paths to ensure they are not taken on non-scaling buses. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230228-topic-qos-v8-6-ee696a2c15a9@linaro.org Signed-off-by: Georgi Djakov <djakov@kernel.org>
1 parent 2e2113c commit a867cf9

4 files changed

Lines changed: 7 additions & 13 deletions

File tree

drivers/interconnect/qcom/icc-rpm.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -449,17 +449,9 @@ int qnoc_probe(struct platform_device *pdev)
449449
for (i = 0; i < cd_num; i++)
450450
qp->intf_clks[i].id = cds[i];
451451

452-
if (desc->num_bus_clocks) {
453-
cds = desc->bus_clocks;
454-
cd_num = desc->num_bus_clocks;
455-
} else {
456-
cds = bus_clocks;
457-
cd_num = ARRAY_SIZE(bus_clocks);
458-
}
459-
460-
for (i = 0; i < cd_num; i++)
461-
qp->bus_clks[i].id = cds[i];
462-
qp->num_bus_clks = cd_num;
452+
qp->num_bus_clks = desc->no_clk_scaling ? 0 : NUM_BUS_CLKS;
453+
for (i = 0; i < qp->num_bus_clks; i++)
454+
qp->bus_clks[i].id = bus_clocks[i];
463455

464456
qp->type = desc->type;
465457
qp->qos_offset = desc->qos_offset;

drivers/interconnect/qcom/icc-rpm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ enum qcom_icc_type {
2525
/**
2626
* struct qcom_icc_provider - Qualcomm specific interconnect provider
2727
* @provider: generic interconnect provider
28-
* @num_bus_clks: the total number of bus_clks clk_bulk_data entries
28+
* @num_bus_clks: the total number of bus_clks clk_bulk_data entries (0 or 2)
2929
* @num_intf_clks: the total number of intf_clks clk_bulk_data entries
3030
* @type: the ICC provider type
3131
* @regmap: regmap for QoS registers read/write access
@@ -100,9 +100,9 @@ struct qcom_icc_desc {
100100
struct qcom_icc_node * const *nodes;
101101
size_t num_nodes;
102102
const char * const *bus_clocks;
103-
size_t num_bus_clocks;
104103
const char * const *intf_clocks;
105104
size_t num_intf_clocks;
105+
bool no_clk_scaling;
106106
enum qcom_icc_type type;
107107
const struct regmap_config *regmap_cfg;
108108
unsigned int qos_offset;

drivers/interconnect/qcom/msm8996.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,7 @@ static const struct qcom_icc_desc msm8996_a0noc = {
18191819
.num_nodes = ARRAY_SIZE(a0noc_nodes),
18201820
.intf_clocks = a0noc_intf_clocks,
18211821
.num_intf_clocks = ARRAY_SIZE(a0noc_intf_clocks),
1822+
.no_clk_scaling = true,
18221823
.regmap_cfg = &msm8996_a0noc_regmap_config
18231824
};
18241825

drivers/interconnect/qcom/sdm660.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,6 +1616,7 @@ static const struct qcom_icc_desc sdm660_gnoc = {
16161616
.nodes = sdm660_gnoc_nodes,
16171617
.num_nodes = ARRAY_SIZE(sdm660_gnoc_nodes),
16181618
.regmap_cfg = &sdm660_gnoc_regmap_config,
1619+
.no_clk_scaling = true,
16191620
};
16201621

16211622
static struct qcom_icc_node * const sdm660_mnoc_nodes[] = {

0 commit comments

Comments
 (0)