* [PATCH v2 1/2] phy: qcom: qmp-pcie: restore compatibility with existing DTs
2024-06-14 8:35 [PATCH v2 0/2] phy: qcom: qmp-pcie: drop second clock-output-names entry Dmitry Baryshkov
@ 2024-06-14 8:35 ` Dmitry Baryshkov
2024-06-14 8:35 ` [PATCH v2 2/2] dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: drop second output clock name Dmitry Baryshkov
2024-06-14 15:49 ` [PATCH v2 0/2] phy: qcom: qmp-pcie: drop second clock-output-names entry Manivannan Sadhasivam
2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2024-06-14 8:35 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, Dmitry Baryshkov
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")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
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 8cb91b9114d6..5b36cc7ac78b 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
@@ -4033,14 +4033,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::phy_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] 4+ messages in thread* [PATCH v2 2/2] dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: drop second output clock name
2024-06-14 8:35 [PATCH v2 0/2] phy: qcom: qmp-pcie: drop second clock-output-names entry Dmitry Baryshkov
2024-06-14 8:35 ` [PATCH v2 1/2] phy: qcom: qmp-pcie: restore compatibility with existing DTs Dmitry Baryshkov
@ 2024-06-14 8:35 ` Dmitry Baryshkov
2024-06-14 15:49 ` [PATCH v2 0/2] phy: qcom: qmp-pcie: drop second clock-output-names entry Manivannan Sadhasivam
2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2024-06-14 8:35 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, Dmitry Baryshkov
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")
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
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] 4+ messages in thread* Re: [PATCH v2 0/2] phy: qcom: qmp-pcie: drop second clock-output-names entry
2024-06-14 8:35 [PATCH v2 0/2] phy: qcom: qmp-pcie: drop second clock-output-names entry Dmitry Baryshkov
2024-06-14 8:35 ` [PATCH v2 1/2] phy: qcom: qmp-pcie: restore compatibility with existing DTs Dmitry Baryshkov
2024-06-14 8:35 ` [PATCH v2 2/2] dt-bindings: phy: qcom,sc8280xp-qmp-pcie-phy: drop second output clock name Dmitry Baryshkov
@ 2024-06-14 15:49 ` Manivannan Sadhasivam
2 siblings, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2024-06-14 15:49 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-arm-msm, linux-phy,
linux-kernel, Krzysztof Kozlowski, devicetree
On Fri, Jun 14, 2024 at 11:35:33AM +0300, Dmitry Baryshkov wrote:
> 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>
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
- Mani
> ---
> Changes in v2:
> - Fixed generated AUX clock name (Neil)
> - Link to v1: https://lore.kernel.org/r/20240521-fix-pcie-phy-compat-v1-0-8aa415b92308@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: 6906a84c482f098d31486df8dc98cead21cce2d0
> change-id: 20240521-fix-pcie-phy-compat-b0fd4eb46bda
>
> Best regards,
> --
> Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 4+ messages in thread