[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220623044337.6179-1-s-vadapalli@ti.com>
Date: Thu, 23 Jun 2022 10:13:37 +0530
From: Siddharth Vadapalli <s-vadapalli@...com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <linux@...linux.org.uk>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<kishon@...com>, <vigneshr@...com>, <grygorii.strashko@...com>,
<s-vadapalli@...com>
Subject: [PATCH] net: ethernet: ti: am65-cpsw: Fix devlink port register sequence
Renaming interfaces using udevd depends on the interface being registered
before its netdev is registered. Otherwise, udevd reads an empty
phys_port_name value, resulting in the interface not being renamed.
Fix this by registering the interface before registering its netdev
by invoking am65_cpsw_nuss_register_devlink() before invoking
register_netdev() for the interface.
Signed-off-by: Siddharth Vadapalli <s-vadapalli@...com>
---
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index fb92d4c1547d..47a6c4e5360b 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -2527,6 +2527,10 @@ static int am65_cpsw_nuss_register_ndevs(struct am65_cpsw_common *common)
return ret;
}
+ ret = am65_cpsw_nuss_register_devlink(common);
+ if (ret)
+ goto err_cleanup_ndev;
+
for (i = 0; i < common->port_num; i++) {
port = &common->ports[i];
@@ -2545,17 +2549,12 @@ static int am65_cpsw_nuss_register_ndevs(struct am65_cpsw_common *common)
if (ret)
goto err_cleanup_ndev;
- ret = am65_cpsw_nuss_register_devlink(common);
- if (ret)
- goto clean_unregister_notifiers;
-
/* can't auto unregister ndev using devm_add_action() due to
* devres release sequence in DD core for DMA
*/
return 0;
-clean_unregister_notifiers:
- am65_cpsw_unregister_notifiers(common);
+
err_cleanup_ndev:
am65_cpsw_nuss_cleanup_ndev(common);
--
2.36.1
Powered by blists - more mailing lists