Re: de2104x: interrupts before interrupt handler is registered

From: Martin Michlmayr
Date: Mon Mar 06 2006 - 09:33:07 EST


* Francois Romieu <romieu@xxxxxxxxxxxxx> [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@xxxxxxxxxxxxx>
Signed-off-by: Martin Michlmayr <tbm@xxxxxxxxxx>

--- 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/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/