Skip to content

Commit

Permalink
net: allow netif_carrier to be called safely from IRQ
Browse files Browse the repository at this point in the history
As reported by Ben Greer and Froncois Romieu. The code path in
the netif_carrier code leads it to try and disable
a late workqueue to reenable it immediately
netif_carrier_on
-> linkwatch_fire_event
   -> linkwatch_schedule_work
      -> cancel_delayed_work
         -> del_timer_sync

If __cancel_delayed_work is used instead then there is no
problem of waiting for running linkwatch_event.

There is a race between linkwatch_event running re-scheduling
but it is harmless to schedule an extra scan of the linkwatch queue.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
stephen hemminger authored and David S. Miller committed Jul 23, 2011
1 parent 758ccc3 commit 1821f7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/link_watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static void linkwatch_schedule_work(int urgent)
return;

/* It's already running which is good enough. */
if (!cancel_delayed_work(&linkwatch_work))
if (!__cancel_delayed_work(&linkwatch_work))
return;

/* Otherwise we reschedule it again for immediate execution. */
Expand Down

0 comments on commit 1821f7c

Please sign in to comment.