Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0c623828
Commit
0c623828
authored
Nov 14, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tg3 net driver to properly disable interrupts during some TX operations
parent
2c0889e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
8 deletions
+38
-8
drivers/net/tg3.c
drivers/net/tg3.c
+38
-8
No files found.
drivers/net/tg3.c
View file @
0c623828
...
...
@@ -63,8 +63,8 @@
#define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.
1
"
#define DRV_MODULE_RELDATE "
Aug 30
, 2002"
#define DRV_MODULE_VERSION "1.
2
"
#define DRV_MODULE_RELDATE "
Nov 14
, 2002"
#define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0
...
...
@@ -2377,13 +2377,28 @@ static int tg3_start_xmit_4gbug(struct sk_buff *skb, struct net_device *dev)
/* No BH disabling for tx_lock here. We are running in BH disabled
* context and TX reclaim runs via tp->poll inside of a software
* interrupt. Rejoice!
*
* Actually, things are not so simple. If we are to take a hw
* IRQ here, we can deadlock, consider:
*
* CPU1 CPU2
* tg3_start_xmit
* take tp->tx_lock
* tg3_timer
* take tp->lock
* tg3_interrupt
* spin on tp->lock
* spin on tp->tx_lock
*
* So we really do need to disable interrupts when taking
* tx_lock here.
*/
spin_lock
(
&
tp
->
tx_lock
);
spin_lock
_irq
(
&
tp
->
tx_lock
);
/* This is a hard error, log it. */
if
(
unlikely
(
TX_BUFFS_AVAIL
(
tp
)
<=
(
skb_shinfo
(
skb
)
->
nr_frags
+
1
)))
{
netif_stop_queue
(
dev
);
spin_unlock
(
&
tp
->
tx_lock
);
spin_unlock
_irq
(
&
tp
->
tx_lock
);
printk
(
KERN_ERR
PFX
"%s: BUG! Tx Ring full when queue awake!
\n
"
,
dev
->
name
);
return
1
;
...
...
@@ -2535,7 +2550,7 @@ static int tg3_start_xmit_4gbug(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue
(
dev
);
out_unlock:
spin_unlock
(
&
tp
->
tx_lock
);
spin_unlock
_irq
(
&
tp
->
tx_lock
);
dev
->
trans_start
=
jiffies
;
...
...
@@ -2553,13 +2568,28 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* No BH disabling for tx_lock here. We are running in BH disabled
* context and TX reclaim runs via tp->poll inside of a software
* interrupt. Rejoice!
*
* Actually, things are not so simple. If we are to take a hw
* IRQ here, we can deadlock, consider:
*
* CPU1 CPU2
* tg3_start_xmit
* take tp->tx_lock
* tg3_timer
* take tp->lock
* tg3_interrupt
* spin on tp->lock
* spin on tp->tx_lock
*
* So we really do need to disable interrupts when taking
* tx_lock here.
*/
spin_lock
(
&
tp
->
tx_lock
);
spin_lock
_irq
(
&
tp
->
tx_lock
);
/* This is a hard error, log it. */
if
(
unlikely
(
TX_BUFFS_AVAIL
(
tp
)
<=
(
skb_shinfo
(
skb
)
->
nr_frags
+
1
)))
{
netif_stop_queue
(
dev
);
spin_unlock
(
&
tp
->
tx_lock
);
spin_unlock
_irq
(
&
tp
->
tx_lock
);
printk
(
KERN_ERR
PFX
"%s: BUG! Tx Ring full when queue awake!
\n
"
,
dev
->
name
);
return
1
;
...
...
@@ -2665,7 +2695,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
if
(
TX_BUFFS_AVAIL
(
tp
)
<=
(
MAX_SKB_FRAGS
+
1
))
netif_stop_queue
(
dev
);
spin_unlock
(
&
tp
->
tx_lock
);
spin_unlock
_irq
(
&
tp
->
tx_lock
);
dev
->
trans_start
=
jiffies
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment