* [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