Skip to content

Commit d8630f0

Browse files
Mike TiptonGeorgi Djakov
authored andcommitted
interconnect: qcom: Add support for mask-based BCMs
Some BCMs aren't directly associated with the data path (i.e. ACV) and therefore don't communicate using BW. Instead, they are simply enabled/disabled with a simple bit mask. Add support for these. Origin commit retrieved from: https://git.codelinaro.org/clo/la/kernel/msm-5.15/-/commit/2d1573e0206998151b342e6b52a4c0f7234d7e36 Signed-off-by: Mike Tipton <mdtipton@codeaurora.org> [narmstrong: removed copyright change from original commit] Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230619-topic-sm8550-upstream-interconnect-mask-vote-v2-1-709474b151cc@linaro.org Fixes: fafc114 ("interconnect: qcom: Add SM8450 interconnect provider driver") Signed-off-by: Georgi Djakov <djakov@kernel.org>
1 parent 06c2afb commit d8630f0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

drivers/interconnect/qcom/bcm-voter.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ static void bcm_aggregate(struct qcom_icc_bcm *bcm)
8383

8484
temp = agg_peak[bucket] * bcm->vote_scale;
8585
bcm->vote_y[bucket] = bcm_div(temp, bcm->aux_data.unit);
86+
87+
if (bcm->enable_mask && (bcm->vote_x[bucket] || bcm->vote_y[bucket])) {
88+
bcm->vote_x[bucket] = 0;
89+
bcm->vote_y[bucket] = bcm->enable_mask;
90+
}
8691
}
8792

8893
if (bcm->keepalive && bcm->vote_x[QCOM_ICC_BUCKET_AMC] == 0 &&

drivers/interconnect/qcom/icc-rpmh.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ struct qcom_icc_node {
8181
* @vote_x: aggregated threshold values, represents sum_bw when @type is bw bcm
8282
* @vote_y: aggregated threshold values, represents peak_bw when @type is bw bcm
8383
* @vote_scale: scaling factor for vote_x and vote_y
84+
* @enable_mask: optional mask to send as vote instead of vote_x/vote_y
8485
* @dirty: flag used to indicate whether the bcm needs to be committed
8586
* @keepalive: flag used to indicate whether a keepalive is required
8687
* @aux_data: auxiliary data used when calculating threshold values and
@@ -97,6 +98,7 @@ struct qcom_icc_bcm {
9798
u64 vote_x[QCOM_ICC_NUM_BUCKETS];
9899
u64 vote_y[QCOM_ICC_NUM_BUCKETS];
99100
u64 vote_scale;
101+
u32 enable_mask;
100102
bool dirty;
101103
bool keepalive;
102104
struct bcm_db aux_data;

0 commit comments

Comments
 (0)