Skip to contentSkip to conversation

Tegra: fix clock init

PATCH Superseded Svyatoslav Ryhel 2 participants 6 messages Dec 6, 2024

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 driver: clk: tegra: init basic clocks on probe

In case DM drivers probe earlier than board clock setup is done init of basic clocks should be done in CAR driver probe as well. Add it to avoid possible clock related problems.

---
 drivers/clk/tegra/tegra-car-clk.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/tegra/tegra-car-clk.c +3 -0
index 9078253d100..4f8405328a3 100644
@@ -111,6 +111,9 @@ static int tegra_car_clk_probe(struct udevice *dev)
 {
 	debug("%s(dev=%p)\n", __func__, dev);
 
+	clock_init();
+	clock_verify();
+
 	return 0;
 }
 
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v1 1/1] driver: clk: tegra: init basic clocks on probe

пт, 6 груд. 2024 р. о 08:01 Svyatoslav Ryhel <[email protected]> пише:

Quoted 25 lines

In case DM drivers probe earlier than board clock setup is done init of basic clocks should be done in CAR driver probe as well. Add it to avoid possible clock related problems.

---
 drivers/clk/tegra/tegra-car-clk.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/tegra/tegra-car-clk.c +3 -1
index 9078253d100..4f8405328a3 100644
@@ -111,6 +111,9 @@ static int tegra_car_clk_probe(struct udevice *dev)
 {
        debug("%s(dev=%p)\n", __func__, dev);
 
+       clock_init();
+       clock_verify();
+
        return 0;
 }
 
--
Quoted 2 lines

2.43.0

Simon, please test this commit and it it works for you, it can replace
this revert https://lore.kernel.org/all/20241201164810.GT3600562@bill-the-cat/T/#m2b62b471fd37e4c9725c98547e2a919cf11db5e5

#3 lore raw

Re: [PATCH v1 1/1] driver: clk: tegra: init basic clocks on probe

In reply to Svyatoslav Ryhel
Quoted 14 lines · Svyatoslav Ryhel

In case DM drivers probe earlier than board clock setup is done init of basic clocks should be done in CAR driver probe as well. Add it to avoid possible clock related problems.

---
 drivers/clk/tegra/tegra-car-clk.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/tegra/tegra-car-clk.c +0 -0
index 9078253d100..4f8405328a3 100644

drivers/clk/tegra/tegra-car-clk.c static int tegra_car_clk_probe(struct udevice *dev) · line 119

Quoted 9 lines
drivers/clk/tegra/tegra-car-clk.c +3 -0
@@ -111,6 +111,9 @@ static int tegra_car_clk_probe(struct udevice *dev)
 {
 	debug("%s(dev=%p)\n", __func__, dev);
 
+	clock_init();
+	clock_verify();
+
 	return 0;
 }
 

Is this called before arch/arm/mach-tegra/board2.c::board_init()? Thanks.

Signature · 1 line
Tom
#4 lore raw

Re: [PATCH v1 1/1] driver: clk: tegra: init basic clocks on probe

пт, 6 груд. 2024 р. о 16:20 Tom Rini <[email protected]> пише:

Quoted 30 lines · Svyatoslav Ryhel
Quoted 15 lines

In case DM drivers probe earlier than board clock setup is done init of basic clocks should be done in CAR driver probe as well. Add it to avoid possible clock related problems.

---
 drivers/clk/tegra/tegra-car-clk.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/tegra/tegra-car-clk.c +0 -0
index 9078253d100..4f8405328a3 100644

drivers/clk/tegra/tegra-car-clk.c static int tegra_car_clk_probe(struct udevice *dev) · line 119

Quoted 9 lines
drivers/clk/tegra/tegra-car-clk.c +3 -0
@@ -111,6 +111,9 @@ static int tegra_car_clk_probe(struct udevice *dev)
 {
      debug("%s(dev=%p)\n", __func__, dev);
 
+     clock_init();
+     clock_verify();
+
      return 0;
 }
 

Is this called before arch/arm/mach-tegra/board2.c::board_init()? Thanks.

Quoted 2 lines

--
Tom

It does if the device uses pmic with dm driver and has any of pmic regulators set as always-on or boot-on

#5 lore raw

Re: [PATCH v1 1/1] driver: clk: tegra: init basic clocks on probe

Quoted 31 lines · Svyatoslav Ryhel

пт, 6 груд. 2024 р. о 16:20 Tom Rini <[email protected]> пише:

Quoted 20 lines · Svyatoslav Ryhel
Quoted 18 lines

In case DM drivers probe earlier than board clock setup is done init of basic clocks should be done in CAR driver probe as well. Add it to avoid possible clock related problems.

---
 drivers/clk/tegra/tegra-car-clk.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/tegra/tegra-car-clk.c +0 -0
index 9078253d100..4f8405328a3 100644
@@ -111,6 +111,9 @@ static int tegra_car_clk_probe(struct udevice *dev)
 {
      debug("%s(dev=%p)\n", __func__, dev);
 
Quoted 9 lines

drivers/clk/tegra/tegra-car-clk.c static int tegra_car_clk_probe(struct udevice *dev) · line 119

Quoted 6 lines
drivers/clk/tegra/tegra-car-clk.c +3 -0
+     clock_init();
+     clock_verify();
+
      return 0;
 }
 

Is this called before arch/arm/mach-tegra/board2.c::board_init()? Thanks.

Quoted 2 lines

It does if the device uses pmic with dm driver and has any of pmic regulators set as always-on or boot-on

Ah, OK. I'll wait and see what Simon has to say next, thanks.

Signature · 1 line
Tom