All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] interconnect: qcom: sdm660: Correct NOC_QOS_PRIORITY shift and mask
@ 2021-09-02  5:49 Shawn Guo
  2021-09-02  6:57 ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 2+ messages in thread
From: Shawn Guo @ 2021-09-02  5:49 UTC (permalink / raw)
  To: Georgi Djakov
  Cc: AngeloGioacchino Del Regno, Bjorn Andersson, Dmitry Baryshkov,
	Yassine Oudjana, linux-arm-msm, linux-pm, Shawn Guo

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: f80a1d414328 ("interconnect: qcom: Add SDM660 interconnect provider driver")
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
Changes for v2:
- Follow Angelo's suggestion to drop NOC_QOS_PRIORITY_P0_SHIFT.

 drivers/interconnect/qcom/sdm660.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c
index 6fd8e9800218..fb23a5b780a4 100644
--- a/drivers/interconnect/qcom/sdm660.c
+++ b/drivers/interconnect/qcom/sdm660.c
@@ -44,9 +44,9 @@
 #define NOC_PERM_MODE_BYPASS		(1 << NOC_QOS_MODE_BYPASS)
 
 #define NOC_QOS_PRIORITYn_ADDR(n)	(0x8 + (n * 0x1000))
-#define NOC_QOS_PRIORITY_MASK		0xf
+#define NOC_QOS_PRIORITY_P1_MASK	0xc
+#define NOC_QOS_PRIORITY_P0_MASK	0x3
 #define NOC_QOS_PRIORITY_P1_SHIFT	0x2
-#define NOC_QOS_PRIORITY_P0_SHIFT	0x3
 
 #define NOC_QOS_MODEn_ADDR(n)		(0xc + (n * 0x1000))
 #define NOC_QOS_MODEn_MASK		0x3
@@ -634,13 +634,12 @@ static int qcom_icc_noc_set_qos_priority(struct regmap *rmap,
 	/* Must be updated one at a time, P1 first, P0 last */
 	val = qos->areq_prio << NOC_QOS_PRIORITY_P1_SHIFT;
 	rc = regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port),
-				NOC_QOS_PRIORITY_MASK, val);
+				NOC_QOS_PRIORITY_P1_MASK, val);
 	if (rc)
 		return rc;
 
-	val = qos->prio_level << NOC_QOS_PRIORITY_P0_SHIFT;
 	return regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port),
-				  NOC_QOS_PRIORITY_MASK, val);
+				  NOC_QOS_PRIORITY_P0_MASK, qos->prio_level);
 }
 
 static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] interconnect: qcom: sdm660: Correct NOC_QOS_PRIORITY shift and mask
  2021-09-02  5:49 [PATCH v2] interconnect: qcom: sdm660: Correct NOC_QOS_PRIORITY shift and mask Shawn Guo
@ 2021-09-02  6:57 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 2+ messages in thread
From: AngeloGioacchino Del Regno @ 2021-09-02  6:57 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Georgi Djakov, AngeloGioacchino Del Regno, Bjorn Andersson,
	Dmitry Baryshkov, Yassine Oudjana, MSM, linux-pm

Il giorno gio 2 set 2021 alle ore 07:49 Shawn Guo
<shawn.guo@linaro.org> ha scritto:
>
> 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: f80a1d414328 ("interconnect: qcom: Add SDM660 interconnect provider driver")
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Reviewed-by: AngeloGioacchino Del Regno
<angelogioacchino.delregno@somainline.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-02  6:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02  5:49 [PATCH v2] interconnect: qcom: sdm660: Correct NOC_QOS_PRIORITY shift and mask Shawn Guo
2021-09-02  6:57 ` AngeloGioacchino Del Regno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.