diff --git a/net/core/link_watch.c b/net/core/link_watch.c index bf8f7af699d7035e6e61af7c794c10877cd4fff9..1e401e12dc720609aca6227b0dd1c7d23922f867 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c @@ -178,7 +178,6 @@ static void __linkwatch_run_queue(int urgent_only) */ clear_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state); - rfc2863_policy(dev); if (dev->flags & IFF_UP) { if (netif_carrier_ok(dev)) dev_activate(dev); @@ -215,6 +214,12 @@ void linkwatch_fire_event(struct net_device *dev) { bool urgent = linkwatch_urgent_event(dev); + rfc2863_policy(dev); + + /* Some drivers call netif_carrier_off early */ + if (dev->reg_state == NETREG_UNINITIALIZED) + return; + if (!test_and_set_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) { dev_hold(dev); diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 5f5efe4e6072e2959d6f6802a268cc7c5afca66b..23a8e6141a00c3b74672fd70c0254e6bfb9e9eb3 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -270,8 +270,6 @@ static void dev_watchdog_down(struct net_device *dev) void netif_carrier_on(struct net_device *dev) { if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) { - if (dev->reg_state == NETREG_UNINITIALIZED) - return; linkwatch_fire_event(dev); if (netif_running(dev)) __netdev_watchdog_up(dev); @@ -288,8 +286,6 @@ EXPORT_SYMBOL(netif_carrier_on); void netif_carrier_off(struct net_device *dev) { if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) { - if (dev->reg_state == NETREG_UNINITIALIZED) - return; linkwatch_fire_event(dev); } }