Skip to contentSkip to conversation

ARM: qcom: Disable i2c device on gsbi4 for ipq806x

PATCH In review Ansuel Smith 2 participants 5 messages Mar 30, 2020 – Apr 15, 2020

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

PATCH v2 1/1 ARM: qcom: Disable i2c device on gsbi4 for ipq806x

Disable the i2c device on gsbi4, mark gsbi4_h as unused and gsbi4_qup and src clks as protected. gsbi4_h can't be set to protected as it's used by both gsbi and rpm and making it protected creates some problem with gsbi4 uart function.
Without this fix, clock framework will turn them off at end of probe. On ipq806x by design gsbi4_qup, gsbi4_h clks and i2c on gsbi4 are meant for RPM usage. So turning them off in kernel is incorrect.

---
 arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 9 ---------
 arch/arm/boot/dts/qcom-ipq8064.dtsi      | 3 +++
 drivers/clk/qcom/gcc-ipq806x.c           | 1 +
 3 files changed, 4 insertions(+), 9 deletions(-)
arch/arm/boot/dts/qcom-ipq8064-ap148.dts +0 -9
index 554c65e7aa0e..580aec63030d 100644
@@ -21,14 +21,5 @@ mux {
 				};
 			};
 		};
-
-		gsbi@16300000 {
-			i2c@16380000 {
-				status = "ok";
-				clock-frequency = <200000>;
-				pinctrl-0 = <&i2c4_pins>;
-				pinctrl-names = "default";
-			};
-		};
 	};
 };
arch/arm/boot/dts/qcom-ipq8064.dtsi +3 -0
index 16c0da97932c..d9a803c8a59b 100644
@@ -421,6 +421,9 @@ qcom,ssbi@500000 {
 		gcc: clock-controller@900000 {
 			compatible = "qcom,gcc-ipq8064";
 			reg = <0x00900000 0x4000>;
+
+			protected-clocks = <GSBI4_QUP_SRC>, <GSBI4_QUP_CLK>;
+
 			#clock-cells = <1>;
 			#reset-cells = <1>;
 		};
drivers/clk/qcom/gcc-ipq806x.c +1 -0
index b0eee0903807..f7d7a2bc84c1 100644
@@ -991,6 +991,7 @@ static struct clk_branch gsbi4_h_clk = {
 		.hw.init = &(struct clk_init_data){
 			.name = "gsbi4_h_clk",
 			.ops = &clk_branch_ops,
+			.flags = CLK_IGNORE_UNUSED,
 		},
 	},
 };
Signature · 1 line
2.25.1
maintainer
#1 lore raw

Quoting Ansuel Smith (2020-03-30 13:56:46)

drivers/clk/qcom/gcc-ipq806x.c static struct clk_branch gsbi4_h_clk = { · line 994

Quoted 9 lines
drivers/clk/qcom/gcc-ipq806x.c +1 -0
index b0eee0903807..f7d7a2bc84c1 100644
@@ -991,6 +991,7 @@ static struct clk_branch gsbi4_h_clk = {
                .hw.init = &(struct clk_init_data){
                        .name = "gsbi4_h_clk",
                        .ops = &clk_branch_ops,
+                       .flags = CLK_IGNORE_UNUSED,

Is this necessary? Shouldn't we skip clks that are protected during the unused phase?

Quoted 6 lines
drivers/clk/qcom/gcc-ipq806x.c +0 -0
                },
        },
 };
Signature · 1 line
2.25.1
#2 lore raw

R: [PATCH v2] ARM: qcom: Disable i2c device on gsbi4 for ipq806x

Quoted 20 lines

-----Messaggio originale-----
Da: Stephen Boyd <[email protected]>
Inviato: venerdì 3 aprile 2020 03:34
A: Andy Gross <[email protected]>; Ansuel Smith <[email protected]>
Cc: Ansuel Smith <[email protected]>; Mathieu Olivari <[email protected]>; Bjorn Andersson <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Michael Turquette <[email protected]>; [email protected]; [email protected]; [email protected]; linux- [email protected]
Oggetto: Re: [PATCH v2] ARM: qcom: Disable i2c device on gsbi4 for ipq806x

Quoting Ansuel Smith (2020-03-30 13:56:46)

drivers/clk/qcom/gcc-

Quoted 1 line
drivers/clk/qcom/gcc- renamed from drivers/clk/qcom/gcc-ipq806x.c +0 -0

ipq806x.c

Quoted 12 lines

drivers/clk/qcom/gcc-ipq806x.c static struct clk_branch gsbi4_h_clk = { · line 994

Quoted 8 lines

index b0eee0903807..f7d7a2bc84c1 100644

drivers/clk/qcom/gcc-ipq806x.c +1 -0
@@ -991,6 +991,7 @@ static struct clk_branch gsbi4_h_clk = {
                .hw.init = &(struct clk_init_data){
                        .name = "gsbi4_h_clk",
                        .ops = &clk_branch_ops,
+                       .flags = CLK_IGNORE_UNUSED,

Is this necessary? Shouldn't we skip clks that are protected during the unused phase?

gsbi4_h_clk is not protected. gsbi4_h_clk needs to not be disabled if unused (as it's used by rpm) but can't be protected since it's used by uart gsbi4. (With some test protecting also this clk cause the malfunction of uart gsb4)

Quoted 6 lines
Quoted 6 lines
drivers/clk/qcom/gcc-ipq806x.c +0 -1
                },
        },
 };
--

2.25.1

maintainer
#3 lore raw

Re: R: [PATCH v2] ARM: qcom: Disable i2c device on gsbi4 for ipq806x

Quoting [email protected] (2020-04-02 18:39:04)

Quoted 33 lines
Quoted 20 lines

-----Messaggio originale-----
Da: Stephen Boyd <[email protected]>
Inviato: venerdì 3 aprile 2020 03:34
A: Andy Gross <[email protected]>; Ansuel Smith <[email protected]>
Cc: Ansuel Smith <[email protected]>; Mathieu Olivari <[email protected]>; Bjorn Andersson <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Michael Turquette <[email protected]>; [email protected]; [email protected]; [email protected]; linux- [email protected]
Oggetto: Re: [PATCH v2] ARM: qcom: Disable i2c device on gsbi4 for ipq806x

Quoting Ansuel Smith (2020-03-30 13:56:46)

drivers/clk/qcom/gcc-

Quoted 1 line
drivers/clk/qcom/gcc- renamed from drivers/clk/qcom/gcc-ipq806x.c +0 -0

ipq806x.c

Quoted 12 lines

drivers/clk/qcom/gcc-ipq806x.c static struct clk_branch gsbi4_h_clk = { · line 994

Quoted 8 lines

index b0eee0903807..f7d7a2bc84c1 100644

drivers/clk/qcom/gcc-ipq806x.c +1 -0
@@ -991,6 +991,7 @@ static struct clk_branch gsbi4_h_clk = {
                .hw.init = &(struct clk_init_data){
                        .name = "gsbi4_h_clk",
                        .ops = &clk_branch_ops,
+                       .flags = CLK_IGNORE_UNUSED,

Is this necessary? Shouldn't we skip clks that are protected during the unused phase?

Quoted 4 lines

gsbi4_h_clk is not protected. gsbi4_h_clk needs to not be disabled if unused (as it's used by rpm) but can't be protected since it's used by uart gsbi4. (With some test protecting also this clk cause the malfunction of uart gsb4)

Who owns gsbi4 on this platform? Is it RPM? If so, it should be protected and we shouldn't touch this clk from the kernel.

#4 lore raw

R: R: [PATCH v2] ARM: qcom: Disable i2c device on gsbi4 for ipq806x

Quoted 51 lines

-----Messaggio originale-----
Da: Stephen Boyd <[email protected]>
Inviato: domenica 5 aprile 2020 05:11
A: 'Andy Gross' <[email protected]>; [email protected]
Cc: 'Mathieu Olivari' <[email protected]>; 'Bjorn Andersson' <[email protected]>; 'Rob Herring' <[email protected]>; 'Mark Rutland' <[email protected]>; 'Michael Turquette' <[email protected]>; [email protected]; [email protected]; [email protected]; linux- [email protected]
Oggetto: Re: R: [PATCH v2] ARM: qcom: Disable i2c device on gsbi4 for ipq806x

Quoting [email protected] (2020-04-02 18:39:04)

Quoted 10 lines
Quoted 10 lines

-----Messaggio originale-----
Da: Stephen Boyd <[email protected]>
Inviato: venerdì 3 aprile 2020 03:34
A: Andy Gross <[email protected]>; Ansuel Smith <[email protected]>
Cc: Ansuel Smith <[email protected]>; Mathieu Olivari <[email protected]>; Bjorn Andersson <[email protected]>; Rob Herring <[email protected]>;

Mark

Quoted 23 lines
Quoted 10 lines

Rutland <[email protected]>; Michael Turquette <[email protected]>; [email protected]; [email protected]; [email protected]; linux- [email protected]
Oggetto: Re: [PATCH v2] ARM: qcom: Disable i2c device on gsbi4 for ipq806x

Quoting Ansuel Smith (2020-03-30 13:56:46)

drivers/clk/qcom/gcc-

Quoted 1 line
drivers/clk/qcom/gcc- renamed from drivers/clk/qcom/gcc-ipq806x.c +0 -0

ipq806x.c

Quoted 12 lines

drivers/clk/qcom/gcc-ipq806x.c static struct clk_branch gsbi4_h_clk = { · line 994

Quoted 8 lines

index b0eee0903807..f7d7a2bc84c1 100644

drivers/clk/qcom/gcc-ipq806x.c +1 -0
@@ -991,6 +991,7 @@ static struct clk_branch gsbi4_h_clk = {
                .hw.init = &(struct clk_init_data){
                        .name = "gsbi4_h_clk",
                        .ops = &clk_branch_ops,
+                       .flags = CLK_IGNORE_UNUSED,

Is this necessary? Shouldn't we skip clks that are protected during the unused phase?

Quoted 1 line

gsbi4_h_clk is not protected. gsbi4_h_clk needs to not be disabled if

Quoted 8 lines

unused

Quoted 2 lines

(as it's used by rpm) but can't be protected since it's used by uart gsbi4. (With some test protecting also this clk cause the malfunction of uart

gsb4)

Quoted 1 line

Who owns gsbi4 on this platform? Is it RPM? If so, it should be protected and we shouldn't touch this clk from the kernel.

Sorry for the late replay. Trying to protect gsbi4 clk cause the uart serial to not work at all as it can't be used by the driver. If for some reason some dev decide to not use gsbi4 uart, GSBI4_CLK gets disabled (as it would be not used), this is the reason of the IGNORE_UNUSED. I really can't find another way to keep both gsbi4 protected and and permit gsbi4 uart to use it.