All of lore.kernel.org
 help / color / mirror / Atom feed
* [net/8139cp] still crashes my notebook
@ 2004-01-22 18:11 Andreas Happe
  2004-01-23 17:56 ` OGAWA Hirofumi
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Happe @ 2004-01-22 18:11 UTC (permalink / raw)
  To: linux-kernel

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).

8139too outputs:
| 8139too Fast Ethernet driver 0.9.27
| 8139too: pci dev 0000:02:01.0 (id 10ec:8139 rev 20) is an enhanced 8139C+ chip
| 8139too: Use the "8139cp" driver for improved performance and stability.
| 8139too: 0000:02:01.0: unknown chip version, assuming RTL-8139
| 8139too: 0000:02:01.0: TxConfig = 0x74800000

the "Use the.." line is rather annoying..

lspci lists:
02:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 20)

	--Andreas



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net/8139cp] still crashes my notebook
  2004-01-22 18:11 [net/8139cp] still crashes my notebook Andreas Happe
@ 2004-01-23 17:56 ` OGAWA Hirofumi
  2004-01-24 15:51   ` Thomas Svedberg
  2004-01-24 21:00   ` Jeff Garzik
  0 siblings, 2 replies; 7+ messages in thread
From: OGAWA Hirofumi @ 2004-01-23 17:56 UTC (permalink / raw)
  To: Andreas Happe; +Cc: linux-kernel

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;
 }

_

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net/8139cp] still crashes my notebook
  2004-01-23 17:56 ` OGAWA Hirofumi
@ 2004-01-24 15:51   ` Thomas Svedberg
  2004-01-24 21:26     ` OGAWA Hirofumi
  2004-01-24 21:00   ` Jeff Garzik
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Svedberg @ 2004-01-24 15:51 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: Andreas Happe, Linux Kernel List

fre 2004-01-23 klockan 18.56 skrev OGAWA Hirofumi:
> 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.

I can confirm that this patch fixes the same complete lockup I have had
since 2.6.0-test4 or so, (See: "Hard lock with recent 2.6.0-test
kernels").

Tested against 2.6.2-rc1-mm2 which locks har without patch and works
great with it.

-- 
/ Thomas
.......................................................................
 Thomas Svedberg
 Department of Applied Mechanics
 Chalmers University of Technology

 Address: S-412 96 Göteborg, SWEDEN
 E-mail : thsv@bigfoot.com, thsv@am.chalmers.se
 Phone  : +46 31 772 1522
 Fax    : +46 31 772 3827
.......................................................................


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net/8139cp] still crashes my notebook
  2004-01-23 17:56 ` OGAWA Hirofumi
  2004-01-24 15:51   ` Thomas Svedberg
@ 2004-01-24 21:00   ` Jeff Garzik
  2004-01-24 21:39     ` OGAWA Hirofumi
  1 sibling, 1 reply; 7+ messages in thread
From: Jeff Garzik @ 2004-01-24 21:00 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: Andreas Happe, linux-kernel

applied to 2.4 and 2.6



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net/8139cp] still crashes my notebook
  2004-01-24 15:51   ` Thomas Svedberg
@ 2004-01-24 21:26     ` OGAWA Hirofumi
  2004-01-27  0:09       ` Andreas Happe
  0 siblings, 1 reply; 7+ messages in thread
From: OGAWA Hirofumi @ 2004-01-24 21:26 UTC (permalink / raw)
  To: Thomas Svedberg; +Cc: Andreas Happe, Linux Kernel List

Thomas Svedberg <thsv@am.chalmers.se> writes:

> fre 2004-01-23 klockan 18.56 skrev OGAWA Hirofumi:
> > 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.
> 
> I can confirm that this patch fixes the same complete lockup I have had
> since 2.6.0-test4 or so, (See: "Hard lock with recent 2.6.0-test
> kernels").
> 
> Tested against 2.6.2-rc1-mm2 which locks har without patch and works
> great with it.

Thaks for testing.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net/8139cp] still crashes my notebook
  2004-01-24 21:00   ` Jeff Garzik
@ 2004-01-24 21:39     ` OGAWA Hirofumi
  0 siblings, 0 replies; 7+ messages in thread
From: OGAWA Hirofumi @ 2004-01-24 21:39 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Andreas Happe, linux-kernel

Jeff Garzik <jgarzik@pobox.com> writes:

> applied to 2.4 and 2.6

Oh, thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net/8139cp] still crashes my notebook
  2004-01-24 21:26     ` OGAWA Hirofumi
@ 2004-01-27  0:09       ` Andreas Happe
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Happe @ 2004-01-27  0:09 UTC (permalink / raw)
  To: linux-kernel

On 2004-01-24, OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> wrote:
> Thomas Svedberg <thsv@am.chalmers.se> writes:
>> I can confirm that this patch fixes the same complete lockup I have had
>> since 2.6.0-test4 or so, (See: "Hard lock with recent 2.6.0-test
>> kernels").
>> 
>> Tested against 2.6.2-rc1-mm2 which locks har without patch and works
>> great with it.
>
> Thaks for testing.

I just wanted to confirm that this patch has solved my problem (my
computer hasn't crashed with 8139cp since ~48h).

Thanks for the patch,
Andreas


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-01-27  0:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-22 18:11 [net/8139cp] still crashes my notebook Andreas Happe
2004-01-23 17:56 ` OGAWA Hirofumi
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

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.