Skip to contentSkip to conversation

clk: add a driver for the ath79 PLL controller

PATCH Superseded Rosen Penev 4 participants 16 messages Nov 10

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover clk: add a driver for the ath79 PLL controller

The clocks of the Atheros/Qualcomm ath79 MIPS SoCs are set up by arch/mips/ath79/clock.c, a CLK_OF_DECLARE driver that registers every clock before the driver core is up. This series replaces it with a new driver in drivers/clk.

Only the reference and CPU clocks are registered early, with CLK_OF_DECLARE_DRIVER(), because the MIPS timer needs the CPU rate from plat_time_init(). A platform driver bound to the same node registers the DDR, AHB, MDIO, UART1 and PCIe clocks. Until it does, the early provider returns -EPROBE_DEFER for them. clk-mt7621 uses the same scheme.

Patches 1 and 2 move the two remaining non-clock duties out of the arch clock code, so that it only uses its own registers and the clk API: the QCA956x timer interrupt workaround, and the reference clock that is read from the bootstrap pins when the device tree has no rate. Patches 3 and 4 add the UART1 and PCIe PLL clock IDs. Patch 5 adds the new driver, and patch 6 removes the old code.

Tested on a TP-Link Archer C7 v2 (QCA9558) with an LLVM build. The CPU, DDR, AHB and reference rates (960, 800, 266.67 and 40 MHz) match those of the old code. The serial console, both GMACs, the PCIe PLL with a QCA9880 behind it, and the WMAC all work, and no devices are left deferred. The other SoCs are not tested on hardware. For each SoC the rate calculation was compiled in userspace together with the old code and fed 2 million random register sets. The results are identical, except where the old code overflowed 32 bits with register values that no real setup uses.

Changes in v2:
- Post the new driver as one patch, instead of moving arch/mips/ath79/clock.c to drivers/clk and cleaning it up over six patches (review feedback).
- Register only the reference and CPU clocks with CLK_OF_DECLARE, and the others from a platform driver (review feedback).
- Describe the SoCs with match data, and read the CPU, DDR and AHB selection of AR934x and later with one function.
- Keep mapping the AR934x SRIF block from its fixed address. It lies inside the wireless MAC registers, which ath9k claims, so it can't be a reg entry of the PLL node.
- Drop the clkdev registrations, which have no users.

Claude Code (Claude Opus 5.5) was used while preparing this series. It wrote most of the new driver from the old one, together with the userspace test of the rate calculation. I reviewed and tested every change and take responsibility for it.

Rosen Penev (6):
MIPS: ath79: apply the QCA956x timer workaround in setup
MIPS: ath79: move the bootstrap reference clock to setup
dt-bindings: clock: ath79: add the UART1 clock
dt-bindings: clock: ath79: add the PCIe PLL clock
clk: add a driver for the Atheros/Qualcomm ath79 PLL controller
MIPS: ath79: remove the old clock code

 MAINTAINERS                           |   8 +
 arch/mips/ath79/Makefile              |   2 +-
 arch/mips/ath79/clock.c               | 673 ----------------------
 arch/mips/ath79/setup.c               | 100 ++++
 drivers/clk/Kconfig                   |  12 +
 drivers/clk/Makefile                  |   1 +
 drivers/clk/clk-ath79.c               | 778 ++++++++++++++++++++++++++
 include/dt-bindings/clock/ath79-clk.h |   4 +-
 8 files changed, 903 insertions(+), 675 deletions(-)
 delete mode 100644 arch/mips/ath79/clock.c
 create mode 100644 drivers/clk/clk-ath79.c

base-commit: 630059a5a632377b9b7b487baccde92b7ae1dd47

Signature · 1 line
2.56.0
#1 lore raw

PATCH v2 1/6 MIPS: ath79: apply the QCA956x timer workaround in setup

qca956x_clocks_init() enables the MIPS timer interrupt in the misc interrupt controller, which QCA956x needs before the clocks are set up, or there are no jiffies. That has nothing to do with the clocks, and it ties the clock code to ath79_reset_base.

Do it in plat_time_init() right before of_clk_init() instead, which runs the clock setup. The order is the same. TP9343 boards use the QCA956x PLL and took this path too, so check for both.

---
 arch/mips/ath79/clock.c | 10 ----------
 arch/mips/ath79/setup.c | 13 +++++++++++++
 2 files changed, 13 insertions(+), 10 deletions(-)
arch/mips/ath79/clock.c +0 -10
index 050f6553f398..8c5eaa4ab6e0 100644
@@ -523,16 +523,6 @@ static void __init qca956x_clocks_init(void __iomem *pll_base)
 	u32 cpu_pll, ddr_pll;
 	u32 bootstrap;
 
-	/*
-	 * QCA956x timer init workaround has to be applied right before setting
-	 * up the clock. Else, there will be no jiffies
-	 */
-	u32 misc;
-
-	misc = ath79_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE);
-	misc |= MISC_INT_MIPS_SI_TIMERINT_MASK;
-	ath79_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE, misc);
-
 	bootstrap = ath79_reset_rr(QCA956X_RESET_REG_BOOTSTRAP);
 	if (bootstrap &	QCA956X_BOOTSTRAP_REF_CLK_40)
 		ref_rate = 40 * 1000 * 1000;
arch/mips/ath79/setup.c +13 -0
index 4e18cdcf65a0..d9e1cc77ad04 100644
@@ -241,6 +241,19 @@ void __init plat_time_init(void)
 	struct clk *clk;
 	unsigned long cpu_clk_rate;
 
+	/*
+	 * QCA956x needs the MIPS timer interrupt enabled in the misc
+	 * interrupt controller before the clocks are set up, or there are
+	 * no jiffies.
+	 */
+	if (soc_is_qca956x() || soc_is_tp9343()) {
+		u32 misc;
+
+		misc = ath79_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE);
+		misc |= MISC_INT_MIPS_SI_TIMERINT_MASK;
+		ath79_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE, misc);
+	}
+
 	of_clk_init(NULL);
 
 	np = of_get_cpu_node(0, NULL);
Signature · 1 line
2.56.0
#2 lore raw

PATCH v2 2/6 MIPS: ath79: move the bootstrap reference clock to setup

In reply to Rosen Penev

The qca,ath79-pll binding requires the reference clock as an input, and a rate in the device tree already took precedence over the 25/40 MHz that the clock code read from the bootstrap pins. Many AR933x boards leave the rate out, though, and rely on the pins.

Read the pins in plat_time_init() instead, and register the reference clock from them only when the device tree gives no rate. The clock code then takes the DT clock or this one through the clk API and no longer needs ath79_reset_base. When the device tree does give a rate, warn if it disagrees with the pins: a wrong rate leaves the CPU, DDR and AHB rates off, the UART baud rate included.

---
 arch/mips/ath79/clock.c | 71 ++++++++-------------------------
 arch/mips/ath79/setup.c | 87 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+), 54 deletions(-)
arch/mips/ath79/clock.c +17 -54
index 8c5eaa4ab6e0..85f747cf37a8 100644
@@ -25,9 +25,6 @@
 #include <asm/mach-ath79/ar71xx_regs.h>
 #include "common.h"
 
-#define AR71XX_BASE_FREQ	40000000
-#define AR724X_BASE_FREQ	40000000
-
 static struct clk *clks[ATH79_CLK_END];
 static struct clk_onecell_data clk_data = {
 	.clks = clks,
@@ -78,16 +75,12 @@ static struct clk * __init ath79_set_ff_clk(int type, const char *parent,
 	return clk;
 }
 
-static unsigned long __init ath79_setup_ref_clk(unsigned long rate)
+static unsigned long __init ath79_get_ref_rate(void)
 {
-	struct clk *clk = clks[ATH79_CLK_REF];
-
-	if (clk)
-		rate = clk_get_rate(clk);
-	else
-		clk = ath79_set_clk(ATH79_CLK_REF, rate);
+	if (!clks[ATH79_CLK_REF])
+		panic("ath79: no reference clock");
 
-	return rate;
+	return clk_get_rate(clks[ATH79_CLK_REF]);
 }
 
 static void __init ar71xx_clocks_init(void __iomem *pll_base)
@@ -100,7 +93,7 @@ static void __init ar71xx_clocks_init(void __iomem *pll_base)
 	u32 freq;
 	u32 div;
 
-	ref_rate = ath79_setup_ref_clk(AR71XX_BASE_FREQ);
+	ref_rate = ath79_get_ref_rate();
 
 	pll = __raw_readl(pll_base + AR71XX_PLL_REG_CPU_CONFIG);
 
@@ -126,7 +119,7 @@ static void __init ar724x_clocks_init(void __iomem *pll_base)
 	u32 mult, div, ddr_div, ahb_div;
 	u32 pll;
 
-	ath79_setup_ref_clk(AR71XX_BASE_FREQ);
+	ath79_get_ref_rate();
 
 	pll = __raw_readl(pll_base + AR724X_PLL_REG_CPU_CONFIG);
 
@@ -143,7 +136,6 @@ static void __init ar724x_clocks_init(void __iomem *pll_base)
 
 static void __init ar933x_clocks_init(void __iomem *pll_base)
 {
-	unsigned long ref_rate;
 	u32 clock_ctrl;
 	u32 ref_div;
 	u32 ninit_mul;
@@ -152,15 +144,8 @@ static void __init ar933x_clocks_init(void __iomem *pll_base)
 	u32 cpu_div;
 	u32 ddr_div;
 	u32 ahb_div;
-	u32 t;
 
-	t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
-	if (t & AR933X_BOOTSTRAP_REF_CLK_40)
-		ref_rate = (40 * 1000 * 1000);
-	else
-		ref_rate = (25 * 1000 * 1000);
-
-	ath79_setup_ref_clk(ref_rate);
+	ath79_get_ref_rate();
 
 	clock_ctrl = __raw_readl(pll_base + AR933X_PLL_CLOCK_CTRL_REG);
 	if (clock_ctrl & AR933X_PLL_CLOCK_CTRL_BYPASS) {
@@ -237,18 +222,11 @@ static void __init ar934x_clocks_init(void __iomem *pll_base)
 	unsigned long ahb_rate;
 	u32 pll, out_div, ref_div, nint, nfrac, frac, clk_ctrl, postdiv;
 	u32 cpu_pll, ddr_pll;
-	u32 bootstrap;
 	void __iomem *dpll_base;
 
 	dpll_base = ioremap(AR934X_SRIF_BASE, AR934X_SRIF_SIZE);
 
-	bootstrap = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP);
-	if (bootstrap & AR934X_BOOTSTRAP_REF_CLK_40)
-		ref_rate = 40 * 1000 * 1000;
-	else
-		ref_rate = 25 * 1000 * 1000;
-
-	ref_rate = ath79_setup_ref_clk(ref_rate);
+	ref_rate = ath79_get_ref_rate();
 
 	pll = __raw_readl(dpll_base + AR934X_SRIF_CPU_DPLL2_REG);
 	if (pll & AR934X_SRIF_DPLL2_LOCAL_PLL) {
@@ -355,15 +333,8 @@ static void __init qca953x_clocks_init(void __iomem *pll_base)
 	unsigned long ahb_rate;
 	u32 pll, out_div, ref_div, nint, frac, clk_ctrl, postdiv;
 	u32 cpu_pll, ddr_pll;
-	u32 bootstrap;
-
-	bootstrap = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
-	if (bootstrap &	QCA953X_BOOTSTRAP_REF_CLK_40)
-		ref_rate = 40 * 1000 * 1000;
-	else
-		ref_rate = 25 * 1000 * 1000;
 
-	ref_rate = ath79_setup_ref_clk(ref_rate);
+	ref_rate = ath79_get_ref_rate();
 
 	pll = __raw_readl(pll_base + QCA953X_PLL_CPU_CONFIG_REG);
 	out_div = (pll >> QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT) &
@@ -438,15 +409,8 @@ static void __init qca955x_clocks_init(void __iomem *pll_base)
 	unsigned long ahb_rate;
 	u32 pll, out_div, ref_div, nint, frac, clk_ctrl, postdiv;
 	u32 cpu_pll, ddr_pll;
-	u32 bootstrap;
 
-	bootstrap = ath79_reset_rr(QCA955X_RESET_REG_BOOTSTRAP);
-	if (bootstrap &	QCA955X_BOOTSTRAP_REF_CLK_40)
-		ref_rate = 40 * 1000 * 1000;
-	else
-		ref_rate = 25 * 1000 * 1000;
-
-	ref_rate = ath79_setup_ref_clk(ref_rate);
+	ref_rate = ath79_get_ref_rate();
 
 	pll = __raw_readl(pll_base + QCA955X_PLL_CPU_CONFIG_REG);
 	out_div = (pll >> QCA955X_PLL_CPU_CONFIG_OUTDIV_SHIFT) &
@@ -521,15 +485,8 @@ static void __init qca956x_clocks_init(void __iomem *pll_base)
 	unsigned long ahb_rate;
 	u32 pll, out_div, ref_div, nint, hfrac, lfrac, clk_ctrl, postdiv;
 	u32 cpu_pll, ddr_pll;
-	u32 bootstrap;
-
-	bootstrap = ath79_reset_rr(QCA956X_RESET_REG_BOOTSTRAP);
-	if (bootstrap &	QCA956X_BOOTSTRAP_REF_CLK_40)
-		ref_rate = 40 * 1000 * 1000;
-	else
-		ref_rate = 25 * 1000 * 1000;
 
-	ref_rate = ath79_setup_ref_clk(ref_rate);
+	ref_rate = ath79_get_ref_rate();
 
 	pll = __raw_readl(pll_base + QCA956X_PLL_CPU_CONFIG_REG);
 	out_div = (pll >> QCA956X_PLL_CPU_CONFIG_OUTDIV_SHIFT) &
@@ -610,7 +567,13 @@ static void __init ath79_clocks_init_dt(struct device_node *np)
 	struct clk *ref_clk;
 	void __iomem *pll_base;
 
+	/*
+	 * The board's crystal. Without a rate in the device tree, the arch
+	 * code registers it from the bootstrap pins.
+	 */
 	ref_clk = of_clk_get(np, 0);
+	if (IS_ERR(ref_clk))
+		ref_clk = clk_get_sys(NULL, "ref");
 	if (!IS_ERR(ref_clk))
 		clks[ATH79_CLK_REF] = ref_clk;
 
arch/mips/ath79/setup.c +87 -0

105 lines not on this page · raw message

Signature · 1 line
2.56.0
#3 lore raw

Re: [PATCH v2 2/6] MIPS: ath79: move the bootstrap reference clock to setup

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] MIPS: ath79: missing OF clock provider on ref_np in ath79_setup_ref_clk() --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] MIPS: ath79: missing OF clock provider on ref_np in ath79_setup_ref_clk()
--

commit ba6521274f3bdc958b3f63de9327877ef55638bc
Author: Rosen Penev <[email protected]>

MIPS: ath79: move the bootstrap reference clock to setup

This commit moves the bootstrap reference clock detection to plat_time_init(), registering a fixed-rate clock when the device tree omits clock-frequency and warning on mismatches with the bootstrap pins.

Quoted 4 lines
arch/mips/ath79/setup.c +0 -0
index d9e1cc77ad04d..dff0fbe07b047 100644

[ ... ]

Quoted 22 lines
arch/mips/ath79/setup.c +22 -0
+static void __init ath79_setup_ref_clk(void)
+{
+	struct device_node *np, *ref_np;
+	unsigned long rate, strap_rate;
+	struct clk *clk;
+	bool strapped;
+	u32 dt_rate;
+
+	strap_rate = ath79_bootstrap_ref_rate(&strapped);
+
+	np = of_find_matching_node(NULL, ath79_pll_ids);
+	ref_np = np ? of_parse_phandle(np, "clocks", 0) : NULL;
+	of_node_put(np);
+
+	if (ref_np && !of_property_read_u32(ref_np, "clock-frequency", &dt_rate)) {
+		of_node_put(ref_np);
+		rate = dt_rate;
+		if (strapped && rate != strap_rate)
+			pr_warn("ath79: reference clock is %lu Hz in the device tree, but the bootstrap pins select %lu Hz\n",
+				rate, strap_rate);
+		return;
+	}

arch/mips/ath79/setup.c void __init plat_mem_setup(void) · line 322

Quoted 10 lines
arch/mips/ath79/setup.c +10 -0
+	of_node_put(ref_np);
+
+	clk = clk_register_fixed_rate(NULL, "ref", NULL, 0, strap_rate);
+	if (IS_ERR(clk)) {
+		pr_err("ath79: failed to register the reference clock\n");
+		return;
+	}
+
+	clk_register_clkdev(clk, "ref", NULL);
+}

[Severity: Medium]
When ref_np exists in the device tree without a clock-frequency property, does skipping of_clk_add_provider() for ref_np break DT consumers that reference <&ref> by phandle?

In of_clk_init(), _of_fixed_clk_setup() fails when clock-frequency is absent, leaving ref_np without an OF clock provider. ath79_clocks_init_dt() works around this by falling back to clk_get_sys(NULL, "ref"), but arch/mips/boot/dts/qca/ar9331.dtsi also wires the UART to <&ref>:

arch/mips/boot/dts/qca/ar9331.dtsi:

	uart: serial@18020000 {
		compatible = "qca,ar9330-uart";
		...
		clocks = <&ref>;
		clock-names = "uart";

When ar933x_uart_probe() calls devm_clk_get(&pdev->dev, "uart"), of_clk_get_hw() sees that ref_np is an available DT node with no registered OF provider and returns -EPROBE_DEFER without falling back to clkdev, causing the UART probe to fail permanently.

Registering clk as an OF clock provider on ref_np via of_clk_add_provider() when ref_np is non-NULL would allow phandle lookups to succeed.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#4 lore raw

PATCH v2 3/6 dt-bindings: clock: ath79: add the UART1 clock

In reply to Rosen Penev

AR934x has a second, high speed UART that is compatible with the qca,ar9330-uart one and can run from a 100 MHz clock instead of the reference clock. Add an ID for its clock.

---
 include/dt-bindings/clock/ath79-clk.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/dt-bindings/clock/ath79-clk.h +2 -1
index eec8f399b9e6..f8a98e4d206d 100644
@@ -11,7 +11,8 @@
 #define ATH79_CLK_AHB		2
 #define ATH79_CLK_REF		3
 #define ATH79_CLK_MDIO		4
+#define ATH79_CLK_UART1		5
 
-#define ATH79_CLK_END		5
+#define ATH79_CLK_END		6
 
 #endif /* __DT_BINDINGS_ATH79_CLK_H */
Signature · 1 line
2.56.0
#5 lore raw

Re: [PATCH v2 3/6] dt-bindings: clock: ath79: add the UART1 clock

Quoted 14 lines · Rosen Penev

AR934x has a second, high speed UART that is compatible with the qca,ar9330-uart one and can run from a 100 MHz clock instead of the reference clock. Add an ID for its clock.

---
 include/dt-bindings/clock/ath79-clk.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/dt-bindings/clock/ath79-clk.h +0 -0
index eec8f399b9e6..f8a98e4d206d 100644

include/dt-bindings/clock/ath79-clk.h line 16

Quoted 7 lines
include/dt-bindings/clock/ath79-clk.h +2 -1
@@ -11,7 +11,8 @@
 #define ATH79_CLK_AHB		2
 #define ATH79_CLK_REF		3
 #define ATH79_CLK_MDIO		4
+#define ATH79_CLK_UART1		5
 
-#define ATH79_CLK_END		5
+#define ATH79_CLK_END		6

You cannot change that, that's fixed ABI.

Best regards,
Krzysztof

#6 lore raw

Re: [PATCH v2 3/6] dt-bindings: clock: ath79: add the UART1 clock

Quoted 21 lines · Krzysztof Kozlowski
Quoted 19 lines · Rosen Penev

AR934x has a second, high speed UART that is compatible with the qca,ar9330-uart one and can run from a 100 MHz clock instead of the reference clock. Add an ID for its clock.

---
 include/dt-bindings/clock/ath79-clk.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/dt-bindings/clock/ath79-clk.h +1 -0
index eec8f399b9e6..f8a98e4d206d 100644
@@ -11,7 +11,8 @@
 #define ATH79_CLK_AHB                2
 #define ATH79_CLK_REF                3
 #define ATH79_CLK_MDIO               4
+#define ATH79_CLK_UART1              5
 
Quoted 4 lines

include/dt-bindings/clock/ath79-clk.h line 16

Quoted 2 lines
include/dt-bindings/clock/ath79-clk.h +1 -1
-#define ATH79_CLK_END                5
+#define ATH79_CLK_END                6

You cannot change that, that's fixed ABI.

There are commits like 2f4788cca881 that remove CLK_END. I agree with those commits. This define should not be here.

Quoted 4 lines

Best regards,
Krzysztof

#7 lore raw

PATCH v2 4/6 dt-bindings: clock: ath79: add the PCIe PLL clock

In reply to Rosen Penev

Add an ID for the PCIe PLL, which AR724x, AR934x, QCA953x, QCA955x and QCA956x have, so the PCIe host controller nodes can reference it.

---
 include/dt-bindings/clock/ath79-clk.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/dt-bindings/clock/ath79-clk.h +2 -1
index f8a98e4d206d..e4956afd151d 100644
@@ -12,7 +12,8 @@
 #define ATH79_CLK_REF		3
 #define ATH79_CLK_MDIO		4
 #define ATH79_CLK_UART1		5
+#define ATH79_CLK_PCIE		6
 
-#define ATH79_CLK_END		6
+#define ATH79_CLK_END		7
 
 #endif /* __DT_BINDINGS_ATH79_CLK_H */
Signature · 1 line
2.56.0
#8 lore raw

Re: [PATCH v2 4/6] dt-bindings: clock: ath79: add the PCIe PLL clock

Quoted 13 lines · Rosen Penev

Add an ID for the PCIe PLL, which AR724x, AR934x, QCA953x, QCA955x and QCA956x have, so the PCIe host controller nodes can reference it.

---
 include/dt-bindings/clock/ath79-clk.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/dt-bindings/clock/ath79-clk.h +0 -0
index f8a98e4d206d..e4956afd151d 100644

include/dt-bindings/clock/ath79-clk.h line 15

Quoted 4 lines
include/dt-bindings/clock/ath79-clk.h +1 -0
@@ -12,7 +12,8 @@
 #define ATH79_CLK_REF		3
 #define ATH79_CLK_MDIO		4
 #define ATH79_CLK_UART1		5
+#define ATH79_CLK_PCIE		6

Splitting one define per patch is ridicilous. This is just ONE commit.

include/dt-bindings/clock/ath79-clk.h line 17

Quoted 3 lines
include/dt-bindings/clock/ath79-clk.h +1 -1
-#define ATH79_CLK_END		6
+#define ATH79_CLK_END		7

You cannot keep changing the ABI.

Best regards,
Krzysztof

#9 lore raw

PATCH v2 5/6 clk: add a driver for the Atheros/Qualcomm ath79 PLL controller

In reply to Rosen Penev

The ath79 clocks are set up by arch/mips/ath79/clock.c, a CLK_OF_DECLARE driver that registers every clock before the driver core is up. Add a replacement in drivers/clk.

Only the reference and CPU clocks are registered early, with CLK_OF_DECLARE_DRIVER(), as the MIPS timer needs the CPU rate from plat_time_init(). The other clocks come from a platform driver for the same node, like the MT7621 clocks do. The early provider returns -EPROBE_DEFER for them until the platform driver fills them in.

The bootloader sets up the PLLs, and the CPU, DDR and AHB clocks are read back from the registers as fixed rates, as before. Compared to the arch code:

- Each SoC is described by match data: a function that reads the rates, and for AR934x and later the bits of CPU_DDR_CLOCK_CONTROL that select a PLL for each clock. The bypass bits and post dividers of that register are the same on every SoC, so one function handles them. AR934x, QCA953x and QCA955x share the fractional PLL calculation, done with 64-bit intermediates.
- The AR724x and AR933x clocks were fixed factors of a parent named "ref". They are fixed rates now, like the others, all with the reference clock's clk_hw as the parent.
- Invalid register contents, a reference clock that is missing and registration failures are reported instead of causing a panic or a division by zero.
- The AR934x SRIF block, which holds the CPU and DDR DPLLs, is still mapped from its fixed address. It lies inside the register space of the wireless MAC, which ath9k claims, so it can't be a reg entry of the PLL node. The driver only reads it and doesn't claim it.
- The clocks are no longer registered with clkdev. No driver looks them up by name.
- AR934x gets its UART1 clock: 100 MHz when UART1_CLK_SEL is set in SWITCH_CLOCK_CONTROL, the reference clock otherwise and on the other SoCs. This is based on an OpenWrt patch by Daniel Golle.
- The PCIe PLL is a clock, so that a PCIe host driver can use the clk API instead of poking the PLL block through the arch code. Prepare powers the PLL up and takes it out of bypass, waiting for UPDATING to clear after each step. Every write to the register freezes the high speed clocks for about 60 us (AR7242 datasheet, 4.4.4), so a PLL the bootloader already started is left alone. AR724x holds the PLL in reset instead of powering it down, and the register is at 0x10 on AR724x, AR934x and QCA953x, 0x0c on QCA955x and 0x14 on QCA956x. The clock is CLK_IGNORE_UNUSED, so a PLL that no driver claims stays as the bootloader left it.

The rates match the arch code for every SoC, checked in userspace against it with random register values. They differ only where the arch code overflowed 32 bits with register values that no real setup uses.

COMMON_CLK_ATH79 defaults to ATH79, and arch/mips/ath79/clock.c is no longer built when it is enabled.

---
 MAINTAINERS              |   8 +
 arch/mips/ath79/Makefile |   5 +-
 drivers/clk/Kconfig      |  12 +
 drivers/clk/Makefile     |   1 +
 drivers/clk/clk-ath79.c  | 778 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 803 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clk/clk-ath79.c
MAINTAINERS +8 -0
index c57be10c8729..98f42425b37d 100644
@@ -4341,6 +4341,14 @@ S:	Supported
 F:	Documentation/devicetree/bindings/rtc/andestech,atcrtc100.yaml
 F:	drivers/rtc/rtc-atcrtc100.c
 
+ATHEROS 71XX/9XXX CLOCK DRIVER
+M:	Alban Bedel <[email protected]>
+M:	Antony Pavlov <[email protected]>
+S:	Maintained
+F:	Documentation/devicetree/bindings/clock/qca,ath79-pll.yaml
+F:	drivers/clk/clk-ath79.c
+F:	include/dt-bindings/clock/ath79-clk.h
+
 ATHEROS 71XX/9XXX GPIO DRIVER
 M:	Alban Bedel <[email protected]>
 S:	Maintained
arch/mips/ath79/Makefile +4 -1
index 0fb3aaf42149..b78ffdc9b389 100644
@@ -6,6 +6,9 @@
 # Copyright (C) 2008 Imre Kaloz <[email protected]>
 #
 
-obj-y	:= prom.o setup.o common.o clock.o
+obj-y	:= prom.o setup.o common.o
+
+# replaced by the clk-ath79 driver
+obj-$(if $(CONFIG_COMMON_CLK_ATH79),,y) += clock.o
 
 obj-$(CONFIG_EARLY_PRINTK)		+= early_printk.o
drivers/clk/Kconfig +12 -0
index 37a8e35d4178..bd5f77cddfe0 100644
@@ -66,6 +66,18 @@ config COMMON_CLK_APPLE_NCO
 	  found on Apple SoCs such as t8103 (M1). The blocks are typically
 	  generators of audio clocks.
 
+config COMMON_CLK_ATH79
+	bool "Clock driver for Atheros/Qualcomm ath79 SoCs" if COMPILE_TEST
+	depends on ATH79 || COMPILE_TEST
+	depends on OF
+	default ATH79
+	help
+	  Support for the PLL controller of the Atheros/Qualcomm ath79
+	  family of MIPS SoCs: AR71xx, AR724x, AR913x, AR933x, AR934x,
+	  QCA953x, QCA955x and QCA956x. It provides the CPU, DDR, AHB,
+	  MDIO, UART1 and PCIe clocks, derived from the board's reference
+	  clock.
+
 config COMMON_CLK_MAX77686
 	tristate "Clock driver for Maxim 77620/77686/77802 MFD"
 	depends on MFD_MAX77686 || MFD_MAX77620 || COMPILE_TEST
drivers/clk/Makefile +1 -0
index 52d138d4ffc8..589d2ef9dc89 100644
@@ -58,6 +58,7 @@ endif
 # please keep this section sorted lexicographically by file path name
 obj-$(CONFIG_COMMON_CLK_APPLE_NCO)  	+= clk-apple-nco.o
 obj-$(CONFIG_MACH_ASM9260)		+= clk-asm9260.o
+obj-$(CONFIG_COMMON_CLK_ATH79)		+= clk-ath79.o
 obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN)	+= clk-axi-clkgen.o
 obj-$(CONFIG_ARCH_AXXIA)		+= clk-axm5516.o
 obj-$(CONFIG_COMMON_CLK_BD718XX)	+= clk-bd718x7.o
drivers/clk/clk-ath79.c new file +778 -0

778 lines not on this page · raw message

Signature · 1 line
2.56.0
#10 lore raw

Re: [PATCH v2 5/6] clk: add a driver for the Atheros/Qualcomm ath79 PLL controller

Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] clk: ath79: fw_devlink blocks ath79_clk_probe() when ref lacks clock-frequency - [Medium] clk…

Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [Medium] clk: ath79: fw_devlink blocks ath79_clk_probe() when ref lacks clock-frequency
- [Medium] clk: ath79: missing UPDATING wait in ath79_pcie_pll_unprepare()
--

commit dd79c08de0fc1914f23e0beb52d8e93809a55692
Author: Rosen Penev <[email protected]>

clk: add a driver for the Atheros/Qualcomm ath79 PLL controller

This commit adds a common clock driver for the Atheros/Qualcomm ath79 PLL controller, registering the reference and CPU clocks early via CLK_OF_DECLARE_DRIVER() and the remaining clocks from a platform driver.

Quoted 6 lines
drivers/clk/clk-ath79.c new file +0 -0
new file mode 100644
index 0000000000000..3ddbd020afb12
@@ -0,0 +1,778 @@

[ ... ]

Quoted 22 lines
drivers/clk/clk-ath79.c new file +22 -0
+static int ath79_pcie_pll_prepare(struct clk_hw *hw)
+{
+	struct ath79_pcie_pll *pll = to_ath79_pcie_pll(hw);
+	u32 t;
+	int ret;
+
+	/*
+	 * Every write freezes the high speed clocks for about 60 us, so
+	 * leave a PLL that the bootloader already started alone.
+	 */
+	if (ath79_pcie_pll_is_prepared(hw))
+		return 0;
+
+	t = readl(pll->reg) & ~pll->pwd;
+	writel(t, pll->reg);
+	ret = ath79_pcie_pll_wait(pll);
+	if (ret)
+		return ret;
+
+	writel(t & ~pll->bypass, pll->reg);
+	return ath79_pcie_pll_wait(pll);
+}

drivers/clk/clk-ath79.c line 453

Quoted 10 lines
drivers/clk/clk-ath79.c new file +10 -0
+
+static void ath79_pcie_pll_unprepare(struct clk_hw *hw)
+{
+	struct ath79_pcie_pll *pll = to_ath79_pcie_pll(hw);
+	u32 t;
+
+	t = readl(pll->reg) | pll->bypass;
+	writel(t, pll->reg);
+	writel(t | pll->pwd, pll->reg);
+}

[Severity: Medium]
Should ath79_pcie_pll_unprepare() call ath79_pcie_pll_wait(pll) after each write to pll->reg, like ath79_pcie_pll_prepare() does? Without waiting for pll->updating to clear, the second write is issued while the ~60 us update from setting pll->bypass is still in progress, and the function returns before the PLL finishes powering down.

[ ... ]

Quoted 18 lines
drivers/clk/clk-ath79.c new file +18 -0
+static void __init ath79_clk_early_init(struct device_node *np)
+{
+	const struct ath79_clk_soc_data *soc;
+	unsigned long rates[ATH79_OUT_NUM];
+	struct ath79_clk_regs regs = {};
+	struct clk_hw *ref, *cpu;
+	struct clk *ref_clk;
+	int ret, i;
+
+	soc = of_match_node(ath79_clk_of_match, np)->data;
+
+	/*
+	 * The board's crystal. Old device trees leave its rate out, and the
+	 * arch code then registers it from the bootstrap pins as "ref".
+	 */
+	ref_clk = of_clk_get_by_name(np, "ref");
+	if (IS_ERR(ref_clk))
+		ref_clk = clk_get_sys(NULL, "ref");

[ ... ]

drivers/clk/clk-ath79.c line 695

Quoted 2 lines
drivers/clk/clk-ath79.c new file +2 -0
+static int ath79_clk_probe(struct platform_device *pdev)
+{

[Severity: Medium]
Does fw_devlink permanently block ath79_clk_probe() with -EPROBE_DEFER on device trees where the "ref" fixed-clock node omits clock-frequency?

When the "ref" node has no clock-frequency property, _of_fixed_clk_setup() fails with -EIO before of_clk_add_hw_provider() can mark its fwnode initialized, while of_clk_init() still sets OF_POPULATED on the node so no platform device is created for it. Because the PLL node has clocks = <&ref>, fw_devlink creates a fwnode_link to the uninitialized "ref" node, and device_links_check_suppliers() rejects probing ath79_clk_driver with -EPROBE_DEFER, leaving the DDR, AHB, MDIO, UART1 and PCIe clocks permanently at ERR_PTR(-EPROBE_DEFER).

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
#11 lore raw

PATCH v2 6/6 MIPS: ath79: remove the old clock code

In reply to Rosen Penev

The clk-ath79 driver in drivers/clk has replaced arch/mips/ath79/clock.c, which is no longer built. Remove it.

---
 arch/mips/ath79/Makefile |   3 -
 arch/mips/ath79/clock.c  | 626 ---------------------------------------
 2 files changed, 629 deletions(-)
 delete mode 100644 arch/mips/ath79/clock.c
arch/mips/ath79/Makefile +0 -3
index b78ffdc9b389..5df55b5e1c15 100644
@@ -8,7 +8,4 @@
 
 obj-y	:= prom.o setup.o common.o
 
-# replaced by the clk-ath79 driver
-obj-$(if $(CONFIG_COMMON_CLK_ATH79),,y) += clock.o
-
 obj-$(CONFIG_EARLY_PRINTK)		+= early_printk.o
arch/mips/ath79/clock.c deleted +0 -626

626 lines not on this page · raw message

Signature · 1 line
2.56.0
#12 lore raw
In reply to Rosen Penev

Hi Rosen,

Quoted 41 lines · Rosen Penev

The clocks of the Atheros/Qualcomm ath79 MIPS SoCs are set up by arch/mips/ath79/clock.c, a CLK_OF_DECLARE driver that registers every clock before the driver core is up. This series replaces it with a new driver in drivers/clk.

Only the reference and CPU clocks are registered early, with CLK_OF_DECLARE_DRIVER(), because the MIPS timer needs the CPU rate from plat_time_init(). A platform driver bound to the same node registers the DDR, AHB, MDIO, UART1 and PCIe clocks. Until it does, the early provider returns -EPROBE_DEFER for them. clk-mt7621 uses the same scheme.

Patches 1 and 2 move the two remaining non-clock duties out of the arch clock code, so that it only uses its own registers and the clk API: the QCA956x timer interrupt workaround, and the reference clock that is read from the bootstrap pins when the device tree has no rate. Patches 3 and 4 add the UART1 and PCIe PLL clock IDs. Patch 5 adds the new driver, and patch 6 removes the old code.

Tested on a TP-Link Archer C7 v2 (QCA9558) with an LLVM build. The CPU, DDR, AHB and reference rates (960, 800, 266.67 and 40 MHz) match those of the old code. The serial console, both GMACs, the PCIe PLL with a QCA9880 behind it, and the WMAC all work, and no devices are left deferred. The other SoCs are not tested on hardware. For each SoC the rate calculation was compiled in userspace together with the old code and fed 2 million random register sets. The results are identical, except where the old code overflowed 32 bits with register values that no real setup uses.

Changes in v2:
- Post the new driver as one patch, instead of moving arch/mips/ath79/clock.c to drivers/clk and cleaning it up over six patches (review feedback).
- Register only the reference and CPU clocks with CLK_OF_DECLARE, and the others from a platform driver (review feedback).
- Describe the SoCs with match data, and read the CPU, DDR and AHB selection of AR934x and later with one function.
- Keep mapping the AR934x SRIF block from its fixed address. It lies inside the wireless MAC registers, which ath9k claims, so it can't be a reg entry of the PLL node.
- Drop the clkdev registrations, which have no users.

Quoted 4 lines

Claude Code (Claude Opus 5.5) was used while preparing this series. It wrote most of the new driver from the old one, together with the userspace test of the rate calculation. I reviewed and tested every change and take responsibility for it.

40 minutes elapsed from when I asked for changes to when a fully formed new driver was posted with major changes. Your cover letter says this v2 was tested on real hardware, however I am honestly a bit skeptical given the short time frame. On top of that, that's not enough time to also go through what all Claude did for you. Please slow down!!

I'm going to pass on reviewing this version. I want you to take some time to test this on real hardware, and understand the code. If after that you truly have no additional changes, then I'll reconsider reviewing this version.

Also, if you want to help, then consider helping with reviews on patches from other people, in particular with the large series for the new SoC vendors. It's a lot of work reviewing the flood of patches from everyone. You can see the backlog for the clk core on the kernel.org patchwork server.

Brian

#13 lore raw
Quoted 50 lines · Brian Masney

Hi Rosen,

Quoted 41 lines · Rosen Penev

The clocks of the Atheros/Qualcomm ath79 MIPS SoCs are set up by arch/mips/ath79/clock.c, a CLK_OF_DECLARE driver that registers every clock before the driver core is up. This series replaces it with a new driver in drivers/clk.

Only the reference and CPU clocks are registered early, with CLK_OF_DECLARE_DRIVER(), because the MIPS timer needs the CPU rate from plat_time_init(). A platform driver bound to the same node registers the DDR, AHB, MDIO, UART1 and PCIe clocks. Until it does, the early provider returns -EPROBE_DEFER for them. clk-mt7621 uses the same scheme.

Patches 1 and 2 move the two remaining non-clock duties out of the arch clock code, so that it only uses its own registers and the clk API: the QCA956x timer interrupt workaround, and the reference clock that is read from the bootstrap pins when the device tree has no rate. Patches 3 and 4 add the UART1 and PCIe PLL clock IDs. Patch 5 adds the new driver, and patch 6 removes the old code.

Tested on a TP-Link Archer C7 v2 (QCA9558) with an LLVM build. The CPU, DDR, AHB and reference rates (960, 800, 266.67 and 40 MHz) match those of the old code. The serial console, both GMACs, the PCIe PLL with a QCA9880 behind it, and the WMAC all work, and no devices are left deferred. The other SoCs are not tested on hardware. For each SoC the rate calculation was compiled in userspace together with the old code and fed 2 million random register sets. The results are identical, except where the old code overflowed 32 bits with register values that no real setup uses.

Changes in v2:
- Post the new driver as one patch, instead of moving arch/mips/ath79/clock.c to drivers/clk and cleaning it up over six patches (review feedback).
- Register only the reference and CPU clocks with CLK_OF_DECLARE, and the others from a platform driver (review feedback).
- Describe the SoCs with match data, and read the CPU, DDR and AHB selection of AR934x and later with one function.
- Keep mapping the AR934x SRIF block from its fixed address. It lies inside the wireless MAC registers, which ath9k claims, so it can't be a reg entry of the PLL node.
- Drop the clkdev registrations, which have no users.

Quoted 4 lines

Claude Code (Claude Opus 5.5) was used while preparing this series. It wrote most of the new driver from the old one, together with the userspace test of the rate calculation. I reviewed and tested every change and take responsibility for it.

Quoted 5 lines

40 minutes elapsed from when I asked for changes to when a fully formed new driver was posted with major changes. Your cover letter says this v2 was tested on real hardware, however I am honestly a bit skeptical given the short time frame. On top of that, that's not enough time to also go through what all Claude did for you. Please slow down!!

This was tested with a linux-next kernel on an Archer C7 v2 hooked up through serial and two ethernet cables (LAN and WAN). There's no difference that I can see between the old and new driver.

That being said, I only have two pieces of hardware on which testing can be done. Both are rather new relatively speaking. Older version of this series is currently live on OpenWrt with seemingly no ill consequences.

Quoted 5 lines

I'm going to pass on reviewing this version. I want you to take some time to test this on real hardware, and understand the code. If after that you truly have no additional changes, then I'll reconsider reviewing this version.

Sashiko had two complaints. I'll fix those in v3.

Quoted 6 lines

Also, if you want to help, then consider helping with reviews on patches from other people, in particular with the large series for the new SoC vendors. It's a lot of work reviewing the flood of patches from everyone. You can see the backlog for the clk core on the kernel.org patchwork server.

I agree. It's quite unfortunate and have no solution to it.

Quoted 2 lines

Brian

#14 lore raw

Hi Rosen,

Quoted 54 lines · Rosen Penev
Quoted 47 lines · Brian Masney
Quoted 41 lines · Rosen Penev

The clocks of the Atheros/Qualcomm ath79 MIPS SoCs are set up by arch/mips/ath79/clock.c, a CLK_OF_DECLARE driver that registers every clock before the driver core is up. This series replaces it with a new driver in drivers/clk.

Only the reference and CPU clocks are registered early, with CLK_OF_DECLARE_DRIVER(), because the MIPS timer needs the CPU rate from plat_time_init(). A platform driver bound to the same node registers the DDR, AHB, MDIO, UART1 and PCIe clocks. Until it does, the early provider returns -EPROBE_DEFER for them. clk-mt7621 uses the same scheme.

Patches 1 and 2 move the two remaining non-clock duties out of the arch clock code, so that it only uses its own registers and the clk API: the QCA956x timer interrupt workaround, and the reference clock that is read from the bootstrap pins when the device tree has no rate. Patches 3 and 4 add the UART1 and PCIe PLL clock IDs. Patch 5 adds the new driver, and patch 6 removes the old code.

Tested on a TP-Link Archer C7 v2 (QCA9558) with an LLVM build. The CPU, DDR, AHB and reference rates (960, 800, 266.67 and 40 MHz) match those of the old code. The serial console, both GMACs, the PCIe PLL with a QCA9880 behind it, and the WMAC all work, and no devices are left deferred. The other SoCs are not tested on hardware. For each SoC the rate calculation was compiled in userspace together with the old code and fed 2 million random register sets. The results are identical, except where the old code overflowed 32 bits with register values that no real setup uses.

Changes in v2:
- Post the new driver as one patch, instead of moving arch/mips/ath79/clock.c to drivers/clk and cleaning it up over six patches (review feedback).
- Register only the reference and CPU clocks with CLK_OF_DECLARE, and the others from a platform driver (review feedback).
- Describe the SoCs with match data, and read the CPU, DDR and AHB selection of AR934x and later with one function.
- Keep mapping the AR934x SRIF block from its fixed address. It lies inside the wireless MAC registers, which ath9k claims, so it can't be a reg entry of the PLL node.
- Drop the clkdev registrations, which have no users.

Quoted 4 lines

Claude Code (Claude Opus 5.5) was used while preparing this series. It wrote most of the new driver from the old one, together with the userspace test of the rate calculation. I reviewed and tested every change and take responsibility for it.

Quoted 5 lines

40 minutes elapsed from when I asked for changes to when a fully formed new driver was posted with major changes. Your cover letter says this v2 was tested on real hardware, however I am honestly a bit skeptical given the short time frame. On top of that, that's not enough time to also go through what all Claude did for you. Please slow down!!

Quoted 3 lines

This was tested with a linux-next kernel on an Archer C7 v2 hooked up through serial and two ethernet cables (LAN and WAN). There's no difference that I can see between the old and new driver.

The clk_summary debugfs entries would be a good place to compare as well.

Quoted 12 lines

That being said, I only have two pieces of hardware on which testing can be done. Both are rather new relatively speaking. Older version of this series is currently live on OpenWrt with seemingly no ill consequences.

Quoted 5 lines

I'm going to pass on reviewing this version. I want you to take some time to test this on real hardware, and understand the code. If after that you truly have no additional changes, then I'll reconsider reviewing this version.

Sashiko had two complaints. I'll fix those in v3.

Quoted 1 line
Quoted 7 lines
Quoted 5 lines

Also, if you want to help, then consider helping with reviews on patches from other people, in particular with the large series for the new SoC vendors. It's a lot of work reviewing the flood of patches from everyone. You can see the backlog for the clk core on the kernel.org patchwork server.

I agree. It's quite unfortunate and have no solution to it.

Just some friendly advice: If you keep churning out AI code as quick as you can generate it, then your stuff will end up at the very bottom of the review queue. There's a long backlog of other changes that need to be reviewed.

I'm not saying that you need to go review patches, but that goes a really long way to building goodwill in the community. Maybe if you post a large series like this go help review 2 or 3 patch sets that's in the backlog from other people.

But seriously, the main ask from me is to please slow down before you post new patches. Provide some more details about how this was tested on real hardware.

Brian

#15 lore raw
Quoted 83 lines · Brian Masney

Hi Rosen,

Quoted 54 lines · Rosen Penev
Quoted 47 lines · Brian Masney
Quoted 41 lines · Rosen Penev

The clocks of the Atheros/Qualcomm ath79 MIPS SoCs are set up by arch/mips/ath79/clock.c, a CLK_OF_DECLARE driver that registers every clock before the driver core is up. This series replaces it with a new driver in drivers/clk.

Only the reference and CPU clocks are registered early, with CLK_OF_DECLARE_DRIVER(), because the MIPS timer needs the CPU rate from plat_time_init(). A platform driver bound to the same node registers the DDR, AHB, MDIO, UART1 and PCIe clocks. Until it does, the early provider returns -EPROBE_DEFER for them. clk-mt7621 uses the same scheme.

Patches 1 and 2 move the two remaining non-clock duties out of the arch clock code, so that it only uses its own registers and the clk API: the QCA956x timer interrupt workaround, and the reference clock that is read from the bootstrap pins when the device tree has no rate. Patches 3 and 4 add the UART1 and PCIe PLL clock IDs. Patch 5 adds the new driver, and patch 6 removes the old code.

Tested on a TP-Link Archer C7 v2 (QCA9558) with an LLVM build. The CPU, DDR, AHB and reference rates (960, 800, 266.67 and 40 MHz) match those of the old code. The serial console, both GMACs, the PCIe PLL with a QCA9880 behind it, and the WMAC all work, and no devices are left deferred. The other SoCs are not tested on hardware. For each SoC the rate calculation was compiled in userspace together with the old code and fed 2 million random register sets. The results are identical, except where the old code overflowed 32 bits with register values that no real setup uses.

Changes in v2:
- Post the new driver as one patch, instead of moving arch/mips/ath79/clock.c to drivers/clk and cleaning it up over six patches (review feedback).
- Register only the reference and CPU clocks with CLK_OF_DECLARE, and the others from a platform driver (review feedback).
- Describe the SoCs with match data, and read the CPU, DDR and AHB selection of AR934x and later with one function.
- Keep mapping the AR934x SRIF block from its fixed address. It lies inside the wireless MAC registers, which ath9k claims, so it can't be a reg entry of the PLL node.
- Drop the clkdev registrations, which have no users.

Quoted 4 lines

Claude Code (Claude Opus 5.5) was used while preparing this series. It wrote most of the new driver from the old one, together with the userspace test of the rate calculation. I reviewed and tested every change and take responsibility for it.

Quoted 5 lines

40 minutes elapsed from when I asked for changes to when a fully formed new driver was posted with major changes. Your cover letter says this v2 was tested on real hardware, however I am honestly a bit skeptical given the short time frame. On top of that, that's not enough time to also go through what all Claude did for you. Please slow down!!

Quoted 3 lines

This was tested with a linux-next kernel on an Archer C7 v2 hooked up through serial and two ethernet cables (LAN and WAN). There's no difference that I can see between the old and new driver.

The clk_summary debugfs entries would be a good place to compare as well.

Quoted 18 lines

That being said, I only have two pieces of hardware on which testing can be done. Both are rather new relatively speaking. Older version of this series is currently live on OpenWrt with seemingly no ill consequences.

Quoted 5 lines

I'm going to pass on reviewing this version. I want you to take some time to test this on real hardware, and understand the code. If after that you truly have no additional changes, then I'll reconsider reviewing this version.

Sashiko had two complaints. I'll fix those in v3.

Quoted 6 lines

Also, if you want to help, then consider helping with reviews on patches from other people, in particular with the large series for the new SoC vendors. It's a lot of work reviewing the flood of patches from everyone. You can see the backlog for the clk core on the kernel.org patchwork server.

Quoted 6 lines
Quoted 1 line

I agree. It's quite unfortunate and have no solution to it.

Just some friendly advice: If you keep churning out AI code as quick as you can generate it, then your stuff will end up at the very bottom of the review queue. There's a long backlog of other changes that need to be reviewed.

Sure. I'll wait a bit.

Quoted 9 lines

I'm not saying that you need to go review patches, but that goes a really long way to building goodwill in the community. Maybe if you post a large series like this go help review 2 or 3 patch sets that's in the backlog from other people.

But seriously, the main ask from me is to please slow down before you post new patches. Provide some more details about how this was tested on real hardware.

Sure.

Quoted 2 lines

Brian