summaryrefslogtreecommitdiffstats
path: root/drivers/staging/fsl-dpaa2
diff options
context:
space:
mode:
authorIoana Ciornei <ioana.ciornei@nxp.com>2020-07-14 16:34:26 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-15 16:22:36 +0200
commit06ddf551e4cb228155f8b086ac9113963817089c (patch)
treea8410162a75fd1da00e5a12e44e5d11a5d35cc41 /drivers/staging/fsl-dpaa2
parent1843b3fef9aaa9f5098212019e927ffd2e8da7c1 (diff)
staging: dpaa2-ethsw: fix reported link state
On the .ndo_open() callback set netif_carrier_off() until the link state interrupt is received so that the LOWER_UP flag does not show up incorrectly in the output of 'ip link show'. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Link: https://lore.kernel.org/r/20200714133431.17532-2-ioana.ciornei@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fsl-dpaa2')
-rw-r--r--drivers/staging/fsl-dpaa2/ethsw/ethsw.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index 546ad376df99..46aa37093e86 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -473,6 +473,13 @@ static int port_open(struct net_device *netdev)
/* No need to allow Tx as control interface is disabled */
netif_tx_stop_all_queues(netdev);
+ /* Explicitly set carrier off, otherwise
+ * netif_carrier_ok() will return true and cause 'ip link show'
+ * to report the LOWER_UP flag, even though the link
+ * notification wasn't even received.
+ */
+ netif_carrier_off(netdev);
+
err = dpsw_if_enable(port_priv->ethsw_data->mc_io, 0,
port_priv->ethsw_data->dpsw_handle,
port_priv->idx);