public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Andreas Happe <andreashappe@gmx.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [net/8139cp] still crashes my notebook
Date: Sat, 24 Jan 2004 02:56:56 +0900	[thread overview]
Message-ID: <87vfn24kgn.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <slrnc104io.mp.andreashappe@flatline.ath.cx>

Andreas Happe <andreashappe@gmx.net> writes:

> hi,
> 
> my notebook (hp/compaq nx7000) still crashes when using 8139cp (runs
> rock solid with 8139too driver). The computer just locks up, there is no
> dmesg output. This has happened since I've got this laptop (around
> november '03).

It seems 8139cp.c has the race condition of rx_poll and interrupt.
Does the following patch fix this problem?

NOTE, since I don't have this device, patch is untested. Sorry.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

---

 drivers/net/8139cp.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff -puN drivers/net/8139cp.c~8139cp-napi-race-fix drivers/net/8139cp.c
--- linux-2.6.2-rc1/drivers/net/8139cp.c~8139cp-napi-race-fix	2004-01-24 02:22:36.000000000 +0900
+++ linux-2.6.2-rc1-hirofumi/drivers/net/8139cp.c	2004-01-24 02:37:43.000000000 +0900
@@ -615,8 +615,10 @@ rx_next:
 		if (cpr16(IntrStatus) & cp_rx_intr_mask)
 			goto rx_status_loop;
 
-		netif_rx_complete(dev);
+		local_irq_disable();
 		cpw16_f(IntrMask, cp_intr_mask);
+		__netif_rx_complete(dev);
+		local_irq_enable();
 
 		return 0;	/* done */
 	}
@@ -643,6 +645,12 @@ cp_interrupt (int irq, void *dev_instanc
 
 	spin_lock(&cp->lock);
 
+	/* close possible race's with dev_close */
+	if (unlikely(!netif_running(dev))) {
+		cpw16(IntrMask, 0);
+		goto out;
+	}
+
 	if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) {
 		if (netif_rx_schedule_prep(dev)) {
 			cpw16_f(IntrMask, cp_norx_intr_mask);
@@ -664,7 +672,7 @@ cp_interrupt (int irq, void *dev_instanc
 
 		/* TODO: reset hardware */
 	}
-
+out:
 	spin_unlock(&cp->lock);
 	return IRQ_HANDLED;
 }

_

  reply	other threads:[~2004-01-23 17:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-22 18:11 [net/8139cp] still crashes my notebook Andreas Happe
2004-01-23 17:56 ` OGAWA Hirofumi [this message]
2004-01-24 15:51   ` Thomas Svedberg
2004-01-24 21:26     ` OGAWA Hirofumi
2004-01-27  0:09       ` Andreas Happe
2004-01-24 21:00   ` Jeff Garzik
2004-01-24 21:39     ` OGAWA Hirofumi

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=87vfn24kgn.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=andreashappe@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    /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