diff options
author | Gerhard Engleder <gerhard@engleder-embedded.com> | 2024-01-23 21:01:51 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-01-25 17:33:51 -0800 |
commit | 5f76499fb541c3e8ae401414bfdf702940c8c531 (patch) | |
tree | dff5aac017fcd23c2b07e6506e650b90b7c5e82b | |
parent | 3df18416267bb0d390399f4e63f74f7d76c5d92e (diff) |
tsnep: Add link down PHY loopback support
PHY loopback turns off link state change signalling. Therefore, the
loopback only works if the link is already up before the PHY loopback is
activated.
Ensure that PHY loopback works even if the link is not already up during
activation by calling netif_carrier_on() explicitly.
Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Link: https://lore.kernel.org/r/20240123200151.60848-1-gerhard@engleder-embedded.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | drivers/net/ethernet/engleder/tsnep_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c index 9aeff2b37a61..ae0b8b37b9bf 100644 --- a/drivers/net/ethernet/engleder/tsnep_main.c +++ b/drivers/net/ethernet/engleder/tsnep_main.c @@ -229,8 +229,10 @@ static int tsnep_phy_loopback(struct tsnep_adapter *adapter, bool enable) * would delay a working loopback anyway, let's ensure that loopback * is working immediately by setting link mode directly */ - if (!retval && enable) + if (!retval && enable) { + netif_carrier_on(adapter->netdev); tsnep_set_link_mode(adapter); + } return retval; } |