Re: [PATCH v1 2/5] PCI: tegra: Simplify clock handling by using clk_bulk*() functions

From: Anand Moon

Date: Mon Sep 29 2025 - 12:12:53 EST


Hi Manivannan, Jon,

On Mon, 29 Sept 2025 at 19:31, Manivannan Sadhasivam <mani@xxxxxxxxxx> wrote:
>
> On Sat, Sep 27, 2025 at 11:20:10AM +0530, Anand Moon wrote:
> > Hi Frank,
> >
> > On Fri, 26 Sept 2025 at 23:42, Frank Li <Frank.li@xxxxxxx> wrote:
> > >
> > > On Fri, Sep 26, 2025 at 12:57:43PM +0530, Anand Moon wrote:
> > > > Currently, the driver acquires clocks and prepare/enable/disable/unprepare
> > > > the clocks individually thereby making the driver complex to read.
> > > >
> > > > The driver can be simplified by using the clk_bulk*() APIs.
> > > >
> > > > Use:
> > > > - devm_clk_bulk_get() API to acquire all the clocks
> > > > - clk_bulk_prepare_enable() to prepare/enable clocks
> > > > - clk_bulk_disable_unprepare() APIs to disable/unprepare them in bulk
> > > >
> > > > Following change also removes the legacy has_cml_clk flag and its associated
> > > > conditional logic. Instead, the driver now relies on the clock definitions from
> > > > the device tree to determine the correct clock sequencing.
> > > > This reduces hardcoded dependencies and improves the driver's maintainability.
> > > >
> > > > Cc: Thierry Reding <thierry.reding@xxxxxxxxx>
> > > > Cc: Jon Hunter <jonathanh@xxxxxxxxxx>
> > > > Signed-off-by: Anand Moon <linux.amoon@xxxxxxxxx>
> > > > ---
> > > > v1: Switch from devm_clk_bulk_get_all() -> devm_clk_bulk_get() with
> > > > fix clks array.
> > >
> > > why not use devm_clk_bulk_get_all()?
> > >
> > My RFC used this devm_clk_bulk_get_all() which could work for all the SoC,
> > However, Jon recommended switching to named clocks, following the
> > approach used in .
> > but Jon suggested to use clock names as per dwmac-tegra.c driver.
> >
>
> The concern was with validating the DTS files with binding. Since it was in .txt
> format, validation was not possible. But you are converting it to .yaml, so you
> can safely use devm_clk_bulk_get_all().
>
Yes I would also like to use the previous approach.

> - Mani
Thanks
-Anand
>
> --
> மணிவண்ணன் சதாசிவம்