All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/5] phy: qcom-qmp: add support for pipe clock muxing
@ 2022-04-21 10:20 ` Johan Hovold
  0 siblings, 0 replies; 36+ messages in thread
From: Johan Hovold @ 2022-04-21 10:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Lorenzo Pieralisi,
	Kishon Vijay Abraham I, Vinod Koul, Stephen Boyd
  Cc: Rob Herring, Krzysztof Kozlowski, Stanimir Varbanov,
	Krzysztof Wilczyński, Bjorn Helgaas, Dmitry Baryshkov,
	Prasad Malisetty, linux-arm-msm, devicetree, linux-kernel,
	linux-pci, linux-phy, Johan Hovold

Some QMP PHYs need to remux to their pipe clock input to the pipe clock
output generated by the PHY before powering on the PHY and restore the
default source during power down.

         +---------------+
         |   PHY block   |<<---------------------------------------+
         |               |                   +-----+               |
         |   +-------+   |                   | GCC |               |
   I/P---^-->|  PLL  |---^--->pipe_clksrc--->|-\   |		   |
    clk  |   +-------+   |                   |  +--|--->pipe_clk---+
    	 |		 |	       xo--->|-/   |  
         +---------------+	             +-----|

This series moves the pipe clock mux handling from PCIe controller
driver into the PHY driver which already manages the pipe clock as the
PHY is both the producer of the pipe clock as well as its (primary)
consumer.

This is an alternative to the series posted here

	https://lore.kernel.org/r/20220413233144.275926-1-dmitry.baryshkov@linaro.org

which instead moves the mux handling into the clock drivers and ties
remuxing to the gating/ungating of the pipe clock in the GCC. That
approach means that it is still possible to have the pipe clock ungated
without providing a valid source, somethings which can cause hangs when
enabling/disabling the GDSC (presumably as some entity is consuming the
pipe clock).

Implementing this in the clock drivers also means that the
implementation is spread out over multiple files and makes it harder to
add support for new SoCs as it may not be clear that every pipe clock
mux definition needs to be updated with safe and non-safe parent-clock
indexes and an ad-hoc mux ops implementation.

The custom mux implementation currently also hides the actual topology
of the clock tree by always reporting the pipe mux source as being
provided by the PHY (e.g. as reported by debugfs).

This series, by contrast, ties the muxing to when the pipe clock source
is enabled, that is, when the PHY is powered on, so that the GCC pipe
clock always has a valid source.

The implementation is more straight-forward, avoids the one-off clock
mux implementation, and allows for documenting this once and for all in
the PHY driver.

Note that the devicetree bindings remains to be updated but that this
was left out of this RFC.

This series depends on the two qcom-qmp fixlets posted here:

	https://lore.kernel.org/all/20220420152331.5527-1-johan+linaro@kernel.org/

Johan


Dmitry Baryshkov (1):
  PCI: qcom: Remove unnecessary pipe_clk handling

Johan Hovold (4):
  phy: qcom-qmp: add support for pipe clock muxing
  arm64: dts: qcom: sc7280: move pipe mux handling to phy
  PCI: qcom: Drop pipe clock muxing
  PCI: qcom: Drop unused post-init callbacks

 arch/arm64/boot/dts/qcom/sc7280.dtsi   | 18 ++---
 drivers/pci/controller/dwc/pcie-qcom.c | 96 ++------------------------
 drivers/phy/qualcomm/phy-qcom-qmp.c    | 71 +++++++++++++++++--
 3 files changed, 76 insertions(+), 109 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2022-04-29  6:53 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 10:20 [PATCH RFC 0/5] phy: qcom-qmp: add support for pipe clock muxing Johan Hovold
2022-04-21 10:20 ` Johan Hovold
2022-04-21 10:20 ` [PATCH RFC 1/5] " Johan Hovold
2022-04-21 10:20   ` Johan Hovold
2022-04-21 11:08   ` Dmitry Baryshkov
2022-04-21 11:08     ` Dmitry Baryshkov
2022-04-22 10:20     ` Johan Hovold
2022-04-22 10:20       ` Johan Hovold
2022-04-22 10:35       ` Dmitry Baryshkov
2022-04-22 10:35         ` Dmitry Baryshkov
2022-04-22 11:22         ` Johan Hovold
2022-04-22 11:22           ` Johan Hovold
2022-04-28 16:15         ` Rob Herring
2022-04-28 16:15           ` Rob Herring
2022-04-21 11:36   ` Dmitry Baryshkov
2022-04-21 11:36     ` Dmitry Baryshkov
2022-04-22 10:41     ` Johan Hovold
2022-04-22 10:41       ` Johan Hovold
2022-04-28 13:11   ` Bjorn Andersson
2022-04-28 13:11     ` Bjorn Andersson
2022-04-29  6:53     ` Johan Hovold
2022-04-29  6:53       ` Johan Hovold
2022-04-21 10:20 ` [PATCH RFC 2/5] arm64: dts: qcom: sc7280: move pipe mux handling to phy Johan Hovold
2022-04-21 10:20   ` Johan Hovold
2022-04-21 10:59   ` Dmitry Baryshkov
2022-04-21 10:59     ` Dmitry Baryshkov
2022-04-22 10:07     ` Johan Hovold
2022-04-22 10:07       ` Johan Hovold
2022-04-22 10:36       ` Dmitry Baryshkov
2022-04-22 10:36         ` Dmitry Baryshkov
2022-04-21 10:20 ` [PATCH RFC 3/5] PCI: qcom: Remove unnecessary pipe_clk handling Johan Hovold
2022-04-21 10:20   ` Johan Hovold
2022-04-21 10:20 ` [PATCH RFC 4/5] PCI: qcom: Drop pipe clock muxing Johan Hovold
2022-04-21 10:20   ` Johan Hovold
2022-04-21 10:20 ` [PATCH RFC 5/5] PCI: qcom: Drop unused post-init callbacks Johan Hovold
2022-04-21 10:20   ` Johan Hovold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.