[PATCH] atl1: use spin_trylock_irqsave()

Subsystems: networking drivers, the rest

STALE6981d

2 messages, 2 authors, 2007-08-07 · open the first message on its own page

[PATCH] atl1: use spin_trylock_irqsave()

From: Jay Cliburn <hidden>
Date: 2007-08-01 00:07:22

From: Ingo Molnar <redacted>

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 <redacted>
Signed-off-by: Jay Cliburn <redacted>
---
 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

Re: [PATCH] atl1: use spin_trylock_irqsave()

From: Jeff Garzik <hidden>
Date: 2007-08-07 21:43:09

Jay Cliburn wrote:
From: Ingo Molnar <redacted>

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 <redacted>
Signed-off-by: Jay Cliburn <redacted>
---
 drivers/net/atl1/atl1_main.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
applied to #upstream-fixes

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help