Linux-ARM-MSM Archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] phy: qcom: qmp-pcie: drop second clock-output-names entry
@ 2024-05-21 20:30 Dmitry Baryshkov
  2024-05-21 20:30 ` [PATCH 1/2] phy: qcom: qmp-pcie: restore compatibility with existing DTs Dmitry Baryshkov
  2024-05-21 20:30 ` [PATCH 2/2] dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: drop second output clock name Dmitry Baryshkov
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2024-05-21 20:30 UTC (permalink / raw
  To: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, linux-phy, linux-kernel, Krzysztof Kozlowski,
	devicetree

While testing the linux-next on SM8450-HDK I noticed that one of the
PCIe hosts stays in the deferred state, because the corresponding PHY
isn't probed. A quick debug pointed out that while the patches that
added support for the PIPE AUX clock to the PHY driver have landed,
corresponding DT changes were not picked up for 6.10. Restore the
compatibility with the existing DT files by dropping the second entry in
the clock-output-names array and always generating the corresponding
name on the fly.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
Dmitry Baryshkov (2):
      phy: qcom: qmp-pcie: restore compatibility with existing DTs
      dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: drop second output clock name

 .../devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml      | 7 +------
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c                         | 9 +++------
 2 files changed, 4 insertions(+), 12 deletions(-)
---
base-commit: 632483ea8004edfadd035de36e1ab2c7c4f53158
change-id: 20240521-fix-pcie-phy-compat-b0fd4eb46bda

Best regards,
-- 
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


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

* [PATCH 1/2] phy: qcom: qmp-pcie: restore compatibility with existing DTs
  2024-05-21 20:30 [PATCH 0/2] phy: qcom: qmp-pcie: drop second clock-output-names entry Dmitry Baryshkov
@ 2024-05-21 20:30 ` Dmitry Baryshkov
  2024-05-22  7:46   ` Neil Armstrong
  2024-05-21 20:30 ` [PATCH 2/2] dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: drop second output clock name Dmitry Baryshkov
  1 sibling, 1 reply; 5+ messages in thread
From: Dmitry Baryshkov @ 2024-05-21 20:30 UTC (permalink / raw
  To: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, linux-phy, linux-kernel, Krzysztof Kozlowski,
	devicetree

Existing device trees specify only a single clock-output-name for the
PCIe PHYs. The function phy_aux_clk_register() expects a second entry in
that property. When it doesn't find it, it returns an error, thus
failing the probe of the PHY and thus breaking support for the
corresponding PCIe host.

Follow the approach of the combo USB+DT PHY and generate the name for
the AUX clocks instead of requiring it in DT.

Fixes: 583ca9ccfa80 ("phy: qcom: qmp-pcie: register second optional PHY AUX clock")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
index 6c796723c8f5..b4767b8cc014 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
@@ -3730,14 +3730,11 @@ static int phy_aux_clk_register(struct qmp_pcie *qmp, struct device_node *np)
 {
 	struct clk_fixed_rate *fixed = &qmp->aux_clk_fixed;
 	struct clk_init_data init = { };
-	int ret;
+	char name[64];
 
-	ret = of_property_read_string_index(np, "clock-output-names", 1, &init.name);
-	if (ret) {
-		dev_err(qmp->dev, "%pOFn: No clock-output-names index 1\n", np);
-		return ret;
-	}
+	snprintf(name, sizeof(name), "%s::pipe_aux_clk", dev_name(qmp->dev));
 
+	init.name = name;
 	init.ops = &clk_fixed_rate_ops;
 
 	fixed->fixed_rate = qmp->cfg->aux_clock_rate;

-- 
2.39.2


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

* [PATCH 2/2] dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: drop second output clock name
  2024-05-21 20:30 [PATCH 0/2] phy: qcom: qmp-pcie: drop second clock-output-names entry Dmitry Baryshkov
  2024-05-21 20:30 ` [PATCH 1/2] phy: qcom: qmp-pcie: restore compatibility with existing DTs Dmitry Baryshkov
@ 2024-05-21 20:30 ` Dmitry Baryshkov
  2024-05-22 11:23   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 5+ messages in thread
From: Dmitry Baryshkov @ 2024-05-21 20:30 UTC (permalink / raw
  To: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, linux-phy, linux-kernel, Krzysztof Kozlowski,
	devicetree

There is no need to specify exact name for the second (AUX) output
clock. It has never been used for the lookups based on the system clock
name. Partially revert commit 72bea132f368 ("dt-bindings: phy:
qcom,sc8280xp-qmp-pcie-phy: document PHY AUX clock on SM8[456]50 SoCs"),
returning compatibility with the existing device tree: reduce
clock-output-names to always contain a single entry.

Fixes: 72bea132f368 ("dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: document PHY AUX clock on SM8[456]50 SoCs")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 .../devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml        | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
index 16634f73bdcf..03dbd02cf9e7 100644
--- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
@@ -91,8 +91,7 @@ properties:
   "#clock-cells": true
 
   clock-output-names:
-    minItems: 1
-    maxItems: 2
+    maxItems: 1
 
   "#phy-cells":
     const: 0
@@ -222,14 +221,10 @@ allOf:
               - qcom,sm8650-qmp-gen4x2-pcie-phy
     then:
       properties:
-        clock-output-names:
-          minItems: 2
         "#clock-cells":
           const: 1
     else:
       properties:
-        clock-output-names:
-          maxItems: 1
         "#clock-cells":
           const: 0
 

-- 
2.39.2


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

* Re: [PATCH 1/2] phy: qcom: qmp-pcie: restore compatibility with existing DTs
  2024-05-21 20:30 ` [PATCH 1/2] phy: qcom: qmp-pcie: restore compatibility with existing DTs Dmitry Baryshkov
@ 2024-05-22  7:46   ` Neil Armstrong
  0 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2024-05-22  7:46 UTC (permalink / raw
  To: Dmitry Baryshkov, Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, linux-phy, linux-kernel, Krzysztof Kozlowski,
	devicetree

On 21/05/2024 22:30, Dmitry Baryshkov wrote:
> Existing device trees specify only a single clock-output-name for the
> PCIe PHYs. The function phy_aux_clk_register() expects a second entry in
> that property. When it doesn't find it, it returns an error, thus
> failing the probe of the PHY and thus breaking support for the
> corresponding PCIe host.
> 
> Follow the approach of the combo USB+DT PHY and generate the name for
> the AUX clocks instead of requiring it in DT.
> 
> Fixes: 583ca9ccfa80 ("phy: qcom: qmp-pcie: register second optional PHY AUX clock")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> index 6c796723c8f5..b4767b8cc014 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> @@ -3730,14 +3730,11 @@ static int phy_aux_clk_register(struct qmp_pcie *qmp, struct device_node *np)
>   {
>   	struct clk_fixed_rate *fixed = &qmp->aux_clk_fixed;
>   	struct clk_init_data init = { };
> -	int ret;
> +	char name[64];
>   
> -	ret = of_property_read_string_index(np, "clock-output-names", 1, &init.name);
> -	if (ret) {
> -		dev_err(qmp->dev, "%pOFn: No clock-output-names index 1\n", np);
> -		return ret;
> -	}
> +	snprintf(name, sizeof(name), "%s::pipe_aux_clk", dev_name(qmp->dev));

Should be "::phy_aux_clk"

>   
> +	init.name = name;
>   	init.ops = &clk_fixed_rate_ops;
>   
>   	fixed->fixed_rate = qmp->cfg->aux_clock_rate;
> 

With that:
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

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

* Re: [PATCH 2/2] dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: drop second output clock name
  2024-05-21 20:30 ` [PATCH 2/2] dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: drop second output clock name Dmitry Baryshkov
@ 2024-05-22 11:23   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-22 11:23 UTC (permalink / raw
  To: Dmitry Baryshkov, Vinod Koul, Kishon Vijay Abraham I,
	Neil Armstrong, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, linux-phy, linux-kernel, Krzysztof Kozlowski,
	devicetree

On 21/05/2024 22:30, Dmitry Baryshkov wrote:
> There is no need to specify exact name for the second (AUX) output
> clock. It has never been used for the lookups based on the system clock
> name. Partially revert commit 72bea132f368 ("dt-bindings: phy:
> qcom,sc8280xp-qmp-pcie-phy: document PHY AUX clock on SM8[456]50 SoCs"),
> returning compatibility with the existing device tree: reduce
> clock-output-names to always contain a single entry.
> 
> Fixes: 72bea132f368 ("dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: document PHY AUX clock on SM8[456]50 SoCs")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

end of thread, other threads:[~2024-05-22 11:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-21 20:30 [PATCH 0/2] phy: qcom: qmp-pcie: drop second clock-output-names entry Dmitry Baryshkov
2024-05-21 20:30 ` [PATCH 1/2] phy: qcom: qmp-pcie: restore compatibility with existing DTs Dmitry Baryshkov
2024-05-22  7:46   ` Neil Armstrong
2024-05-21 20:30 ` [PATCH 2/2] dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: drop second output clock name Dmitry Baryshkov
2024-05-22 11:23   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).