Skip to content

Commit 5833c9b

Browse files
shawnguo2Georgi Djakov
authored andcommitted
interconnect: qcom: sdm660: Correct NOC_QOS_PRIORITY shift and mask
The NOC_QOS_PRIORITY shift and mask do not match what vendor kernel defines [1]. Correct them per vendor kernel. As the result of NOC_QOS_PRIORITY_P0_SHIFT being 0, the definition can be dropped and regmap_update_bits() call on P0 can be simplified a bit. [1] https://source.codeaurora.org/quic/la/kernel/msm-4.4/tree/drivers/soc/qcom/msm_bus/msm_bus_noc_adhoc.c?h=LA.UM.8.2.r1-04800-sdm660.0#n37 Fixes: f80a1d4 ("interconnect: qcom: Add SDM660 interconnect provider driver") Signed-off-by: Shawn Guo <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Georgi Djakov <[email protected]>
1 parent a06c2e5 commit 5833c9b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/interconnect/qcom/sdm660.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
#define NOC_PERM_MODE_BYPASS (1 << NOC_QOS_MODE_BYPASS)
4545

4646
#define NOC_QOS_PRIORITYn_ADDR(n) (0x8 + (n * 0x1000))
47-
#define NOC_QOS_PRIORITY_MASK 0xf
47+
#define NOC_QOS_PRIORITY_P1_MASK 0xc
48+
#define NOC_QOS_PRIORITY_P0_MASK 0x3
4849
#define NOC_QOS_PRIORITY_P1_SHIFT 0x2
49-
#define NOC_QOS_PRIORITY_P0_SHIFT 0x3
5050

5151
#define NOC_QOS_MODEn_ADDR(n) (0xc + (n * 0x1000))
5252
#define NOC_QOS_MODEn_MASK 0x3
@@ -624,13 +624,12 @@ static int qcom_icc_noc_set_qos_priority(struct regmap *rmap,
624624
/* Must be updated one at a time, P1 first, P0 last */
625625
val = qos->areq_prio << NOC_QOS_PRIORITY_P1_SHIFT;
626626
rc = regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port),
627-
NOC_QOS_PRIORITY_MASK, val);
627+
NOC_QOS_PRIORITY_P1_MASK, val);
628628
if (rc)
629629
return rc;
630630

631-
val = qos->prio_level << NOC_QOS_PRIORITY_P0_SHIFT;
632631
return regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port),
633-
NOC_QOS_PRIORITY_MASK, val);
632+
NOC_QOS_PRIORITY_P0_MASK, qos->prio_level);
634633
}
635634

636635
static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw)

0 commit comments

Comments
 (0)