Files
openwrt_mitrastar/target/linux/qualcommbe/patches-6.12/0320-net-pcs-qcom-ipq9574-delay-mii-clock-probing-until-i.patch
Alexandru Gagniuc 3744b73602 qualcommbe: v6.12: add ethernet PCS driver for IPQ9574
Add the v5 of the PCS patch. This is the latest submission as of this
writing. THe last four patches are not part of the submission. They
make the series work with v6.12 kernel, resolve a circular dependency
with the clocks, and add the DTS node. Include them as bundle.

Link: https://lore.kernel.org/lkml/20250207-ipq_pcs_6-14_rc1-v5-0-be2ebec32921@quicinc.com/
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18796
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-31 12:25:48 +02:00

83 lines
3.4 KiB
Diff

From 5b2f02ccca7b9496f0a8da6ade063b82810c75e7 Mon Sep 17 00:00:00 2001
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Date: Mon, 12 May 2025 09:27:17 -0500
Subject: [PATCH] net: pcs: qcom-ipq9574: delay mii clock probing until
ipq_pcs_get()
NSSCC generates the SYS and AHB clocks for the PCS block The PCS then
feeds the uniphy clocks back to the NSSCC, which are in turn, used to
feed the PCS MII clocks. This works fine in hardware:
GCC -> NSSCC -> PCS -> NSSCC -> PCS(MII)
However, when the PCS MII clocks are probed within the .probe() of
the PCS block, it creates a circular dependency. The MII clocks depend
on the uniphy clocks, which depend on the PCS block being probed.
Since we are in the process of probing the PCS block, this results in
both blocks returning with -EPROBE_DEFER:
platform 39b00000.clock-controller: deferred probe pending: platform: supplier 7a00000.ethernet-pcs not ready
mdio_bus 90000.mdio-1:18: deferred probe pending: mdio_bus: supplier 7a20000.ethernet-pcs not ready
mdio_bus 90000.mdio-1:00: deferred probe pending: mdio_bus: supplier 90000.mdio-1:18 not ready
mdio_bus 90000.mdio-1:01: deferred probe pending: mdio_bus: supplier 90000.mdio-1:18 not ready
mdio_bus 90000.mdio-1:02: deferred probe pending: mdio_bus: supplier 90000.mdio-1:18 not ready
mdio_bus 90000.mdio-1:03: deferred probe pending: mdio_bus: supplier 90000.mdio-1:18 not ready
platform 7a00000.ethernet-pcs: deferred probe pending: ipq9574_pcs: Failed to get MII 0 RX clock
platform 7a20000.ethernet-pcs: deferred probe pending: ipq9574_pcs: Failed to get MII 0 RX clock
platform 3a000000.qcom-ppe: deferred probe pending: platform: supplier 39b00000.clock-controller not ready
To break this dependency, let the PCS block probe, and only probe the
PCS MII clocks from ipq_pcs_get().
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
drivers/net/pcs/pcs-qcom-ipq9574.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
--- a/drivers/net/pcs/pcs-qcom-ipq9574.c
+++ b/drivers/net/pcs/pcs-qcom-ipq9574.c
@@ -580,20 +580,6 @@ static int ipq_pcs_create_miis(struct ip
qpcs_mii->pcs.neg_mode = true;
qpcs_mii->pcs.poll = true;
- qpcs_mii->rx_clk = devm_get_clk_from_child(dev, mii_np, "rx");
- if (IS_ERR(qpcs_mii->rx_clk)) {
- of_node_put(mii_np);
- return dev_err_probe(dev, PTR_ERR(qpcs_mii->rx_clk),
- "Failed to get MII %d RX clock\n", index);
- }
-
- qpcs_mii->tx_clk = devm_get_clk_from_child(dev, mii_np, "tx");
- if (IS_ERR(qpcs_mii->tx_clk)) {
- of_node_put(mii_np);
- return dev_err_probe(dev, PTR_ERR(qpcs_mii->tx_clk),
- "Failed to get MII %d TX clock\n", index);
- }
-
qpcs->qpcs_mii[index] = qpcs_mii;
}
@@ -848,6 +834,22 @@ struct phylink_pcs *ipq_pcs_get(struct d
return ERR_PTR(-ENOENT);
}
+ qpcs_mii->rx_clk = devm_get_clk_from_child(&pdev->dev, np, "rx");
+ if (IS_ERR(qpcs_mii->rx_clk)) {
+ put_device(&pdev->dev);
+ return dev_err_ptr_probe(&pdev->dev, PTR_ERR(qpcs_mii->rx_clk),
+ "Failed to get MII %d RX clock\n",
+ index);
+ }
+
+ qpcs_mii->tx_clk = devm_get_clk_from_child(&pdev->dev, np, "tx");
+ if (IS_ERR(qpcs_mii->tx_clk)) {
+ put_device(&pdev->dev);
+ return dev_err_ptr_probe(&pdev->dev, PTR_ERR(qpcs_mii->tx_clk),
+ "Failed to get MII %d TX clock\n",
+ index);
+ }
+
return &qpcs_mii->pcs;
}
EXPORT_SYMBOL(ipq_pcs_get);