Skip to contentSkip to conversation

clk: mediatek: mt8365: Fix inverted topclk operations

PATCH Applied Markus Schneider-Pargmann 6 participants 13 messages May 11, 2023 – Jun 13, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: mediatek: mt8365: Fix inverted topclk operations

The given operations are inverted for the wrong registers which makes multiple of the mt8365 hardware units unusable. In my setup at least usb did not work.

Fixed by swapping the operations with the inverted ones.

Fixes 905b7430d3cc ("clk: mediatek: mt8365: Convert simple_gate to mtk_gate clocks")
---
 drivers/clk/mediatek/clk-mt8365.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/mediatek/clk-mt8365.c +3 -3
index 6b4e193f648d..6d785ec5754d 100644
@@ -583,15 +583,15 @@ static const struct mtk_gate_regs top2_cg_regs = {
 
 #define GATE_TOP0(_id, _name, _parent, _shift)			\
 	GATE_MTK(_id, _name, _parent, &top0_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
+		 _shift, &mtk_clk_gate_ops_no_setclr)
 
 #define GATE_TOP1(_id, _name, _parent, _shift)			\
 	GATE_MTK(_id, _name, _parent, &top1_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr)
+		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 #define GATE_TOP2(_id, _name, _parent, _shift)			\
 	GATE_MTK(_id, _name, _parent, &top2_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr)
+		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate top_clk_gates[] = {
 	GATE_TOP0(CLK_TOP_CONN_32K, "conn_32k", "clk32k", 10),
Signature · 1 line
2.40.1
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Markus Schneider-Pargmann
Quoted 9 lines · Markus Schneider-Pargmann

The given operations are inverted for the wrong registers which makes multiple of the mt8365 hardware units unusable. In my setup at least usb did not work.

Fixed by swapping the operations with the inverted ones.

Fixes 905b7430d3cc ("clk: mediatek: mt8365: Convert simple_gate to mtk_gate clocks")
Quoted 27 lines
---
  drivers/clk/mediatek/clk-mt8365.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/mediatek/clk-mt8365.c +3 -3
index 6b4e193f648d..6d785ec5754d 100644
@@ -583,15 +583,15 @@ static const struct mtk_gate_regs top2_cg_regs = {
 
  #define GATE_TOP0(_id, _name, _parent, _shift)			\
  	GATE_MTK(_id, _name, _parent, &top0_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
+		 _shift, &mtk_clk_gate_ops_no_setclr)
 
  #define GATE_TOP1(_id, _name, _parent, _shift)			\
  	GATE_MTK(_id, _name, _parent, &top1_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr)
+		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
  #define GATE_TOP2(_id, _name, _parent, _shift)			\
  	GATE_MTK(_id, _name, _parent, &top2_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr)
+		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
  static const struct mtk_gate top_clk_gates[] = {
  	GATE_TOP0(CLK_TOP_CONN_32K, "conn_32k", "clk32k", 10),
maintainer Reviewed-by
#3 lore raw

Il 12/05/23 13:51, Matthias Brugger ha scritto:

Quoted 8 lines · Markus Schneider-Pargmann
Quoted 5 lines

The given operations are inverted for the wrong registers which makes multiple of the mt8365 hardware units unusable. In my setup at least usb did not work.

Fixed by swapping the operations with the inverted ones.

...with the not inverted ones, you mean!

Anyway,

Quoted 30 lines
Quoted 4 lines
Fixes 905b7430d3cc ("clk: mediatek: mt8365: Convert simple_gate to mtk_gate clocks")
Quoted 23 lines

---
  drivers/clk/mediatek/clk-mt8365.c | 6 +++---

  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/mediatek/clk-mt8365.c +3 -3
index 6b4e193f648d..6d785ec5754d 100644
@@ -583,15 +583,15 @@ static const struct mtk_gate_regs top2_cg_regs = {
   #define GATE_TOP0(_id, _name, _parent, _shift)            \
       GATE_MTK(_id, _name, _parent, &top0_cg_regs,        \
-         _shift, &mtk_clk_gate_ops_no_setclr_inv)
+         _shift, &mtk_clk_gate_ops_no_setclr)
   #define GATE_TOP1(_id, _name, _parent, _shift)            \
       GATE_MTK(_id, _name, _parent, &top1_cg_regs,        \
-         _shift, &mtk_clk_gate_ops_no_setclr)
+         _shift, &mtk_clk_gate_ops_no_setclr_inv)
   #define GATE_TOP2(_id, _name, _parent, _shift)            \
       GATE_MTK(_id, _name, _parent, &top2_cg_regs,        \
-         _shift, &mtk_clk_gate_ops_no_setclr)
+         _shift, &mtk_clk_gate_ops_no_setclr_inv)
   static const struct mtk_gate top_clk_gates[] = {
       GATE_TOP0(CLK_TOP_CONN_32K, "conn_32k", "clk32k", 10),
#4 lore raw
Quoted 11 lines · AngeloGioacchino Del Regno

Il 12/05/23 13:51, Matthias Brugger ha scritto:

Quoted 8 lines · Markus Schneider-Pargmann
Quoted 5 lines

The given operations are inverted for the wrong registers which makes multiple of the mt8365 hardware units unusable. In my setup at least usb did not work.

Fixed by swapping the operations with the inverted ones.

...with the not inverted ones, you mean!

Actually now I am not sure how to express it correctly, maybe I should have just left that sentence out of the commit message.

I meant replacing the no_setclr_inv with no_setclr for TOP0 and no_setclr with no_setclr_inv for TOP1/2.

Best,
Markus

Quoted 38 lines

Anyway,

Quoted 31 lines
Quoted 5 lines
Fixes 905b7430d3cc ("clk: mediatek: mt8365: Convert simple_gate to

mtk_gate clocks")

Quoted 23 lines

---
  drivers/clk/mediatek/clk-mt8365.c | 6 +++---

  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/mediatek/clk-mt8365.c +3 -3
index 6b4e193f648d..6d785ec5754d 100644
@@ -583,15 +583,15 @@ static const struct mtk_gate_regs top2_cg_regs = {
   #define GATE_TOP0(_id, _name, _parent, _shift)            \
       GATE_MTK(_id, _name, _parent, &top0_cg_regs,        \
-         _shift, &mtk_clk_gate_ops_no_setclr_inv)
+         _shift, &mtk_clk_gate_ops_no_setclr)
   #define GATE_TOP1(_id, _name, _parent, _shift)            \
       GATE_MTK(_id, _name, _parent, &top1_cg_regs,        \
-         _shift, &mtk_clk_gate_ops_no_setclr)
+         _shift, &mtk_clk_gate_ops_no_setclr_inv)
   #define GATE_TOP2(_id, _name, _parent, _shift)            \
       GATE_MTK(_id, _name, _parent, &top2_cg_regs,        \
-         _shift, &mtk_clk_gate_ops_no_setclr)
+         _shift, &mtk_clk_gate_ops_no_setclr_inv)
   static const struct mtk_gate top_clk_gates[] = {
       GATE_TOP0(CLK_TOP_CONN_32K, "conn_32k", "clk32k", 10),
#5 lore raw

Il 15/05/23 16:01, Markus Schneider-Pargmann ha scritto:

Quoted 11 lines · AngeloGioacchino Del Regno
Quoted 10 lines

Il 12/05/23 13:51, Matthias Brugger ha scritto:

Quoted 8 lines · Markus Schneider-Pargmann
Quoted 5 lines

The given operations are inverted for the wrong registers which makes multiple of the mt8365 hardware units unusable. In my setup at least usb did not work.

Fixed by swapping the operations with the inverted ones.

Quoted 8 lines
Quoted 1 line

...with the not inverted ones, you mean!

Actually now I am not sure how to express it correctly, maybe I should have just left that sentence out of the commit message.

I meant replacing the no_setclr_inv with no_setclr for TOP0 and no_setclr with no_setclr_inv for TOP1/2.

Yeah, the sentence may be a bit confusing, but you're actually inverting the inverted ones and the non-inverted ones.

It's fine, anyway, this commit can get picked as-is imo :-D

Quoted 41 lines

Best,
Markus

Quoted 38 lines

Anyway,

Quoted 31 lines
Quoted 5 lines
Fixes 905b7430d3cc ("clk: mediatek: mt8365: Convert simple_gate to

mtk_gate clocks")

Quoted 23 lines
---
   drivers/clk/mediatek/clk-mt8365.c | 6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/mediatek/clk-mt8365.c +3 -3
index 6b4e193f648d..6d785ec5754d 100644
@@ -583,15 +583,15 @@ static const struct mtk_gate_regs top2_cg_regs = {
   #define GATE_TOP0(_id, _name, _parent, _shift)            \
       GATE_MTK(_id, _name, _parent, &top0_cg_regs,        \
-         _shift, &mtk_clk_gate_ops_no_setclr_inv)
+         _shift, &mtk_clk_gate_ops_no_setclr)
   #define GATE_TOP1(_id, _name, _parent, _shift)            \
       GATE_MTK(_id, _name, _parent, &top1_cg_regs,        \
-         _shift, &mtk_clk_gate_ops_no_setclr)
+         _shift, &mtk_clk_gate_ops_no_setclr_inv)
   #define GATE_TOP2(_id, _name, _parent, _shift)            \
       GATE_MTK(_id, _name, _parent, &top2_cg_regs,        \
-         _shift, &mtk_clk_gate_ops_no_setclr)
+         _shift, &mtk_clk_gate_ops_no_setclr_inv)
   static const struct mtk_gate top_clk_gates[] = {
       GATE_TOP0(CLK_TOP_CONN_32K, "conn_32k", "clk32k", 10),
#6 lore raw
In reply to Markus Schneider-Pargmann

Hi,

just wanted to ask if I need to do something specific for it to go into a rc? Sorry if I missed doing something for that, I haven't had to fix something in an rc that often before.

Best,
Markus

Quoted 39 lines · Markus Schneider-Pargmann

The given operations are inverted for the wrong registers which makes multiple of the mt8365 hardware units unusable. In my setup at least usb did not work.

Fixed by swapping the operations with the inverted ones.

Fixes 905b7430d3cc ("clk: mediatek: mt8365: Convert simple_gate to mtk_gate clocks")
---
 drivers/clk/mediatek/clk-mt8365.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/mediatek/clk-mt8365.c +3 -3
index 6b4e193f648d..6d785ec5754d 100644
@@ -583,15 +583,15 @@ static const struct mtk_gate_regs top2_cg_regs = {
 
 #define GATE_TOP0(_id, _name, _parent, _shift)			\
 	GATE_MTK(_id, _name, _parent, &top0_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
+		 _shift, &mtk_clk_gate_ops_no_setclr)
 
 #define GATE_TOP1(_id, _name, _parent, _shift)			\
 	GATE_MTK(_id, _name, _parent, &top1_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr)
+		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 #define GATE_TOP2(_id, _name, _parent, _shift)			\
 	GATE_MTK(_id, _name, _parent, &top2_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr)
+		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate top_clk_gates[] = {
 	GATE_TOP0(CLK_TOP_CONN_32K, "conn_32k", "clk32k", 10),
Signature · 1 line
2.40.1
#7 lore raw
Quoted 3 lines · Markus Schneider-Pargmann

just wanted to ask if I need to do something specific for it to go into a rc? Sorry if I missed doing something for that, I haven't had to fix something in an rc that often before.

I think the Fixes tag is enough to indicate that.

Steven, is there still time for this fix be queued up for v6.4-rc?

Thanks,

Kevin

Quoted 40 lines · Markus Schneider-Pargmann
Quoted 39 lines

The given operations are inverted for the wrong registers which makes multiple of the mt8365 hardware units unusable. In my setup at least usb did not work.

Fixed by swapping the operations with the inverted ones.

Fixes 905b7430d3cc ("clk: mediatek: mt8365: Convert simple_gate to mtk_gate clocks")
---
 drivers/clk/mediatek/clk-mt8365.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/mediatek/clk-mt8365.c +3 -3
index 6b4e193f648d..6d785ec5754d 100644
@@ -583,15 +583,15 @@ static const struct mtk_gate_regs top2_cg_regs = {
 
 #define GATE_TOP0(_id, _name, _parent, _shift)			\
 	GATE_MTK(_id, _name, _parent, &top0_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
+		 _shift, &mtk_clk_gate_ops_no_setclr)
 
 #define GATE_TOP1(_id, _name, _parent, _shift)			\
 	GATE_MTK(_id, _name, _parent, &top1_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr)
+		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 #define GATE_TOP2(_id, _name, _parent, _shift)			\
 	GATE_MTK(_id, _name, _parent, &top2_cg_regs,		\
-		 _shift, &mtk_clk_gate_ops_no_setclr)
+		 _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate top_clk_gates[] = {
 	GATE_TOP0(CLK_TOP_CONN_32K, "conn_32k", "clk32k", 10),
Signature · 1 line
2.40.1
#8 lore raw
Quoted 9 lines · Kevin Hilman
Quoted 3 lines · Markus Schneider-Pargmann

just wanted to ask if I need to do something specific for it to go into a rc? Sorry if I missed doing something for that, I haven't had to fix something in an rc that often before.

I think the Fixes tag is enough to indicate that.

Steven, is there still time for this fix be queued up for v6.4-rc?

Steven: gentle reminder ping.

maintainer
#9 lore raw

Quoting Kevin Hilman (2023-06-09 11:21:30)

Quoted 8 lines
Quoted 6 lines · Kevin Hilman
Quoted 3 lines · Markus Schneider-Pargmann

just wanted to ask if I need to do something specific for it to go into a rc? Sorry if I missed doing something for that, I haven't had to fix something in an rc that often before.

Quoted 5 lines
Quoted 3 lines

I think the Fixes tag is enough to indicate that.

Steven, is there still time for this fix be queued up for v6.4-rc?

Steven: gentle reminder ping.

Who's Steven :)

#10 lore raw
Quoted 9 lines · Stephen Boyd

Quoting Kevin Hilman (2023-06-09 11:21:30)

Quoted 8 lines
Quoted 6 lines · Kevin Hilman
Quoted 3 lines · Markus Schneider-Pargmann

just wanted to ask if I need to do something specific for it to go into a rc? Sorry if I missed doing something for that, I haven't had to fix something in an rc that often before.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

I think the Fixes tag is enough to indicate that.

Steven, is there still time for this fix be queued up for v6.4-rc?

Steven: gentle reminder ping.

Who's Steven :)

Sorry, I confused you with Steven Spielberg. I bet that happens to you
a lot on the mailing list. ;) (either that, or I can't spell.)

Thanks for queuing this up Stephen.

Kevin

maintainer Applied
#11 lore raw
In reply to Markus Schneider-Pargmann

Quoting Markus Schneider-Pargmann (2023-05-11 06:32:26)

Quoted 7 lines

The given operations are inverted for the wrong registers which makes multiple of the mt8365 hardware units unusable. In my setup at least usb did not work.

Fixed by swapping the operations with the inverted ones.

Checkpatch complains now that there isn't a Closes: tag here.

Quoted 3 lines
Fixes 905b7430d3cc ("clk: mediatek: mt8365: Convert simple_gate to mtk_gate clocks")

---

Applied to clk-fixes

#12 lore raw

Hi Stephen,

Quoted 10 lines · Stephen Boyd

Quoting Markus Schneider-Pargmann (2023-05-11 06:32:26)

Quoted 7 lines

The given operations are inverted for the wrong registers which makes multiple of the mt8365 hardware units unusable. In my setup at least usb did not work.

Fixed by swapping the operations with the inverted ones.

Checkpatch complains now that there isn't a Closes: tag here.

Alexandre reported this internally, so there is nothing I could point to for a Closes tag.

Quoted 6 lines
Quoted 4 lines
Fixes 905b7430d3cc ("clk: mediatek: mt8365: Convert simple_gate to mtk_gate clocks")

---

Applied to clk-fixes

Thank you.

Best,
Markus