From mboxrd@z Thu Jan 1 00:00:00 1970 From: Francois Romieu Subject: Re: de2104x: interrupts before interrupt handler is registered Date: Sun, 5 Mar 2006 19:59:48 +0100 Message-ID: <20060305185948.GA24765@electric-eye.fr.zoreil.com> References: <20060305180757.GA22121@deprecation.cyrius.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jeff Garzik , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Return-path: To: Martin Michlmayr Content-Disposition: inline In-Reply-To: <20060305180757.GA22121@deprecation.cyrius.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Martin Michlmayr : [...] > I have a system on which I can reproduce this bug 100%. While I have > no idea how to fix the issue, I can provide debugging information and > test a fix. However, I'm (temporarily) leaving the country in three > weeks and won't have access to this PC for several months, so it would > be great if someone could look into this soon. Jeff? (not compile-tested) diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index d7fb3ff..d16a5a0 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c @@ -1376,18 +1376,20 @@ static int de_open (struct net_device *d return rc; } - rc = de_init_hw(de); - if (rc) { - printk(KERN_ERR "%s: h/w init failure, err=%d\n", - dev->name, rc); - goto err_out_free; - } + dw32(IntrMask, 0); rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev); if (rc) { printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", dev->name, dev->irq, rc); - goto err_out_hw; + goto err_out_free; + } + + rc = de_init_hw(de); + if (rc) { + printk(KERN_ERR "%s: h/w init failure, err=%d\n", + dev->name, rc); + goto err_out_free_irq; } netif_start_queue(dev); @@ -1395,11 +1397,8 @@ static int de_open (struct net_device *d return 0; -err_out_hw: - spin_lock_irqsave(&de->lock, flags); - de_stop_hw(de); - spin_unlock_irqrestore(&de->lock, flags); - +err_out_free_irq: + free_irq(dev->irq, dev); err_out_free: de_free_rings(de); return rc;