netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] atl1: use spin_trylock_irqsave()
@ 2007-08-01  0:07 Jay Cliburn
  2007-08-07 21:18 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Jay Cliburn @ 2007-08-01  0:07 UTC (permalink / raw)
  To: jeff
  Cc: mingo, csnook, atl1-devel, netdev, linux-kernel, nando, tglx,
	brbrofsvl, Jay Cliburn

From: Ingo Molnar <mingo@elte.hu>

use the simpler spin_trylock_irqsave() API to get the adapter lock.

[ this is also a fix for -rt where adapter->lock is a sleeping lock. ]

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
---
 drivers/net/atl1/atl1_main.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 56f6389..3c1984e 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1704,10 +1704,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 		}
 	}
 
-	local_irq_save(flags);
-	if (!spin_trylock(&adapter->lock)) {
+	if (!spin_trylock_irqsave(&adapter->lock, flags)) {
 		/* Can't get lock - tell upper layer to requeue */
-		local_irq_restore(flags);
 		dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n");
 		return NETDEV_TX_LOCKED;
 	}
-- 
1.5.2.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-07 21:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-01  0:07 [PATCH] atl1: use spin_trylock_irqsave() Jay Cliburn
2007-08-07 21:18 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).