From 2546b8933d66fdec4ece43606d46f395b6e550e3 Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 14 Apr 2017 15:10:05 +0100 Subject: sfp: ensure module starts with tx disabled Signed-off-by: Russell King --- drivers/net/phy/sfp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 1f5edc351b2d..294f59e140b0 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -1236,10 +1236,11 @@ static int sfp_probe(struct platform_device *pdev) phylink_register_module(sfp->phylink, sfp, &sfp_module_ops); } - sfp->state = sfp_get_state(sfp); - if (sfp->gpio[GPIO_TX_DISABLE] && - gpiod_get_value_cansleep(sfp->gpio[GPIO_TX_DISABLE])) - sfp->state |= SFP_F_TX_DISABLE; + /* Get the initial state, and always signal TX disable, + * since the network interface will not be up. + */ + sfp->state = sfp_get_state(sfp) | SFP_F_TX_DISABLE; + if (sfp->gpio[GPIO_RATE_SELECT] && gpiod_get_value_cansleep(sfp->gpio[GPIO_RATE_SELECT])) sfp->state |= SFP_F_RATE_SELECT; -- cgit