The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] clk: tegra: Fix Tegra114 MIPI calibration clock parent
@ 2026-09-30  5:18 Mikko Perttunen
  2026-10-02 15:40 ` Brian Masney
  2026-10-25 17:57 ` Patrick Fischer
  0 siblings, 2 replies; 5+ messages in thread
From: Mikko Perttunen @ 2026-09-30  5:18 UTC (permalink / raw)
  To: Stephen Boyd, Brian Masney, Jerome Brunet, Thierry Reding,
	Jonathan Hunter
  Cc: linux-clk, linux-tegra, linux-kernel, Mikko Perttunen

CLK_MIPI_CAL on Tegra114 is a plain clock gate with no source mux; the
fixed parent is PLL_P_OUT3, which is specified to run at 72 MHz. The
clock driver currently registers the gate with clk_m as its parent, so
the clock framework never enables PLL_P_OUT3 when MIPI_CAL is enabled,
and reports the wrong rate for it.

Register the gate with pll_p_out3 as its parent. Also drop
CLK_SET_RATE_PARENT at the same time: the parent canonically runs at
72 MHz so we shouldn't change the rate.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
---
 drivers/clk/tegra/clk-tegra114.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
index f1bca81b7776..97f5500b13b5 100644
--- a/drivers/clk/tegra/clk-tegra114.c
+++ b/drivers/clk/tegra/clk-tegra114.c
@@ -1050,8 +1050,8 @@ static __init void tegra114_periph_clk_init(void __iomem *clk_base,
 				    &emc_lock);
 	clks[TEGRA114_CLK_MC] = clk;
 
-	clk = tegra_clk_register_periph_gate("mipi-cal", "clk_m", 0, clk_base,
-					     CLK_SET_RATE_PARENT, 56,
+	clk = tegra_clk_register_periph_gate("mipi-cal", "pll_p_out3", 0,
+					     clk_base, 0, 56,
 					     periph_clk_enb_refcnt);
 	clks[TEGRA114_CLK_MIPI_CAL] = clk;
 

---
base-commit: 72d3fcf802c45d00b300f25b848a93c3a2bd7c7e
change-id: 20260930-b4-dalmore-fixes-mipical-clk-eb375008dd66


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

* Re: [PATCH] clk: tegra: Fix Tegra114 MIPI calibration clock parent
  2026-09-30  5:18 [PATCH] clk: tegra: Fix Tegra114 MIPI calibration clock parent Mikko Perttunen
@ 2026-10-02 15:40 ` Brian Masney
  2026-10-03  3:22   ` Mikko Perttunen
  2026-10-25 17:57 ` Patrick Fischer
  1 sibling, 1 reply; 5+ messages in thread
From: Brian Masney @ 2026-10-02 15:40 UTC (permalink / raw)
  To: Mikko Perttunen
  Cc: Stephen Boyd, Brian Masney, Jerome Brunet, Thierry Reding,
	Jonathan Hunter, linux-clk, linux-tegra, linux-kernel

Hi Mikko,

On Wed, Sep 30, 2026 at 02:18:34PM +0900, Mikko Perttunen wrote:
> CLK_MIPI_CAL on Tegra114 is a plain clock gate with no source mux; the
> fixed parent is PLL_P_OUT3, which is specified to run at 72 MHz. The
> clock driver currently registers the gate with clk_m as its parent, so
> the clock framework never enables PLL_P_OUT3 when MIPI_CAL is enabled,
> and reports the wrong rate for it.
> 
> Register the gate with pll_p_out3 as its parent. Also drop
> CLK_SET_RATE_PARENT at the same time: the parent canonically runs at
> 72 MHz so we shouldn't change the rate.
> 
> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>

Should there be a Fixes tag? I see that Thierry made a change to this
same clock 11 years ago:

commit 07314fc108e195044c074f4b443974b5aaa2d5d7
Author: Thierry Reding <treding@nvidia.com>
Date:   Wed Apr 8 16:48:26 2015 +0200

    clk: tegra: Special-case mipi-cal parent on Tegra114
    
    Starting with Tegra124, the mipi-cal clock uses the 72 MHz clock as its
    source. On Tegra114 this clock's parent was clk_m, so it is the one-off
    chip.

Brian


> ---
>  drivers/clk/tegra/clk-tegra114.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
> index f1bca81b7776..97f5500b13b5 100644
> --- a/drivers/clk/tegra/clk-tegra114.c
> +++ b/drivers/clk/tegra/clk-tegra114.c
> @@ -1050,8 +1050,8 @@ static __init void tegra114_periph_clk_init(void __iomem *clk_base,
>  				    &emc_lock);
>  	clks[TEGRA114_CLK_MC] = clk;
>  
> -	clk = tegra_clk_register_periph_gate("mipi-cal", "clk_m", 0, clk_base,
> -					     CLK_SET_RATE_PARENT, 56,
> +	clk = tegra_clk_register_periph_gate("mipi-cal", "pll_p_out3", 0,
> +					     clk_base, 0, 56,
>  					     periph_clk_enb_refcnt);
>  	clks[TEGRA114_CLK_MIPI_CAL] = clk;
>  
> 
> ---
> base-commit: 72d3fcf802c45d00b300f25b848a93c3a2bd7c7e
> change-id: 20260930-b4-dalmore-fixes-mipical-clk-eb375008dd66
> 


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

* Re: [PATCH] clk: tegra: Fix Tegra114 MIPI calibration clock parent
  2026-10-02 15:40 ` Brian Masney
@ 2026-10-03  3:22   ` Mikko Perttunen
  0 siblings, 0 replies; 5+ messages in thread
From: Mikko Perttunen @ 2026-10-03  3:22 UTC (permalink / raw)
  To: Brian Masney
  Cc: Stephen Boyd, Brian Masney, Jerome Brunet, Thierry Reding,
	Jonathan Hunter, linux-clk, linux-tegra, linux-kernel

On Saturday, October 3, 2026 12:40 AM Brian Masney wrote:
> Hi Mikko,
> 
> On Wed, Sep 30, 2026 at 02:18:34PM +0900, Mikko Perttunen wrote:
> > CLK_MIPI_CAL on Tegra114 is a plain clock gate with no source mux; the
> > fixed parent is PLL_P_OUT3, which is specified to run at 72 MHz. The
> > clock driver currently registers the gate with clk_m as its parent, so
> > the clock framework never enables PLL_P_OUT3 when MIPI_CAL is enabled,
> > and reports the wrong rate for it.
> > 
> > Register the gate with pll_p_out3 as its parent. Also drop
> > CLK_SET_RATE_PARENT at the same time: the parent canonically runs at
> > 72 MHz so we shouldn't change the rate.
> > 
> > Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
> 
> Should there be a Fixes tag? I see that Thierry made a change to this
> same clock 11 years ago:
> 
> commit 07314fc108e195044c074f4b443974b5aaa2d5d7
> Author: Thierry Reding <treding@nvidia.com>
> Date:   Wed Apr 8 16:48:26 2015 +0200
> 
>     clk: tegra: Special-case mipi-cal parent on Tegra114
>     
>     Starting with Tegra124, the mipi-cal clock uses the 72 MHz clock as its
>     source. On Tegra114 this clock's parent was clk_m, so it is the one-off
>     chip.
> 
> Brian

True, technically this is a fix for that patch. I don't think this patch 
warrants any backporting, though, that the tag may trigger. If you'd 
prefer I can add the below (or if easier, you can add when applying):

Fixes: 07314fc108e1 ("clk: tegra: Special-case mipi-cal parent on Tegra114")

Thanks
Mikko

> 
> 
> > ---
> >  drivers/clk/tegra/clk-tegra114.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
> > index f1bca81b7776..97f5500b13b5 100644
> > --- a/drivers/clk/tegra/clk-tegra114.c
> > +++ b/drivers/clk/tegra/clk-tegra114.c
> > @@ -1050,8 +1050,8 @@ static __init void tegra114_periph_clk_init(void __iomem *clk_base,
> >  				    &emc_lock);
> >  	clks[TEGRA114_CLK_MC] = clk;
> >  
> > -	clk = tegra_clk_register_periph_gate("mipi-cal", "clk_m", 0, clk_base,
> > -					     CLK_SET_RATE_PARENT, 56,
> > +	clk = tegra_clk_register_periph_gate("mipi-cal", "pll_p_out3", 0,
> > +					     clk_base, 0, 56,
> >  					     periph_clk_enb_refcnt);
> >  	clks[TEGRA114_CLK_MIPI_CAL] = clk;
> >  
> > 
> > ---
> > base-commit: 72d3fcf802c45d00b300f25b848a93c3a2bd7c7e
> > change-id: 20260930-b4-dalmore-fixes-mipical-clk-eb375008dd66
> > 
> 
> 





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

* Re: [PATCH] clk: tegra: Fix Tegra114 MIPI calibration clock parent
  2026-09-30  5:18 [PATCH] clk: tegra: Fix Tegra114 MIPI calibration clock parent Mikko Perttunen
  2026-10-02 15:40 ` Brian Masney
@ 2026-10-25 17:57 ` Patrick Fischer
  2026-10-25 19:21   ` Svyatoslav Ryhel
  1 sibling, 1 reply; 5+ messages in thread
From: Patrick Fischer @ 2026-10-25 17:57 UTC (permalink / raw)
  To: Mikko Perttunen, Stephen Boyd, Brian Masney, Jerome Brunet,
	Thierry Reding, Jonathan Hunter
  Cc: linux-clk, linux-tegra, linux-kernel, clamor95

On Wed, Sep 30, 2026 at 02:18:34PM +0900, Mikko Perttunen wrote:
> Register the gate with pll_p_out3 as its parent. Also drop
> CLK_SET_RATE_PARENT at the same time: the parent canonically runs at
> 72 MHz so we shouldn't change the rate.

I ran into the same problem on a Tegra Note 7 (P1640) and ended up with
the identical change. Before it, every DSI enable logged

  tegra-dsi 54300000.dsi: MIPI calibration failed: -110

and enabling PLL_P_OUT3 by hand made it go away. With this patch there
is no timeout at boot or across DPMS off/on cycles.

Tested-by: Patrick Fischer <admin@tsv-stahl-riesa.de> # Tegra Note 7 (P1640)

While testing I also found that tegra114_mipi_power_down() never drops
the clock enable it takes, so with this patch PLL_P_OUT3 stays on after
the first DPMS off. I sent a fix for that:

https://lore.kernel.org/all/20261025-upstream-host1x-mipi-clk-v1-1-6bc6e755b4cb@tsv-stahl-riesa.de/

Thanks,
Patrick

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

* Re: [PATCH] clk: tegra: Fix Tegra114 MIPI calibration clock parent
  2026-10-25 17:57 ` Patrick Fischer
@ 2026-10-25 19:21   ` Svyatoslav Ryhel
  0 siblings, 0 replies; 5+ messages in thread
From: Svyatoslav Ryhel @ 2026-10-25 19:21 UTC (permalink / raw)
  To: Mikko Perttunen, Stephen Boyd, Brian Masney, Jerome Brunet
  Cc: Patrick Fischer, Thierry Reding, Jonathan Hunter, linux-clk,
	linux-tegra, linux-kernel

нд, 25 жовт. 2026 р. о 19:57 Patrick Fischer <admin@tsv-stahl-riesa.de> пише:
>
> On Wed, Sep 30, 2026 at 02:18:34PM +0900, Mikko Perttunen wrote:
> > Register the gate with pll_p_out3 as its parent. Also drop
> > CLK_SET_RATE_PARENT at the same time: the parent canonically runs at
> > 72 MHz so we shouldn't change the rate.
>
> I ran into the same problem on a Tegra Note 7 (P1640) and ended up with
> the identical change. Before it, every DSI enable logged
>
>   tegra-dsi 54300000.dsi: MIPI calibration failed: -110
>
> and enabling PLL_P_OUT3 by hand made it go away. With this patch there
> is no timeout at boot or across DPMS off/on cycles.
>
> Tested-by: Patrick Fischer <admin@tsv-stahl-riesa.de> # Tegra Note 7 (P1640)
>
> While testing I also found that tegra114_mipi_power_down() never drops
> the clock enable it takes, so with this patch PLL_P_OUT3 stays on after
> the first DPMS off. I sent a fix for that:
>
> https://lore.kernel.org/all/20261025-upstream-host1x-mipi-clk-v1-1-6bc6e755b4cb@tsv-stahl-riesa.de/
>
> Thanks,
> Patrick

Thank you for cc-ing me Patrick.

Hello Mikko!
I have observed calibration fail on my Tegra114 devices and your patch
fixes it. Thank you!

Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # Tegratab (P1988)
and ASUS TF701T

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

end of thread, other threads:[~2026-10-25 19:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-30  5:18 [PATCH] clk: tegra: Fix Tegra114 MIPI calibration clock parent Mikko Perttunen
2026-10-02 15:40 ` Brian Masney
2026-10-03  3:22   ` Mikko Perttunen
2026-10-25 17:57 ` Patrick Fischer
2026-10-25 19:21   ` Svyatoslav Ryhel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox