]> git.karo-electronics.de Git - karo-tx-linux.git/commit
tg3: Fix firmware event timeouts
authorMatt Carlson <mcarlson@broadcom.com>
Fri, 15 Aug 2008 21:10:04 +0000 (14:10 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 8 Sep 2008 11:44:30 +0000 (04:44 -0700)
commita5096008726d745ff5b85bc9cc9b7e14c83d9be7
treea88d5600561b38deedf62ea7a9ca5e075c67e44c
parent78ecd7a96dbacf8a2a2b1fbf336507886d025a3d
tg3: Fix firmware event timeouts

patch 4ba526ced990f4d61ee8d65fe8a6f0745e8e455c upstream

The git commit 7c5026aa9b81dd45df8d3f4e0be73e485976a8b6 ("tg3: Add
link state reporting to UMP firmware") introduced code that waits for
previous firmware events to be serviced before attempting to submit a
new event.  Unfortunately that patch contained a bug that cause the
driver to wait 2.5 seconds, rather than 2.5 milliseconds as intended.
This patch fixes that bug.

This bug revealed that not all firmware versions service driver events
though.  Since we do not know which versions of the firmware do and don't
service these events, the driver needs some way to minimize the effects
of the delay.  This patch solves the problem by recording a jiffies
timestamp when it submits an event to the hardware.  If the jiffies
counter shows that 2.5 milliseconds have already passed, a wait is not
needed and the driver can proceed to submit a new event.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/tg3.c
drivers/net/tg3.h