Re: [PATCH v3 06/11] clk: tegra: remove EMC to MC clock mux in Tegra114

Svyatoslav Ryhel
2025-11-25T10:21:44Z

нд, 21 вер. 2025 р. о 20:54 Stephen Boyd <sboyd@kernel.org> пише:
>
> Quoting Svyatoslav Ryhel (2025-09-15 01:01:52)
> > diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
> > index 8bde72aa5e68..6b3a140772c2 100644
> > --- a/drivers/clk/tegra/clk-tegra114.c
> > +++ b/drivers/clk/tegra/clk-tegra114.c
> > @@ -1321,6 +1309,28 @@ static int tegra114_reset_deassert(unsigned long id)
> > return 0;
> > }
> >
> > +#ifdef CONFIG_TEGRA124_CLK_EMC
> > +static struct clk *tegra114_clk_src_onecell_get(struct of_phandle_args *clkspec,
> > + void *data)
> > +{
> > + struct clk_hw *hw;
> > + struct clk *clk;
> > +
> > + clk = of_clk_src_onecell_get(clkspec, data);
> > + if (IS_ERR(clk))
> > + return clk;
> > +
> > + hw = __clk_get_hw(clk);
>
> Can you just use of_clk_hw_onecell_get() instead? Then we don't need to
> use __clk_get_hw(). Or is this whole function used to return a clk
> pointer to something that isn't the clk framework?
>

I have tried to switch __clk_get_hw to of_clk_hw_onecell_get but it
did not work, tegra124_clk_emc_driver_available fails and I get
EPROBE_DEFER cascade. I will keep __clk_get_hw like Tegra124 driver
does since of_clk_hw_onecell_get did not worked in this case.

> > +
> > + if (clkspec->args[0] == TEGRA114_CLK_EMC) {
> > + if (!tegra124_clk_emc_driver_available(hw))
> > + return ERR_PTR(-EPROBE_DEFER);
> > + }
> > +
> > + return clk;