Skip to contentSkip to conversation

net: dsa: rzn1_a5psw: add COMPILE_TEST

PATCH Superseded Rosen Penev 4 participants 9 messages Jul 7, 2025

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover net: dsa: rzn1_a5psw: add COMPILE_TEST

Allows the various bots to test compilation. Also threw in a small devm conversion for enabling clocks.

Rosen Penev (2):
net: dsa: rzn1_a5psw: add COMPILE_TEST
net: dsa: rzn1_a5psw: use devm to enable clocks

 drivers/net/dsa/Kconfig      |  2 +-
 drivers/net/dsa/rzn1_a5psw.c | 22 ++++------------------
 2 files changed, 5 insertions(+), 19 deletions(-)
Signature · 1 line
2.50.0
#1 lore raw

PATCH 1/2 net: dsa: rzn1_a5psw: add COMPILE_TEST

There's no architecture specific requirement for it to compile. Allows the bots to test compilation properly.

---
 drivers/net/dsa/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/Kconfig +1 -1
index bb9812b3b0e8..f872236d5af4 100644
@@ -92,7 +92,7 @@ source "drivers/net/dsa/realtek/Kconfig"
 
 config NET_DSA_RZN1_A5PSW
 	tristate "Renesas RZ/N1 A5PSW Ethernet switch support"
-	depends on OF && ARCH_RZN1
+	depends on OF && ARCH_RZN1 || COMPILE_TEST
 	select NET_DSA_TAG_RZN1_A5PSW
 	select PCS_RZN1_MIIC
 	help
Signature · 1 line
2.50.0
#7 lore raw

PATCH 2/2 net: dsa: rzn1_a5psw: use devm to enable clocks

In reply to Rosen Penev

The remove function has these in the wrong order. The switch should be unregistered last. Simpler to use devm so that the right thing is done.

---
 drivers/net/dsa/rzn1_a5psw.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)
drivers/net/dsa/rzn1_a5psw.c +4 -18
index df7466d4fe8f..1635255f58e4 100644
@@ -1227,35 +1227,27 @@ static int a5psw_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	a5psw->hclk = devm_clk_get(dev, "hclk");
+	a5psw->hclk = devm_clk_get_enabled(dev, "hclk");
 	if (IS_ERR(a5psw->hclk)) {
 		dev_err(dev, "failed get hclk clock\n");
 		ret = PTR_ERR(a5psw->hclk);
 		goto free_pcs;
 	}
 
-	a5psw->clk = devm_clk_get(dev, "clk");
+	a5psw->clk = devm_clk_get_enabled(dev, "clk");
 	if (IS_ERR(a5psw->clk)) {
 		dev_err(dev, "failed get clk_switch clock\n");
 		ret = PTR_ERR(a5psw->clk);
 		goto free_pcs;
 	}
 
-	ret = clk_prepare_enable(a5psw->clk);
-	if (ret)
-		goto free_pcs;
-
-	ret = clk_prepare_enable(a5psw->hclk);
-	if (ret)
-		goto clk_disable;
-
 	mdio = of_get_available_child_by_name(dev->of_node, "mdio");
 	if (mdio) {
 		ret = a5psw_probe_mdio(a5psw, mdio);
 		of_node_put(mdio);
 		if (ret) {
 			dev_err(dev, "Failed to register MDIO: %d\n", ret);
-			goto hclk_disable;
+			goto free_pcs;
 		}
 	}
 
@@ -1269,15 +1261,11 @@ static int a5psw_probe(struct platform_device *pdev)
 	ret = dsa_register_switch(ds);
 	if (ret) {
 		dev_err(dev, "Failed to register DSA switch: %d\n", ret);
-		goto hclk_disable;
+		goto free_pcs;
 	}
 
 	return 0;
 
-hclk_disable:
-	clk_disable_unprepare(a5psw->hclk);
-clk_disable:
-	clk_disable_unprepare(a5psw->clk);
 free_pcs:
 	a5psw_pcs_free(a5psw);
 
@@ -1293,8 +1281,6 @@ static void a5psw_remove(struct platform_device *pdev)
 
 	dsa_unregister_switch(&a5psw->ds);
 	a5psw_pcs_free(a5psw);
-	clk_disable_unprepare(a5psw->hclk);
-	clk_disable_unprepare(a5psw->clk);
 }
 
 static void a5psw_shutdown(struct platform_device *pdev)
Signature · 1 line
2.50.0
#4 lore raw
In reply to Rosen Penev
kernel test robot noticed the following build warnings:

Hi Rosen,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net/main]
[also build test WARNING on net-next/main linus/master horms-ipvs/master v6.16-rc5 next-20250704] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Rosen-Penev/net-dsa-rzn1_a5psw-add-COMPILE_TEST/20250707-130922
base:   net/main
patch link:    https://lore.kernel.org/r/20250707003918.21607-2-rosenp%40gmail.com
patch subject: [PATCH 1/2] net: dsa: rzn1_a5psw: add COMPILE_TEST
config: alpha-kismet-CONFIG_PCS_RZN1_MIIC-CONFIG_NET_DSA_RZN1_A5PSW-0-0 (https://download.01.org/0day-ci/archive/20250708/[email protected]/config)
reproduce: (https://download.01.org/0day-ci/archive/20250708/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

kismet warnings: (new ones prefixed by >>)

>> kismet: WARNING: unmet direct dependencies detected for PCS_RZN1_MIIC when selected by NET_DSA_RZN1_A5PSW

WARNING: unmet direct dependencies detected for PCS_RZN1_MIIC
Depends on [n]: NETDEVICES [=y] && OF [=n] && (ARCH_RZN1 [=n] || COMPILE_TEST [=y])
Selected by [y]:
- NET_DSA_RZN1_A5PSW [=y] && NETDEVICES [=y] && NET_DSA [=y] && (OF [=n] && ARCH_RZN1 [=n] || COMPILE_TEST [=y])

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#5 lore raw
Quoted 23 lines · kernel test robot

Hi Rosen,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net/main]
[also build test WARNING on net-next/main linus/master horms-ipvs/master v6.16-rc5 next-20250704] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Rosen-Penev/net-dsa-rzn1_a5psw-add-COMPILE_TEST/20250707-130922
base:   net/main
patch link:    https://lore.kernel.org/r/20250707003918.21607-2-rosenp%40gmail.com
patch subject: [PATCH 1/2] net: dsa: rzn1_a5psw: add COMPILE_TEST
config: alpha-kismet-CONFIG_PCS_RZN1_MIIC-CONFIG_NET_DSA_RZN1_A5PSW-0-0 (https://download.01.org/0day-ci/archive/20250708/[email protected]/config)
reproduce: (https://download.01.org/0day-ci/archive/20250708/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Quoted 6 lines

kismet warnings: (new ones prefixed by >>)

Quoted 1 line
Quoted 1 line

kismet: WARNING: unmet direct dependencies detected for PCS_RZN1_MIIC when selected by NET_DSA_RZN1_A5PSW

WARNING: unmet direct dependencies detected for PCS_RZN1_MIIC
Depends on [n]: NETDEVICES [=y] && OF [=n] && (ARCH_RZN1 [=n] || COMPILE_TEST [=y])
Selected by [y]:
- NET_DSA_RZN1_A5PSW [=y] && NETDEVICES [=y] && NET_DSA [=y] && (OF [=n] && ARCH_RZN1 [=n] || COMPILE_TEST [=y])

so it's probably better to do
depends on OF && (ARCH_RZN1 || COMPILE_TEST)
to match the pcs driver.

not sure it would fix this error though...

Quoted 4 lines

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

maintainer
#6 lore raw
Quoted 5 lines · Rosen Penev

so it's probably better to do
depends on OF && (ARCH_RZN1 || COMPILE_TEST)
to match the pcs driver.

not sure it would fix this error though...

Yes, you can't select something which has "depends on", unless you ensure that all its dependencies are satisfied.

If Kbuild has the same operator precedence as C, then "&&" has higher precedence than "||", and "OF && ARCH_RZN1 || COMPILE_TEST" actually evaluates to a different expression than "OF && (ARCH_RZN1 || COMPILE_TEST)". The former can be true when OF=n, while the latter can't. Thus, OF=n is an unsatisfied dependency for the PCS driver.