netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Michlmayr <tbm@cyrius.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: de2104x: interrupts before interrupt handler is registered
Date: Mon, 6 Mar 2006 14:35:12 +0000	[thread overview]
Message-ID: <20060306143512.GI23669@deprecation.cyrius.com> (raw)
In-Reply-To: <20060305185948.GA24765@electric-eye.fr.zoreil.com>

* Francois Romieu <romieu@fr.zoreil.com> [2006-03-05 19:59]:
> > 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.

> (not compile-tested)

Thanks a lot for your quick response, Francois.  I can confirm that
this patch fixes the problem for me.

> -err_out_hw:
> -	spin_lock_irqsave(&de->lock, flags);
> -	de_stop_hw(de);
> -	spin_unlock_irqrestore(&de->lock, flags);

flags is no longer used now, so we get a compilation warning.  Updated
patch below.  Francois, can you please submit it with a proper
changelog entry and your Signed-off-by.


From: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>

--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -1362,7 +1362,6 @@ static int de_open (struct net_device *d
 {
 	struct de_private *de = dev->priv;
 	int rc;
-	unsigned long flags;
 
 	if (netif_msg_ifup(de))
 		printk(KERN_DEBUG "%s: enabling interface\n", dev->name);
@@ -1376,18 +1375,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 +1396,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;

-- 
Martin Michlmayr
http://www.cyrius.com/

  reply	other threads:[~2006-03-06 14:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-05 18:07 de2104x: interrupts before interrupt handler is registered Martin Michlmayr
2006-03-05 18:59 ` Francois Romieu
2006-03-06 14:35   ` Martin Michlmayr [this message]
2006-03-06 19:17     ` Martin Michlmayr
2006-03-06 19:48       ` Francois Romieu
2006-03-06 19:59         ` Martin Michlmayr
2006-03-06 20:23           ` Francois Romieu
2006-03-06 20:29             ` Martin Michlmayr
2006-03-06 20:54           ` Francois Romieu
2006-03-07  5:16             ` Martin Michlmayr
2006-03-06 21:17       ` Francois Romieu
2006-03-07  5:11         ` Martin Michlmayr
2006-03-07 14:57           ` Martin Michlmayr
2006-03-08  0:15           ` Francois Romieu
2006-03-08  3:22             ` Martin Michlmayr
2006-03-07 15:16       ` Martin Michlmayr
2006-03-06 13:02 ` linux-os (Dick Johnson)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060306143512.GI23669@deprecation.cyrius.com \
    --to=tbm@cyrius.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=romieu@fr.zoreil.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).