projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b0d11b4
)
tg3: tg3_timer() should grab tp->lock before checking for tp->irq_sync
author
Prashant Sreedharan
<
[email protected]
>
Wed, 14 Jan 2015 19:33:49 +0000
(11:33 -0800)
committer
David S. Miller
<
[email protected]
>
Wed, 14 Jan 2015 22:05:50 +0000
(17:05 -0500)
This is to avoid the race between tg3_timer() and the execution paths
which does not invoke tg3_timer_stop() and releases tp->lock before
calling synchronize_irq()
Reported-by: Peter Hurley <
[email protected]
>
Tested-by: Peter Hurley <
[email protected]
>
Signed-off-by: Prashant Sreedharan <
[email protected]
>
Signed-off-by: Michael Chan <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/ethernet/broadcom/tg3.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/broadcom/tg3.c
b/drivers/net/ethernet/broadcom/tg3.c
index 553dcd8a9df29f64108285c1f520635e287f7ca8..2dbd4aea01f3ba8f9b09852a2c0ec5fbfcead6d3 100644
(file)
--- a/
drivers/net/ethernet/broadcom/tg3.c
+++ b/
drivers/net/ethernet/broadcom/tg3.c
@@
-10903,11
+10903,13
@@
static void tg3_timer(unsigned long __opaque)
{
struct tg3 *tp = (struct tg3 *) __opaque;
- if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING))
- goto restart_timer;
-
spin_lock(&tp->lock);
+ if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING)) {
+ spin_unlock(&tp->lock);
+ goto restart_timer;
+ }
+
if (tg3_asic_rev(tp) == ASIC_REV_5717 ||
tg3_flag(tp, 57765_CLASS))
tg3_chk_missed_msi(tp);