Devicetree
 help / color / mirror / Atom feed
* [PATCH v4 0/4] IPQ5018: Add and enable GEPHY RX and TX clocks
@ 2026-06-08  5:09 George Moussalem via B4 Relay
  2026-06-08  5:09 ` [PATCH v4 1/4] dt-bindings: net: ethernet-phy: increase max clock count to two George Moussalem via B4 Relay
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: George Moussalem via B4 Relay @ 2026-06-08  5:09 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Bjorn Andersson, Konrad Dybcio
  Cc: netdev, devicetree, linux-kernel, Konrad Dybcio, linux-arm-msm,
	George Moussalem, Conor Dooley, Dmitry Baryshkov

Greetings,

This patch series addresses a missing hardware description issue for the
Qualcomm IPQ5018 Internal Ethernet PHY, where the data paths fail to
function correctly unless their dedicated RX and TX clocks are
explicitly enabled.

Further testing revealed that leaving these clocks unmanaged by the
kernel, they were inadvertently left enabled by the bootloader / QSDK
platform, which masked the issue. Testing a fresh network configuration
path exposed that the data link fails to work without explicit software
gating.

To correctly introduce the required multi-clock properties, the IPQ5018
binding definition must first be split away from the shared
qca,ar803x.yaml schema. This isolation is required because ar803x
references the generic ethernet-phy.yaml, which enforces a strict
single-clock limit constraint. 

- Patch 1: Moves the clocks property and its restriction out of the
	   generic ethernet-phy.yaml schema to individual bindings files
	   that need it to allow for PHYs that require multiple clocks.
- Patch 2: Add clocks property to qca,ar803x.yaml for the IPQ5018 PHY.
- Patch 3: Appends the missing RX/TX clock definitions into the IPQ5018
           device tree before driver modification to avoid the driver
	   failing to probe.
- Patch 4: Updates the Qualcomm AT803x PHY driver framework to acquire,
	   enable, and gate these clocks upon link state changes for
	   runtime power optimization.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
Changes in v4:
- Removed code to enable/disable clocks upon link state changes.
- Enable the RX/TX clocks during probe and removed them from priv struct
  as we don't need to manage them after enabling during probe.
- Link to v3: https://lore.kernel.org/r/20260605-ipq5018-gephy-clocks-v3-0-f232d9ca0966@outlook.com

Changes in v3:
- Revert the change to move the clocks property out of the generic
  ethernet-phy.yaml schema and simple increase the maxItems limit to 2.
- Listed clocks, clock-names, and resets as required properties in the
  schema.
- Acquire the RX and TX clock during probe without enabling them. Then
  enable/disable the clocks in the link state change callback to ensure
  they are only active when needed with checks to avoid redundant
  enable/disable calls.
- Re-ran make dt_binding_check on all schemas in net folder without new
  issues.
- Link to v2: https://lore.kernel.org/r/20260602-ipq5018-gephy-clocks-v2-0-65a1f1d881f3@outlook.com

Changes in v2:
- Added patch 1 to move the clocks property and its restriction out of
  the generic ethernet-phy.yaml schema to individual bindings files that
  need it to allow for PHYs that require multiple clocks.
- Reverted splitting out IPQ5018 from the shared qca,ar803x.yaml schema
  and simply added the clocks and clock-names properties to the
  definition of the IPQ5018 PHY.
- Corrected / updated commit title of patch 4 (qca,at803x -> at803x)
- Link to v1: https://lore.kernel.org/r/20260601-ipq5018-gephy-clocks-v1-0-2df8287712c3@outlook.com

---
George Moussalem (4):
      dt-bindings: net: ethernet-phy: increase max clock count to two
      dt-bindings: net: qca,ar803x: Add clocks for IPQ5018 PHY
      arm64: qcom: ipq5018: Add GEPHY RX and TX clocks
      net: phy: at803x: add RX and TX clock management for IPQ5018 PHY

 .../devicetree/bindings/net/ethernet-phy.yaml         |  9 ++++++---
 Documentation/devicetree/bindings/net/qca,ar803x.yaml | 19 +++++++++++++++++++
 arch/arm64/boot/dts/qcom/ipq5018.dtsi                 |  3 +++
 drivers/net/phy/qcom/at803x.c                         | 12 ++++++++++++
 4 files changed, 40 insertions(+), 3 deletions(-)
---
base-commit: 7da7f07112610a520567421dd2ffcb51beaefbcc
change-id: 20260601-ipq5018-gephy-clocks-e8a2440178a0

Best regards,
-- 
George Moussalem <george.moussalem@outlook.com>



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

* [PATCH v4 1/4] dt-bindings: net: ethernet-phy: increase max clock count to two
  2026-06-08  5:09 [PATCH v4 0/4] IPQ5018: Add and enable GEPHY RX and TX clocks George Moussalem via B4 Relay
@ 2026-06-08  5:09 ` George Moussalem via B4 Relay
  2026-06-08  5:09 ` [PATCH v4 2/4] dt-bindings: net: qca,ar803x: Add clocks for IPQ5018 PHY George Moussalem via B4 Relay
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: George Moussalem via B4 Relay @ 2026-06-08  5:09 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Bjorn Andersson, Konrad Dybcio
  Cc: netdev, devicetree, linux-kernel, Konrad Dybcio, linux-arm-msm,
	George Moussalem

From: George Moussalem <george.moussalem@outlook.com>

The clocks property has a restriction to maximum one.
Yet, some PHYs may require more than 1 clock such as the IPQ5018 PHY
which requires two clocks for RX and TX. As such, increase maxItems to
two.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
Commit 350b7a258f20 introduced the clocks property with a restriction to
maximum 1 to the main ethernet-phy.yaml binding for Realtek to add an
optional external clock source. This is restrictive to all PHY bindings,
as some PHYs may require more than 1 clock such as the IPQ5018 PHY which
requires 2 clocks (for RX and TX).
---
 Documentation/devicetree/bindings/net/ethernet-phy.yaml | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
index 21a1a63506f0..c3ebb3af8b52 100644
--- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
@@ -106,10 +106,13 @@ properties:
       by software.
 
   clocks:
-    maxItems: 1
+    minItems: 1
+    maxItems: 2
     description:
-      External clock connected to the PHY. If not specified it is assumed
-      that the PHY uses a fixed crystal or an internal oscillator.
+      External clock connected to the PHY or RX and TX clocks that the PHY
+      requires to enable explicitly. If not specified it is assumed
+      that the PHY uses a fixed crystal or an internal oscillator or that the
+      RX/TX clocks are hardware enabled by default.
 
   enet-phy-lane-swap:
     $ref: /schemas/types.yaml#/definitions/flag

-- 
2.53.0



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

* [PATCH v4 2/4] dt-bindings: net: qca,ar803x: Add clocks for IPQ5018 PHY
  2026-06-08  5:09 [PATCH v4 0/4] IPQ5018: Add and enable GEPHY RX and TX clocks George Moussalem via B4 Relay
  2026-06-08  5:09 ` [PATCH v4 1/4] dt-bindings: net: ethernet-phy: increase max clock count to two George Moussalem via B4 Relay
@ 2026-06-08  5:09 ` George Moussalem via B4 Relay
  2026-06-08  5:09 ` [PATCH v4 3/4] arm64: qcom: ipq5018: Add GEPHY RX and TX clocks George Moussalem via B4 Relay
  2026-06-08  5:09 ` [PATCH v4 4/4] net: phy: at803x: add RX and TX clock management for IPQ5018 PHY George Moussalem via B4 Relay
  3 siblings, 0 replies; 6+ messages in thread
From: George Moussalem via B4 Relay @ 2026-06-08  5:09 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Bjorn Andersson, Konrad Dybcio
  Cc: netdev, devicetree, linux-kernel, Konrad Dybcio, linux-arm-msm,
	George Moussalem, Conor Dooley

From: George Moussalem <george.moussalem@outlook.com>

Further testing revealed that the RX and TX clocks of the IPQ5018 PHY
need to be explicitly enabled. As such, add the required clocks to the
schema.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
 Documentation/devicetree/bindings/net/qca,ar803x.yaml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/qca,ar803x.yaml b/Documentation/devicetree/bindings/net/qca,ar803x.yaml
index 7ae5110e7aa2..53f648c4135f 100644
--- a/Documentation/devicetree/bindings/net/qca,ar803x.yaml
+++ b/Documentation/devicetree/bindings/net/qca,ar803x.yaml
@@ -28,6 +28,16 @@ allOf:
         reg:
           const: 7  # This PHY is always at MDIO address 7 in the IPQ5018 SoC
 
+        clocks:
+          items:
+            - description: RX clock
+            - description: TX clock
+
+        clock-names:
+          items:
+            - const: rx
+            - const: tx
+
         resets:
           items:
             - description:
@@ -42,6 +52,11 @@ allOf:
             of this PHY are directly connected to an RJ45 connector.
           type: boolean
 
+      required:
+        - clocks
+        - clock-names
+        - resets
+
 properties:
   compatible:
     enum:
@@ -162,6 +177,7 @@ examples:
         };
     };
   - |
+    #include <dt-bindings/clock/qcom,gcc-ipq5018.h>
     #include <dt-bindings/reset/qcom,gcc-ipq5018.h>
 
     mdio {
@@ -172,6 +188,9 @@ examples:
             compatible = "ethernet-phy-id004d.d0c0";
             reg = <7>;
 
+            clocks = <&gcc GCC_GEPHY_RX_CLK>,
+                     <&gcc GCC_GEPHY_TX_CLK>;
+            clock-names = "rx", "tx";
             resets = <&gcc GCC_GEPHY_MISC_ARES>;
         };
     };

-- 
2.53.0



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

* [PATCH v4 3/4] arm64: qcom: ipq5018: Add GEPHY RX and TX clocks
  2026-06-08  5:09 [PATCH v4 0/4] IPQ5018: Add and enable GEPHY RX and TX clocks George Moussalem via B4 Relay
  2026-06-08  5:09 ` [PATCH v4 1/4] dt-bindings: net: ethernet-phy: increase max clock count to two George Moussalem via B4 Relay
  2026-06-08  5:09 ` [PATCH v4 2/4] dt-bindings: net: qca,ar803x: Add clocks for IPQ5018 PHY George Moussalem via B4 Relay
@ 2026-06-08  5:09 ` George Moussalem via B4 Relay
  2026-06-08  5:09 ` [PATCH v4 4/4] net: phy: at803x: add RX and TX clock management for IPQ5018 PHY George Moussalem via B4 Relay
  3 siblings, 0 replies; 6+ messages in thread
From: George Moussalem via B4 Relay @ 2026-06-08  5:09 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Bjorn Andersson, Konrad Dybcio
  Cc: netdev, devicetree, linux-kernel, Konrad Dybcio, linux-arm-msm,
	George Moussalem, Dmitry Baryshkov

From: George Moussalem <george.moussalem@outlook.com>

Add RX and TX clocks for the IPQ5018 GEPHY to enable the datapath.

Fixes: f5f2b835e316 ("arm64: dts: qcom: ipq5018: Add GE PHY to internal mdio bus")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
 arch/arm64/boot/dts/qcom/ipq5018.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq5018.dtsi b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
index 6f8004a22a1f..60c27a6f2b10 100644
--- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
@@ -229,6 +229,9 @@ ge_phy: ethernet-phy@7 {
 				compatible = "ethernet-phy-id004d.d0c0";
 				reg = <7>;
 
+				clocks = <&gcc GCC_GEPHY_RX_CLK>,
+					 <&gcc GCC_GEPHY_TX_CLK>;
+				clock-names = "rx", "tx";
 				resets = <&gcc GCC_GEPHY_MISC_ARES>;
 			};
 		};

-- 
2.53.0



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

* [PATCH v4 4/4] net: phy: at803x: add RX and TX clock management for IPQ5018 PHY
  2026-06-08  5:09 [PATCH v4 0/4] IPQ5018: Add and enable GEPHY RX and TX clocks George Moussalem via B4 Relay
                   ` (2 preceding siblings ...)
  2026-06-08  5:09 ` [PATCH v4 3/4] arm64: qcom: ipq5018: Add GEPHY RX and TX clocks George Moussalem via B4 Relay
@ 2026-06-08  5:09 ` George Moussalem via B4 Relay
  2026-06-09  5:09   ` sashiko-bot
  3 siblings, 1 reply; 6+ messages in thread
From: George Moussalem via B4 Relay @ 2026-06-08  5:09 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Bjorn Andersson, Konrad Dybcio
  Cc: netdev, devicetree, linux-kernel, Konrad Dybcio, linux-arm-msm,
	George Moussalem

From: George Moussalem <george.moussalem@outlook.com>

Acquire and enable the RX and TX clocks for the IPQ5018 PHY.
These clocks are required for the PHY's datapath to function correctly.

Fixes: d46502279a11 ("net: phy: qcom: at803x: Add Qualcomm IPQ5018 Internal PHY support")
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
 drivers/net/phy/qcom/at803x.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/phy/qcom/at803x.c b/drivers/net/phy/qcom/at803x.c
index 63726cf98cd4..ba4dc07752b6 100644
--- a/drivers/net/phy/qcom/at803x.c
+++ b/drivers/net/phy/qcom/at803x.c
@@ -19,6 +19,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/of.h>
 #include <linux/phylink.h>
+#include <linux/clk.h>
 #include <linux/reset.h>
 #include <linux/phy_port.h>
 #include <dt-bindings/net/qca-ar803x.h>
@@ -1074,6 +1075,7 @@ static void ipq5018_link_change_notify(struct phy_device *phydev)
 static int ipq5018_probe(struct phy_device *phydev)
 {
 	struct device *dev = &phydev->mdio.dev;
+	struct clk *rx_clk, *tx_clk;
 	struct ipq5018_priv *priv;
 	int ret;
 
@@ -1084,6 +1086,16 @@ static int ipq5018_probe(struct phy_device *phydev)
 	priv->set_short_cable_dac = of_property_read_bool(dev->of_node,
 							  "qcom,dac-preset-short-cable");
 
+	rx_clk = devm_clk_get_enabled(dev, "rx");
+	if (IS_ERR(rx_clk))
+		return dev_err_probe(dev, PTR_ERR(rx_clk),
+				     "failed to get and enable RX clock\n");
+
+	tx_clk = devm_clk_get_enabled(dev, "tx");
+	if (IS_ERR(tx_clk))
+		return dev_err_probe(dev, PTR_ERR(tx_clk),
+				     "failed to get and enable TX clock\n");
+
 	priv->rst = devm_reset_control_array_get_exclusive(dev);
 	if (IS_ERR(priv->rst))
 		return dev_err_probe(dev, PTR_ERR(priv->rst),

-- 
2.53.0



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

* Re: [PATCH v4 4/4] net: phy: at803x: add RX and TX clock management for IPQ5018 PHY
  2026-06-08  5:09 ` [PATCH v4 4/4] net: phy: at803x: add RX and TX clock management for IPQ5018 PHY George Moussalem via B4 Relay
@ 2026-06-09  5:09   ` sashiko-bot
  0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-06-09  5:09 UTC (permalink / raw)
  To: George Moussalem via B4 Relay; +Cc: robh, devicetree, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The use of `devm_clk_get_enabled()` makes 'rx' and 'tx' clocks mandatory, breaking backward compatibility with older Device Trees where these properties are absent.
--

commit f4405a562aab15670004ca1eb487237c7985a67a
Author: George Moussalem <george.moussalem@outlook.com>

net: phy: at803x: add RX and TX clock management for IPQ5018 PHY

Acquire and enable the RX and TX clocks for the IPQ5018 PHY.
These clocks are required for the PHY's datapath to function correctly.

> diff --git a/drivers/net/phy/qcom/at803x.c b/drivers/net/phy/qcom/at803x.c
> index 63726cf98cd42..ba4dc07752b60 100644
> --- a/drivers/net/phy/qcom/at803x.c
> +++ b/drivers/net/phy/qcom/at803x.c
[ ... ]
> @@ -1084,6 +1086,16 @@ static int ipq5018_probe(struct phy_device *phydev)
>  	priv->set_short_cable_dac = of_property_read_bool(dev->of_node,
>  							  "qcom,dac-preset-short-cable");
>  
> +	rx_clk = devm_clk_get_enabled(dev, "rx");
> +	if (IS_ERR(rx_clk))
> +		return dev_err_probe(dev, PTR_ERR(rx_clk),
> +				     "failed to get and enable RX clock\n");
> +
> +	tx_clk = devm_clk_get_enabled(dev, "tx");
> +	if (IS_ERR(tx_clk))
> +		return dev_err_probe(dev, PTR_ERR(tx_clk),
> +				     "failed to get and enable TX clock\n");

[Severity: High]
Does this break backward compatibility with older Device Trees that do not
specify these clock properties?

Using devm_clk_get_enabled() makes these clocks mandatory, which will cause
ipq5018_probe() to fail unconditionally with -ENOENT if they are missing.

Could this be changed to use devm_clk_get_optional_enabled() so the interface
continues to work with older Device Trees while still enabling the clocks
when they are present?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260608-ipq5018-gephy-clocks-v4-0-fb2ccd56894b@outlook.com?part=4

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

end of thread, other threads:[~2026-06-09  5:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08  5:09 [PATCH v4 0/4] IPQ5018: Add and enable GEPHY RX and TX clocks George Moussalem via B4 Relay
2026-06-08  5:09 ` [PATCH v4 1/4] dt-bindings: net: ethernet-phy: increase max clock count to two George Moussalem via B4 Relay
2026-06-08  5:09 ` [PATCH v4 2/4] dt-bindings: net: qca,ar803x: Add clocks for IPQ5018 PHY George Moussalem via B4 Relay
2026-06-08  5:09 ` [PATCH v4 3/4] arm64: qcom: ipq5018: Add GEPHY RX and TX clocks George Moussalem via B4 Relay
2026-06-08  5:09 ` [PATCH v4 4/4] net: phy: at803x: add RX and TX clock management for IPQ5018 PHY George Moussalem via B4 Relay
2026-06-09  5:09   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox