aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/link_watch.c7
-rw-r--r--net/sched/sch_generic.c4
2 files changed, 5 insertions, 6 deletions
diff --git a/net/core/link_watch.c b/net/core/link_watch.c
index 1e401e12dc72..bf8f7af699d7 100644
--- a/net/core/link_watch.c
+++ b/net/core/link_watch.c
@@ -178,6 +178,7 @@ static void __linkwatch_run_queue(int urgent_only)
178 */ 178 */
179 clear_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state); 179 clear_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state);
180 180
181 rfc2863_policy(dev);
181 if (dev->flags & IFF_UP) { 182 if (dev->flags & IFF_UP) {
182 if (netif_carrier_ok(dev)) 183 if (netif_carrier_ok(dev))
183 dev_activate(dev); 184 dev_activate(dev);
@@ -214,12 +215,6 @@ void linkwatch_fire_event(struct net_device *dev)
214{ 215{
215 bool urgent = linkwatch_urgent_event(dev); 216 bool urgent = linkwatch_urgent_event(dev);
216 217
217 rfc2863_policy(dev);
218
219 /* Some drivers call netif_carrier_off early */
220 if (dev->reg_state == NETREG_UNINITIALIZED)
221 return;
222
223 if (!test_and_set_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) { 218 if (!test_and_set_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) {
224 dev_hold(dev); 219 dev_hold(dev);
225 220
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 23a8e6141a00..5f5efe4e6072 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -270,6 +270,8 @@ static void dev_watchdog_down(struct net_device *dev)
270void netif_carrier_on(struct net_device *dev) 270void netif_carrier_on(struct net_device *dev)
271{ 271{
272 if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) { 272 if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
273 if (dev->reg_state == NETREG_UNINITIALIZED)
274 return;
273 linkwatch_fire_event(dev); 275 linkwatch_fire_event(dev);
274 if (netif_running(dev)) 276 if (netif_running(dev))
275 __netdev_watchdog_up(dev); 277 __netdev_watchdog_up(dev);
@@ -286,6 +288,8 @@ EXPORT_SYMBOL(netif_carrier_on);
286void netif_carrier_off(struct net_device *dev) 288void netif_carrier_off(struct net_device *dev)
287{ 289{
288 if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) { 290 if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
291 if (dev->reg_state == NETREG_UNINITIALIZED)
292 return;
289 linkwatch_fire_event(dev); 293 linkwatch_fire_event(dev);
290 } 294 }
291} 295}