diff options
author | Razvan Stefanescu <razvan.stefanescu@nxp.com> | 2017-05-18 12:23:03 (GMT) |
---|---|---|
committer | Xie Xiaobo <xiaobo.xie@nxp.com> | 2017-09-25 07:25:24 (GMT) |
commit | a0edf417a89a080b1e362d6d3ce04451f88b6393 (patch) | |
tree | c0b423dc93bb80654c3205a7924b7f3942606c36 /drivers | |
parent | f664ed4cbbba770bab98e7543fe69b426b2fbd36 (diff) | |
download | linux-a0edf417a89a080b1e362d6d3ce04451f88b6393.tar.xz |
staging: dpaa2-ethsw: Improve carrier synchronization
Port carrier synchronization should be performed when the switch ports are
enabled, not at probe, to avoid miss-configuration.
Signed-off-by: Razvan Stefanescu <razvan.stefanescu@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/fsl-dpaa2/ethsw/switch.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethsw/switch.c b/drivers/staging/fsl-dpaa2/ethsw/switch.c index 297ed99..3f2c964 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/switch.c +++ b/drivers/staging/fsl-dpaa2/ethsw/switch.c @@ -831,7 +831,21 @@ static int ethsw_port_open(struct net_device *netdev) return err; } + /* sync carrier state */ + err = _ethsw_port_carrier_state_sync(netdev); + if (err) { + netdev_err(netdev, "_ethsw_port_carrier_state_sync err %d\n", + err); + goto err_carrier_sync; + } + return 0; + +err_carrier_sync: + dpsw_if_disable(port_priv->ethsw_priv->mc_io, 0, + port_priv->ethsw_priv->dpsw_handle, + port_priv->port_index); + return err; } static int ethsw_port_stop(struct net_device *netdev) @@ -1788,13 +1802,6 @@ ethsw_probe(struct fsl_mc_device *sw_dev) if (err) dev_warn(&netdev->dev, "ethsw_port_fdb_add_mc err %d\n", err); - - /* sync carrier state */ - err = _ethsw_port_carrier_state_sync(port_netdev); - if (err) - netdev_err(netdev, - "_ethsw_port_carrier_state_sync err %d\n", - err); } /* the switch starts up enabled */ |