]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: ti: am65-cpsw: Fix devlink port register sequence
authorSiddharth Vadapalli <s-vadapalli@ti.com>
Wed, 6 Jul 2022 07:02:08 +0000 (12:32 +0530)
committerJakub Kicinski <kuba@kernel.org>
Fri, 8 Jul 2022 00:21:44 +0000 (17:21 -0700)
commit593131586739875d5f832902769942745cbee248
tree79017d7ac75b261a8f62edbe1d9aa49f1eb5c0b3
parent51838bcfb19ff3580e6d6c92f2917dc9239a58ab
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.

Move the function call to devlink_port_type_eth_set(), invoking it after
register_netdev() is invoked, to ensure that netlink notification for the
port state change is generated after the netdev is completely initialized.

Fixes: 502307eddb6c ("net: ti: am65-cpsw-nuss: Add devlink support")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Link: https://lore.kernel.org/r/20220706070208.12207-1-s-vadapalli@ti.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ti/am65-cpsw-nuss.c