]> git.baikalelectronics.ru Git - kernel.git/commit
tg3: Schedule at most one tg3_reset_task run
authorMatt Carlson <mcarlson@broadcom.com>
Fri, 4 Nov 2011 09:15:03 +0000 (09:15 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Nov 2011 21:31:48 +0000 (17:31 -0400)
commit82fb8654365147d916fa500ad2d48f2fd26f806b
treeaefa69f5ad536aec711d102a238d6dc10c50fa48
parent95c2f09a8542faa5b6c8a897286b4b0885c02658
tg3: Schedule at most one tg3_reset_task run

It is possible for multiple threads in the tg3 driver to each attempt to
schedule a run of tg3_reset_task().  The multiple tg3_reset_task
executions could all wind up on the same queue (and execute serially) or
wind up on the queues of another processor (which could execute in
parallel).  Either scenario is not what was truly desired.

This patch adds a new flag, TG3_FLAG_RESET_TASK_PENDING, and uses it to
determine whether or not to schedule another run of tg3_reset_task().
With the new flag comes two new functions to facilitate scheduling and
descheduling of tg3_reset_task().

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c
drivers/net/ethernet/broadcom/tg3.h