67 lines
1.7 KiB
Diff
67 lines
1.7 KiB
Diff
Date: Wed, 28 Dec 2005 15:40:01 -0700
|
|
To: netdev@vger.kernel.org
|
|
Subject: [PATCH 4/4] mv643xx: Don't call request_irq with a held lock
|
|
Message-ID: <20051228224001.GD5742@xyzzy.farnsworth.org>
|
|
References: <20051228223449.GA5742@xyzzy.farnsworth.org>
|
|
|
|
From: Dale Farnsworth <dale@farnsworth.org>
|
|
|
|
We can't call request_irq() while holding a spin lock.
|
|
|
|
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
|
|
|
|
Index: linux-2.6-mv643xx_enet/drivers/net/mv643xx_eth.c
|
|
===================================================================
|
|
--- linux-2.6-mv643xx_enet.orig/drivers/net/mv643xx_eth.c
|
|
+++ linux-2.6-mv643xx_enet/drivers/net/mv643xx_eth.c
|
|
@@ -655,34 +655,24 @@ static int mv643xx_eth_open(struct net_d
|
|
unsigned int port_num = mp->port_num;
|
|
int err;
|
|
|
|
- spin_lock_irq(&mp->lock);
|
|
-
|
|
err = request_irq(dev->irq, mv643xx_eth_int_handler,
|
|
SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);
|
|
-
|
|
if (err) {
|
|
printk(KERN_ERR "Can not assign IRQ number to MV643XX_eth%d\n",
|
|
port_num);
|
|
- err = -EAGAIN;
|
|
- goto out;
|
|
+ return -EAGAIN;
|
|
}
|
|
|
|
+ spin_lock_irq(&mp->lock);
|
|
+
|
|
if (mv643xx_eth_real_open(dev)) {
|
|
printk("%s: Error opening interface\n", dev->name);
|
|
+ free_irq(dev->irq, dev);
|
|
err = -EBUSY;
|
|
- goto out_free;
|
|
}
|
|
|
|
spin_unlock_irq(&mp->lock);
|
|
|
|
- return 0;
|
|
-
|
|
-out_free:
|
|
- free_irq(dev->irq, dev);
|
|
-
|
|
-out:
|
|
- spin_unlock_irq(&mp->lock);
|
|
-
|
|
return err;
|
|
}
|
|
|
|
|
|
_______________________________________________
|
|
Linuxppc-dev mailing list
|
|
Linuxppc-dev@ozlabs.org
|
|
https://ozlabs.org/mailman/listinfo/linuxppc-dev
|
|
---------------------------------------------------------------------------------------
|
|
Wanadoo vous informe que cet e-mail a ete controle par l'anti-virus mail.
|
|
Aucun virus connu a ce jour par nos services n'a ete detecte.
|
|
|
|
|
|
|