Commit 5c8e98fe authored by Linas Vepstas's avatar Linas Vepstas Committed by Jeff Garzik

spidernet: transmit race

Multiple threads performing a transmit can race into
the spidernet tx ring cleanup code. This puts the
relevant check under a lock.
Signed-off-by: default avatarLinas Vepstas <lins@austin.ibm.com>
Cc: Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
Cc: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent d9c199ee
...@@ -803,8 +803,12 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal) ...@@ -803,8 +803,12 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
unsigned long flags; unsigned long flags;
int status; int status;
while (chain->tail != chain->head) { while (1) {
spin_lock_irqsave(&chain->lock, flags); spin_lock_irqsave(&chain->lock, flags);
if (chain->tail == chain->head) {
spin_unlock_irqrestore(&chain->lock, flags);
return 0;
}
descr = chain->tail; descr = chain->tail;
hwdescr = descr->hwdescr; hwdescr = descr->hwdescr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment