From: Bjorn Helgaas <helgaas@kernel.org>
To: Anand Moon <linux.amoon@gmail.com>
Cc: "Shawn Guo" <shawn.guo@linaro.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"open list:PCIE DRIVER FOR HISILICON STB"
<linux-pci@vger.kernel.org>,
"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 1/2] PCI: dwc: histb: Simplify clock handling by using clk_bulk*() functions
Date: Tue, 26 Aug 2025 14:02:55 -0500 [thread overview]
Message-ID: <20250826190255.GA851588@bhelgaas> (raw)
In-Reply-To: <CANAwSgTLS+fNTUrx4F5G_5BrFwoq9vixDAFervqokDgJxPhP2Q@mail.gmail.com>
On Tue, Aug 26, 2025 at 11:32:34PM +0530, Anand Moon wrote:
> Hi Bjorn,
>
> Thanks for your review comments.
> On Tue, 26 Aug 2025 at 21:55, Bjorn Helgaas <helgaas@kernel.org> wrote:
> >
> > In subject, remove "dwc: " to follow historical convention. (See
> > "git log --oneline")
> >
> Ok I will keep it as per the git history.
>
> > On Tue, Aug 26, 2025 at 05:12:40PM +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_all() 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
> >
> > I assume this means the order in which we prepare/enable and
> > disable/unprepare will now depend on the order the clocks appear in
> > the device tree instead of the order in the code? If so, please
> > mention that here and verify that all upstream device trees have the
> > correct order.
> >
> Following is the order in the device tree
>
> clocks = <&crg HISTB_PCIE_AUX_CLK>,
> <&crg HISTB_PCIE_PIPE_CLK>,
> <&crg HISTB_PCIE_SYS_CLK>,
> <&crg HISTB_PCIE_BUS_CLK>;
> clock-names = "aux", "pipe", "sys", "bus";
The current order in the code is:
histb_pcie_host_enable
clk_prepare_enable(hipcie->bus_clk);
clk_prepare_enable(hipcie->sys_clk);
clk_prepare_enable(hipcie->pipe_clk);
clk_prepare_enable(hipcie->aux_clk);
histb_pcie_host_disable
clk_disable_unprepare(hipcie->aux_clk);
clk_disable_unprepare(hipcie->pipe_clk);
clk_disable_unprepare(hipcie->sys_clk);
clk_disable_unprepare(hipcie->bus_clk);
After this patch, it looks like we'll have:
histb_pcie_host_enable
clk_bulk_prepare_enable
aux
pipe
sys
bus
histb_pcie_host_disable
clk_bulk_disable_unprepare
bus
sys
pipe
aux
So it looks like this patch will reverse the ordering both for
enabling and disabling, right? I'm totally fine with this as long as
it works.
Bjorn
next prev parent reply other threads:[~2025-08-26 19:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 11:42 [PATCH v1 0/2] HiSilicon STB PCIe host use bulk API for clock Anand Moon
2025-08-26 11:42 ` [PATCH v1 1/2] PCI: dwc: histb: Simplify clock handling by using clk_bulk*() functions Anand Moon
2025-08-26 16:25 ` Bjorn Helgaas
2025-08-26 18:02 ` Anand Moon
2025-08-26 19:02 ` Bjorn Helgaas [this message]
2025-08-27 9:59 ` Anand Moon
2025-08-26 11:42 ` [PATCH v1 2/2] PCI: dwc: histb: Simplify reset control handling by using reset_control_bulk*() function Anand Moon
2025-08-26 12:46 ` Philipp Zabel
2025-08-26 15:57 ` Anand Moon
2025-08-26 16:25 ` Bjorn Helgaas
2025-08-26 18:03 ` Anand Moon
2025-08-26 19:06 ` Bjorn Helgaas
2025-09-08 6:36 ` [PATCH v1 0/2] HiSilicon STB PCIe host use bulk API for clock Manivannan Sadhasivam
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=20250826190255.GA851588@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux.amoon@gmail.com \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=shawn.guo@linaro.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