mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
interconnect: qcom: icc-rpm: Set bandwidth on both contexts
Up until now, for some reason we've only been setting bandwidth values
on the active-only context. That pretty much meant that RPM could lift
all votes when entering sleep mode. Or never sleep at all.
That in turn could potentially break things like USB wakeup, as the
connection between APSS and SNoC/PNoC would simply be dead.
Set the values appropriately.
Fixes: 30c8fa3ec6
("interconnect: qcom: Add MSM8916 interconnect provider driver")
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Acked-by: Georgi Djakov <djakov@kernel.org>
Link: https://lore.kernel.org/r/20230526-topic-smd_icc-v7-20-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
parent
6ed0e5e60e
commit
32846c4a8f
@ -204,34 +204,39 @@ static int qcom_icc_qos_set(struct icc_node *node)
|
||||
}
|
||||
}
|
||||
|
||||
static int qcom_icc_rpm_set(struct qcom_icc_node *qn, u64 sum_bw)
|
||||
static int qcom_icc_rpm_set(struct qcom_icc_node *qn, u64 *bw)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret, rpm_ctx = 0;
|
||||
u64 bw_bps;
|
||||
|
||||
if (qn->qos.ap_owned)
|
||||
return 0;
|
||||
|
||||
if (qn->mas_rpm_id != -1) {
|
||||
ret = qcom_icc_rpm_smd_send(QCOM_SMD_RPM_ACTIVE_STATE,
|
||||
RPM_BUS_MASTER_REQ,
|
||||
qn->mas_rpm_id,
|
||||
sum_bw);
|
||||
if (ret) {
|
||||
pr_err("qcom_icc_rpm_smd_send mas %d error %d\n",
|
||||
qn->mas_rpm_id, ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
for (rpm_ctx = 0; rpm_ctx < QCOM_SMD_RPM_STATE_NUM; rpm_ctx++) {
|
||||
bw_bps = icc_units_to_bps(bw[rpm_ctx]);
|
||||
|
||||
if (qn->slv_rpm_id != -1) {
|
||||
ret = qcom_icc_rpm_smd_send(QCOM_SMD_RPM_ACTIVE_STATE,
|
||||
RPM_BUS_SLAVE_REQ,
|
||||
qn->slv_rpm_id,
|
||||
sum_bw);
|
||||
if (ret) {
|
||||
pr_err("qcom_icc_rpm_smd_send slv %d error %d\n",
|
||||
qn->slv_rpm_id, ret);
|
||||
return ret;
|
||||
if (qn->mas_rpm_id != -1) {
|
||||
ret = qcom_icc_rpm_smd_send(rpm_ctx,
|
||||
RPM_BUS_MASTER_REQ,
|
||||
qn->mas_rpm_id,
|
||||
bw_bps);
|
||||
if (ret) {
|
||||
pr_err("qcom_icc_rpm_smd_send mas %d error %d\n",
|
||||
qn->mas_rpm_id, ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (qn->slv_rpm_id != -1) {
|
||||
ret = qcom_icc_rpm_smd_send(rpm_ctx,
|
||||
RPM_BUS_SLAVE_REQ,
|
||||
qn->slv_rpm_id,
|
||||
bw_bps);
|
||||
if (ret) {
|
||||
pr_err("qcom_icc_rpm_smd_send slv %d error %d\n",
|
||||
qn->slv_rpm_id, ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,7 +341,6 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
|
||||
struct qcom_icc_provider *qp;
|
||||
struct qcom_icc_node *src_qn = NULL, *dst_qn = NULL;
|
||||
struct icc_provider *provider;
|
||||
u64 sum_bw;
|
||||
u64 active_rate, sleep_rate;
|
||||
u64 agg_avg[QCOM_SMD_RPM_STATE_NUM], agg_peak[QCOM_SMD_RPM_STATE_NUM];
|
||||
u64 max_agg_avg;
|
||||
@ -350,14 +354,12 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
|
||||
|
||||
qcom_icc_bus_aggregate(provider, agg_avg, agg_peak, &max_agg_avg);
|
||||
|
||||
sum_bw = icc_units_to_bps(max_agg_avg);
|
||||
|
||||
ret = qcom_icc_rpm_set(src_qn, sum_bw);
|
||||
ret = qcom_icc_rpm_set(src_qn, agg_avg);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (dst_qn) {
|
||||
ret = qcom_icc_rpm_set(dst_qn, sum_bw);
|
||||
ret = qcom_icc_rpm_set(dst_qn, agg_avg);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user