public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades•com>
To: netdev@oss•sgi.com
Subject: 8390.c workaround for interrupt storm
Date: Fri, 13 Aug 2004 12:30:47 -0300	[thread overview]
Message-ID: <20040813153047.GC28640@logos.cnet> (raw)

Hi netdev, 

We've been seeing an interrupt storm on our 
embedded PowerPC systems with Linksys PCMLM56 (network+modem) 
PCMCIA cards (network part of it driven by pcnet_cs.c) as soon as the network 
cable is  pluged/unpluged and after some activity on the serial
line. 

The card goes nuts, and doesnt stop sending interrupts. 

So I hacked up this patch which resets the 8390 chip
as soon as 256 empty interrupts are triggered. Works fine,
the card comes back to sanity after resetting.

Not sure if its specific to our boards, but I believe
it might happen on other archs also, so I'm posting it 
here in the hope it might be useful for someone with the
same problem.

Not likely to be included in mainline driver, but hey, why not,
its protection against hardware insanity.

--- 8390.c.orig 2004-08-13 11:54:28.000000000 -0300
+++ 8390.c      2004-08-13 11:54:07.000000000 -0300
@@ -411,6 +411,8 @@
  * needed.
  */
  
+int interrupt_cnt = 0;
+
 void ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
        struct net_device *dev = dev_id;
@@ -493,6 +495,22 @@
  
                outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD);
        }
+
+       /*
+        * Workaround infinite interrupt storm caused by Linksys combocard
+        * on embedded PowerPC. Other cards/platform can suffer
+        * from the same. Reset the device if we get more than 256
+        * empty interrupts.
+        */
+       if (!nr_serviced)
+               interrupt_cnt++;
+       else
+               interrupt_cnt = 0;
+
+       if (interrupt_cnt > 256) {
+               ei_status.reset_8390(dev);
+               interrupt_cnt = 0;
+       }
      
        if (interrupts && ei_debug)
        {

             reply	other threads:[~2004-08-13 15:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-13 15:30 Marcelo Tosatti [this message]
2004-08-13 20:17 ` 8390.c workaround for interrupt storm Jeff Garzik
2004-08-13 20:07   ` Marcelo Tosatti

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=20040813153047.GC28640@logos.cnet \
    --to=marcelo.tosatti@cyclades$(echo .)com \
    --cc=netdev@oss$(echo .)sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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