linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] net: dsa: rzn1_a5psw: add COMPILE_TEST
@ 2025-07-07  0:39 Rosen Penev
  2025-07-07  0:39 ` [PATCH 1/2] " Rosen Penev
  2025-07-07  0:39 ` [PATCH 2/2] net: dsa: rzn1_a5psw: use devm to enable clocks Rosen Penev
  0 siblings, 2 replies; 9+ messages in thread
From: Rosen Penev @ 2025-07-07  0:39 UTC (permalink / raw)
  To: netdev
  Cc: Andrew Lunn, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Clément Léger, open list,
	open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER

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(-)

-- 
2.50.0


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

* [PATCH 1/2] net: dsa: rzn1_a5psw: add COMPILE_TEST
  2025-07-07  0:39 [PATCH 0/2] net: dsa: rzn1_a5psw: add COMPILE_TEST Rosen Penev
@ 2025-07-07  0:39 ` Rosen Penev
  2025-07-07  5:55   ` Andrew Lunn
  2025-07-07 20:25   ` kernel test robot
  2025-07-07  0:39 ` [PATCH 2/2] net: dsa: rzn1_a5psw: use devm to enable clocks Rosen Penev
  1 sibling, 2 replies; 9+ messages in thread
From: Rosen Penev @ 2025-07-07  0:39 UTC (permalink / raw)
  To: netdev
  Cc: Andrew Lunn, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Clément Léger, open list,
	open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER

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

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/dsa/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
index bb9812b3b0e8..f872236d5af4 100644
--- a/drivers/net/dsa/Kconfig
+++ b/drivers/net/dsa/Kconfig
@@ -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
-- 
2.50.0


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

* [PATCH 2/2] net: dsa: rzn1_a5psw: use devm to enable clocks
  2025-07-07  0:39 [PATCH 0/2] net: dsa: rzn1_a5psw: add COMPILE_TEST Rosen Penev
  2025-07-07  0:39 ` [PATCH 1/2] " Rosen Penev
@ 2025-07-07  0:39 ` Rosen Penev
  2025-07-07  5:56   ` Andrew Lunn
  1 sibling, 1 reply; 9+ messages in thread
From: Rosen Penev @ 2025-07-07  0:39 UTC (permalink / raw)
  To: netdev
  Cc: Andrew Lunn, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Clément Léger, open list,
	open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER

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.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/dsa/rzn1_a5psw.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index df7466d4fe8f..1635255f58e4 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -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)
-- 
2.50.0


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

* Re: [PATCH 1/2] net: dsa: rzn1_a5psw: add COMPILE_TEST
  2025-07-07  0:39 ` [PATCH 1/2] " Rosen Penev
@ 2025-07-07  5:55   ` Andrew Lunn
  2025-07-07  6:01     ` Andrew Lunn
  2025-07-07 20:25   ` kernel test robot
  1 sibling, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2025-07-07  5:55 UTC (permalink / raw)
  To: Rosen Penev
  Cc: netdev, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Clément Léger, open list,
	open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER

On Sun, Jul 06, 2025 at 05:39:17PM -0700, Rosen Penev wrote:
> There's no architecture specific requirement for it to compile. Allows
> the bots to test compilation properly.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>


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

* Re: [PATCH 2/2] net: dsa: rzn1_a5psw: use devm to enable clocks
  2025-07-07  0:39 ` [PATCH 2/2] net: dsa: rzn1_a5psw: use devm to enable clocks Rosen Penev
@ 2025-07-07  5:56   ` Andrew Lunn
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2025-07-07  5:56 UTC (permalink / raw)
  To: Rosen Penev
  Cc: netdev, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Clément Léger, open list,
	open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER

On Sun, Jul 06, 2025 at 05:39:18PM -0700, Rosen Penev wrote:
> 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.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH 1/2] net: dsa: rzn1_a5psw: add COMPILE_TEST
  2025-07-07  5:55   ` Andrew Lunn
@ 2025-07-07  6:01     ` Andrew Lunn
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2025-07-07  6:01 UTC (permalink / raw)
  To: Rosen Penev
  Cc: netdev, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Clément Léger, open list,
	open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER

On Mon, Jul 07, 2025 at 07:55:21AM +0200, Andrew Lunn wrote:
> On Sun, Jul 06, 2025 at 05:39:17PM -0700, Rosen Penev wrote:
> > There's no architecture specific requirement for it to compile. Allows
> > the bots to test compilation properly.
> > 
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>

Lets try that again...

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH 1/2] net: dsa: rzn1_a5psw: add COMPILE_TEST
  2025-07-07  0:39 ` [PATCH 1/2] " Rosen Penev
  2025-07-07  5:55   ` Andrew Lunn
@ 2025-07-07 20:25   ` kernel test robot
  2025-07-07 20:47     ` Rosen Penev
  1 sibling, 1 reply; 9+ messages in thread
From: kernel test robot @ 2025-07-07 20:25 UTC (permalink / raw)
  To: Rosen Penev, netdev
  Cc: Paul Gazzillo, Necip Fazil Yildiran, oe-kbuild-all, Andrew Lunn,
	Vladimir Oltean, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Clément Léger, linux-kernel

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/202507080426.3RX5BOHi-lkp@intel.com/config)
reproduce: (https://download.01.org/0day-ci/archive/20250708/202507080426.3RX5BOHi-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507080426.3RX5BOHi-lkp@intel.com/

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])

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

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

* Re: [PATCH 1/2] net: dsa: rzn1_a5psw: add COMPILE_TEST
  2025-07-07 20:25   ` kernel test robot
@ 2025-07-07 20:47     ` Rosen Penev
  2025-07-07 21:33       ` Vladimir Oltean
  0 siblings, 1 reply; 9+ messages in thread
From: Rosen Penev @ 2025-07-07 20:47 UTC (permalink / raw)
  To: kernel test robot
  Cc: netdev, Paul Gazzillo, Necip Fazil Yildiran, oe-kbuild-all,
	Andrew Lunn, Vladimir Oltean, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Clément Léger, linux-kernel

On Mon, Jul 7, 2025 at 1:25 PM kernel test robot <lkp@intel.com> wrote:
>
> 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/202507080426.3RX5BOHi-lkp@intel.com/config)
> reproduce: (https://download.01.org/0day-ci/archive/20250708/202507080426.3RX5BOHi-lkp@intel.com/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 <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202507080426.3RX5BOHi-lkp@intel.com/
>
> 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])
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...
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH 1/2] net: dsa: rzn1_a5psw: add COMPILE_TEST
  2025-07-07 20:47     ` Rosen Penev
@ 2025-07-07 21:33       ` Vladimir Oltean
  0 siblings, 0 replies; 9+ messages in thread
From: Vladimir Oltean @ 2025-07-07 21:33 UTC (permalink / raw)
  To: Rosen Penev
  Cc: kernel test robot, netdev, Paul Gazzillo, Necip Fazil Yildiran,
	oe-kbuild-all, Andrew Lunn, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Clément Léger, linux-kernel

On Mon, Jul 07, 2025 at 01:47:49PM -0700, Rosen Penev wrote:
> 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.

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

end of thread, other threads:[~2025-07-07 21:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07  0:39 [PATCH 0/2] net: dsa: rzn1_a5psw: add COMPILE_TEST Rosen Penev
2025-07-07  0:39 ` [PATCH 1/2] " Rosen Penev
2025-07-07  5:55   ` Andrew Lunn
2025-07-07  6:01     ` Andrew Lunn
2025-07-07 20:25   ` kernel test robot
2025-07-07 20:47     ` Rosen Penev
2025-07-07 21:33       ` Vladimir Oltean
2025-07-07  0:39 ` [PATCH 2/2] net: dsa: rzn1_a5psw: use devm to enable clocks Rosen Penev
2025-07-07  5:56   ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).