mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>,
	 Prashant Gaikwad <pgaikwad@nvidia.com>,
	Stephen Boyd <sboyd@kernel.org>,
	 Brian Masney <bmasney+clk@redhat.com>,
	 Jerome Brunet <jbrunet+clk@baylibre.com>,
	 Thierry Reding <thierry.reding@kernel.org>,
	 Jonathan Hunter <jonathanh@nvidia.com>,
	Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	 linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org,
	 linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v1 2/2] clk: tegra114: Add CSI pad clock gates
Date: Mon, 16 Nov 2026 11:07:16 +0100	[thread overview]
Message-ID: <179482363653.13037.14387881069650442772.b4-reply@b4> (raw)
In-Reply-To: <CAPVz0n21-_+G3cEVg98MwcYqhcaGi9nBa42YebNWiqUdo+vqjg@mail.gmail.com>

On 2026-11-16 10:43 +0200, Svyatoslav Ryhel wrote:
> пн, 16 лист. 2026 р. о 00:44 Jerome Brunet <jbrunet@baylibre.com> пише:
> >
> > On 2026-11-15 13:54 +0200, Svyatoslav Ryhel wrote:
> > > нд, 15 лист. 2026 р. о 13:03 Jerome Brunet <jbrunet@baylibre.com> пише:
> > > >
> > > > > Tegra114 has CSI pad bits in both PLLD and PLLD2 clocks that are required
> > > > > for the correct work of the CSI block. Add CSI pad A and pad B clock gates
> > > > > with PLLD/PLLD2 parents, respectively.
> > > > >
> > > > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > > > > ---
> > > > >  drivers/clk/tegra/clk-tegra114.c | 10 ++++++++++
> > > > >  1 file changed, 10 insertions(+)
> > > > >
> > > > > diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
> > > > > index ec537efac692..08e425365469 100644
> > > > > --- a/drivers/clk/tegra/clk-tegra114.c
> > > > > +++ b/drivers/clk/tegra/clk-tegra114.c
> > > > > @@ -1041,6 +1041,16 @@ static __init void tegra114_periph_clk_init(void __iomem *clk_base,
> > > > >                                            0, 82, periph_clk_enb_refcnt);
> > > > >       clks[TEGRA114_CLK_DSIB] = clk;
> > > > >
> > > > > +     /* csia_pad */
> > > > > +     clk = clk_register_gate(NULL, "csia_pad", "pll_d", CLK_SET_RATE_PARENT,
> > > > > +                             clk_base + PLLD_BASE, 26, 0, &pll_d_lock);
> > > > > +     clks[TEGRA114_CLK_CSIA_PAD] = clk;
> > > > > +
> > > > > +     /* csib_pad */
> > > > > +     clk = clk_register_gate(NULL, "csib_pad", "pll_d2", CLK_SET_RATE_PARENT,
> > > > > +                             clk_base + PLLD2_BASE, 26, 0, &pll_d2_lock);
> > > > > +     clks[TEGRA114_CLK_CSIB_PAD] = clk;
> > > > > +
> > > >
> > > > Change seems ok in itself, just a couple of things I'd like to check with you.
> > > >
> > > > Seems both the CSI and DSI can use the PLL D and D2. Can they be used concurrently ?
> > > > If yes, are you sure you want to add CLK_SET_RATE_PARENT which the
> > > > DSI counter part does not have ?
> > > >
> > >
> > > CSI pad clocks are used only by CSI and CSI does not change rate of
> > > pad clocks. Saying "DSI counter part" would not be correct, DSI mux
> > > switched DSI clock parent while csi pad clocks do not touch clock
> > > layout of CSI nor DSI.
> >
> > Ok but they end up possibly using the same PLL from what I can see here.
> >
> > So if the consumer of csiX_pad calls clk_set_rate() on it, while the DSI
> > is using it, it won't go well. The rate of the underlying PLL may change
> > since you have set CLK_SET_RATE_PARENT. Taken alone, there is no problem
> > with this but can't CSI and DSI be active at the same time ?
> >
> 
> The clk_set_rate() call for csi pad and csi cil clocks for dynamic
> adjustments is not possible. These clocks are used only by CSI block
> and among 6 clocks CSI uses it can change clock rate only for its own
> clock (TEGRA114_CLK_CSI) PAD and CIL clocks must remain fixed  by CSI
> design and are not touched by any other driver.

This is not my point, and you are not really answering my question AFAICT.

Right now you have 2 CSIs clock each linked to a PLL, with CLK_SET_RATE_PARENT.
So a call to clk_set_rate() may change the PLL rate.

At the same time, I'm seeing 2 DSI clocks linked to the same PLL, without
CLK_SET_RATE_PARENT, so those clock will use the PLL as it is.

The difference in the model used is odd. If it needs to stay that way, it requires
an explanation. If adjustements "are not possible", then why set CLK_SET_RATE_PARENT ?

If the PLL is fixed by design, then you should not set CLK_SET_RATE_PARENT here,
and possibly use assigned-rate to setup the PLL, as designed.

-- 
Jerome


  reply	other threads:[~2026-11-16 10:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 14:57 [PATCH v1 0/2] " Svyatoslav Ryhel
2026-11-13 14:57 ` [PATCH v1 1/2] dt-bindings: clock: tegra114: Add IDs for CSI pad clocks Svyatoslav Ryhel
2026-11-13 16:49   ` Conor Dooley
2026-11-13 14:57 ` [PATCH v1 2/2] clk: tegra114: Add CSI pad clock gates Svyatoslav Ryhel
2026-11-15 11:03   ` Jerome Brunet
2026-11-15 11:54     ` Svyatoslav Ryhel
2026-11-15 22:44       ` Jerome Brunet
2026-11-16  8:43         ` Svyatoslav Ryhel
2026-11-16 10:07           ` Jerome Brunet [this message]
2026-11-16 10:23             ` Svyatoslav Ryhel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179482363653.13037.14387881069650442772.b4-reply@b4 \
    --to=jbrunet@baylibre.com \
    --cc=bmasney+clk@redhat.com \
    --cc=clamor95@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=pgaikwad@nvidia.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=thierry.reding@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®