]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tg3: Schedule at most one tg3_reset_task run
authorJoe Jin <joe.jin@oracle.com>
Tue, 15 May 2012 13:25:17 +0000 (21:25 +0800)
committerJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 02:33:15 +0000 (10:33 +0800)
commitca72480ec90a05178ea608670fe7adce95278dcb
treeff19b86e8181acbdada9528d37a370d06d80ef23
parent8f2961ce7062abce491036c829b317792fd3c7cb
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().

(backport from commit db21997379906fe7657d360674e1106d80b020a4)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/tg3.c
drivers/net/tg3.h