All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Kirch <okir@suse.de>
To: netdev@oss.sgi.com
Subject: [PATCH 2.6] Prevent tulip cardbus cards from freezing machine
Date: Thu, 27 May 2004 11:59:04 +0200	[thread overview]
Message-ID: <20040527095904.GG12225@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

Hi,

here's a patch that should prevent lockups with tulip cardbus cards
after APM suspend/resume, or when pulling out the card.

The problem is that the status register seems to return 0xffffffff in
this case, and tulip_poll thinks RxIntr is asserted all the time.

Please review.

Cheers
Olaf
-- 
Olaf Kirch     |  The Hardware Gods hate me.
okir@suse.de   |
---------------+ 

[-- Attachment #2: tulip-pcmcia-remove --]
[-- Type: text/plain, Size: 855 bytes --]

--- linux-2.6.5/drivers/net/tulip/interrupt.c.suspend	2004-04-04 05:36:48.000000000 +0200
+++ linux-2.6.5/drivers/net/tulip/interrupt.c	2004-05-25 12:24:07.000000000 +0200
@@ -113,6 +113,7 @@
 	int entry = tp->cur_rx % RX_RING_SIZE;
 	int rx_work_limit = *budget;
 	int received = 0;
+	int csr5;
 
 	if (!netif_running(dev))
 		goto done;
@@ -254,7 +255,12 @@
                 * No idea how to fix this if "playing with fire" will fail
                 * tomorrow (night 011029). If it will not fail, we won
                 * finally: amount of IO did not increase at all. */
-       } while ((inl(dev->base_addr + CSR5) & RxIntr));
+	       csr5 = inl(dev->base_addr + CSR5);
+	       if (csr5 == 0xffffffff) {
+		       printk(KERN_DEBUG "tulip_poll: hardware disappeared.\n");
+		       break;
+	       }
+       } while (csr5 & RxIntr);
  
 done:
  

                 reply	other threads:[~2004-05-27  9:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040527095904.GG12225@suse.de \
    --to=okir@suse.de \
    --cc=netdev@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.