Skip to content

Commit

Permalink
atl1: use spin_trylock_irqsave()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Ingo Molnar authored and Jeff Garzik committed Aug 7, 2007
1 parent 092ed99 commit 5845b67
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/atl1/atl1_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5845b67

Please sign in to comment.