mbox series

[v1,0/5] PCI: qcom: rework pipe_clk/pipe_clk_src handling

Message ID 20220323085010.1753493-1-dmitry.baryshkov@linaro.org (mailing list archive)
Headers show
Series PCI: qcom: rework pipe_clk/pipe_clk_src handling | expand

Message

Dmitry Baryshkov March 23, 2022, 8:50 a.m. UTC
PCIe pipe clk (and some other clocks) must be parked to the "safe"
source (bi_tcxo) when corresponding GDSC is turned off and on again.
Currently this is handcoded in the PCIe driver by reparenting the
gcc_pipe_N_clk_src clock.

Instead of doing it manually, follow the approach used by
clk_rcg2_shared_ops and implement this parking in the enable() and
disable() clock operations for respective pipe clocks.

Changes since RFC:
 - Rework clk-regmap-mux fields. Specify safe parent as P_* value rather
   than specifying the register value directly
 - Expand commit message to the first patch to specially mention that
   it is required only on newer generations of Qualcomm chipsets.

Dmitry Baryshkov (5):
  clk: qcom: regmap-mux: add pipe clk implementation
  clk: qcom: gcc-sm8450: use new clk_regmap_mux_safe_ops for PCIe pipe
    clocks
  clk: qcom: gcc-sc7280: use new clk_regmap_mux_safe_ops for PCIe pipe
    clocks
  PCI: qcom: Remove unnecessary pipe_clk handling
  PCI: qcom: Drop manual pipe_clk_src handling

 drivers/clk/qcom/clk-regmap-mux.c      | 78 +++++++++++++++++++++++
 drivers/clk/qcom/clk-regmap-mux.h      |  3 +
 drivers/clk/qcom/gcc-sc7280.c          |  6 +-
 drivers/clk/qcom/gcc-sm8450.c          |  6 +-
 drivers/pci/controller/dwc/pcie-qcom.c | 87 +-------------------------
 5 files changed, 92 insertions(+), 88 deletions(-)

Comments

Dmitry Baryshkov March 30, 2022, 12:56 p.m. UTC | #1
On 23/03/2022 11:50, Dmitry Baryshkov wrote:
> PCIe pipe clk (and some other clocks) must be parked to the "safe"
> source (bi_tcxo) when corresponding GDSC is turned off and on again.
> Currently this is handcoded in the PCIe driver by reparenting the
> gcc_pipe_N_clk_src clock.
> 
> Instead of doing it manually, follow the approach used by
> clk_rcg2_shared_ops and implement this parking in the enable() and
> disable() clock operations for respective pipe clocks.

Prasad, can we please get your comments on this patchset?
Since you have submitted original patchset for sc7280, it looks like you 
should be interested in testing that this patchset doesn't break your 
devices.

> 
> Changes since RFC:
>   - Rework clk-regmap-mux fields. Specify safe parent as P_* value rather
>     than specifying the register value directly
>   - Expand commit message to the first patch to specially mention that
>     it is required only on newer generations of Qualcomm chipsets.
> 
> Dmitry Baryshkov (5):
>    clk: qcom: regmap-mux: add pipe clk implementation
>    clk: qcom: gcc-sm8450: use new clk_regmap_mux_safe_ops for PCIe pipe
>      clocks
>    clk: qcom: gcc-sc7280: use new clk_regmap_mux_safe_ops for PCIe pipe
>      clocks
>    PCI: qcom: Remove unnecessary pipe_clk handling
>    PCI: qcom: Drop manual pipe_clk_src handling
> 
>   drivers/clk/qcom/clk-regmap-mux.c      | 78 +++++++++++++++++++++++
>   drivers/clk/qcom/clk-regmap-mux.h      |  3 +
>   drivers/clk/qcom/gcc-sc7280.c          |  6 +-
>   drivers/clk/qcom/gcc-sm8450.c          |  6 +-
>   drivers/pci/controller/dwc/pcie-qcom.c | 87 +-------------------------
>   5 files changed, 92 insertions(+), 88 deletions(-)
>
Prasad Malisetty (Temp) (QUIC) April 4, 2022, 5:03 a.m. UTC | #2
Hi Dmitry,

Please find inline comments below.

Thanks
-Prasad

> -----Original Message-----
> From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Sent: Wednesday, March 30, 2022 6:26 PM
> To: Prasad Malisetty (Temp) (QUIC) <quic_pmaliset@quicinc.com>; Andy Gross
> <agross@kernel.org>; bjorn.andersson@linaro.org; Stephen Boyd
> <swboyd@chromium.org>; Michael Turquette <mturquette@baylibre.com>;
> Taniya Das <tdas@codeaurora.org>; Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com>; Krzysztof WilczyƄski <kw@linux.com>; Bjorn
> Helgaas <bhelgaas@google.com>
> Cc: linux-arm-msm@vger.kernel.org; linux-clk@vger.kernel.org; linux-
> pci@vger.kernel.org
> Subject: Re: [PATCH v1 0/5] PCI: qcom: rework pipe_clk/pipe_clk_src handling
> 
> On 23/03/2022 11:50, Dmitry Baryshkov wrote:
> > PCIe pipe clk (and some other clocks) must be parked to the "safe"
> > source (bi_tcxo) when corresponding GDSC is turned off and on again.
> > Currently this is handcoded in the PCIe driver by reparenting the
> > gcc_pipe_N_clk_src clock.
> >
> > Instead of doing it manually, follow the approach used by
> > clk_rcg2_shared_ops and implement this parking in the enable() and
> > disable() clock operations for respective pipe clocks.
> 
> Prasad, can we please get your comments on this patchset?
> Since you have submitted original patchset for sc7280, it looks like you should be
> interested in testing that this patchset doesn't break your devices.
> 
Thanks for optimizing pipe clock handling. 
Sure Dmitry, the validation is in progress ( Need to validate power consumption and other stuff).
I will update once done.

Thanks,
-Prasad.
> >
> > Changes since RFC:
> >   - Rework clk-regmap-mux fields. Specify safe parent as P_* value rather
> >     than specifying the register value directly
> >   - Expand commit message to the first patch to specially mention that
> >     it is required only on newer generations of Qualcomm chipsets.
> >
> > Dmitry Baryshkov (5):
> >    clk: qcom: regmap-mux: add pipe clk implementation
> >    clk: qcom: gcc-sm8450: use new clk_regmap_mux_safe_ops for PCIe pipe
> >      clocks
> >    clk: qcom: gcc-sc7280: use new clk_regmap_mux_safe_ops for PCIe pipe
> >      clocks
> >    PCI: qcom: Remove unnecessary pipe_clk handling
> >    PCI: qcom: Drop manual pipe_clk_src handling
> >
> >   drivers/clk/qcom/clk-regmap-mux.c      | 78 +++++++++++++++++++++++
> >   drivers/clk/qcom/clk-regmap-mux.h      |  3 +
> >   drivers/clk/qcom/gcc-sc7280.c          |  6 +-
> >   drivers/clk/qcom/gcc-sm8450.c          |  6 +-
> >   drivers/pci/controller/dwc/pcie-qcom.c | 87 +-------------------------
> >   5 files changed, 92 insertions(+), 88 deletions(-)
> >
> 
> 
> --
> With best wishes
> Dmitry