Messages in this thread Patch in this message | | | Date | Thu, 21 May 1998 19:34:25 -0400 (EDT) | From | "Richard B. Johnson" <> | Subject | Re: NE2000 PCI problems FIXED! |
| |
On Fri, 22 May 1998, MOLNAR Ingo wrote:
> > Richard, does this also happen with 2.1.103? > > Ingo >
I don't know, but it __should__. Linus pointed out that the interrupt was Snarfed before a buffer was initialized so the first interrupt would cause the trap.
I have modified the driver so this would not happen. I have also commented-out some stuff that caused lost interrupts, and the driver to eventually lose all interest in communicating at all. The stuff I modified in 8390.c is just a work-around. The positional change in the initialization order in ne.c is probably okay.
The patch is included here. I will get 2.1.103 as soon as I free up some disk space (tomorrow).
Cheers, Dick Johnson ***** FILE SYSTEM MODIFIED ***** Penguin : Linux version 2.1.101 on an i586 machine (66.15 BogoMips). Warning : It's hard to remain at the trailing edge of technology. --- linux-2.1.102/drivers/net/ne.c.orig Thu May 21 17:06:15 1998 +++ linux-2.1.102/drivers/net/ne.c Thu May 21 17:34:41 1998 @@ -25,6 +25,8 @@ Paul Gortmaker : Support for PCI ne2k clones, similar to lance.c Paul Gortmaker : Allow users with bad cards to avoid full probe. Paul Gortmaker : PCI probe changes, more PCI cards supported. + rjohnson@analogic.com : Changed init order so an interrupt will only + occur after memory is allocated for dev->priv. */ @@ -416,6 +418,12 @@ return EAGAIN; } + /* Allocate dev->priv and fill in 8390 specific dev fields. */ + if (ethdev_init(dev)) { + printk (" unable to get memory for dev->priv.\n"); + return -ENOMEM; + } + /* Snarf the interrupt now. There's no point in waiting since we cannot share and the board will usually be enabled. */ { @@ -423,19 +431,12 @@ pci_irq_line ? SA_SHIRQ : 0, name, dev); if (irqval) { printk (" unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval); + + kfree(dev->priv); return EAGAIN; } } - dev->base_addr = ioaddr; - - /* Allocate dev->priv and fill in 8390 specific dev fields. */ - if (ethdev_init(dev)) { - printk (" unable to get memory for dev->priv.\n"); - free_irq(dev->irq, dev); - return -ENOMEM; - } - request_region(ioaddr, NE_IO_EXTENT, name); for(i = 0; i < ETHER_ADDR_LEN; i++) { --- linux-2.1.102/drivers/net/8390.c.orig Thu May 21 17:09:45 1998 +++ linux-2.1.102/drivers/net/8390.c Thu May 21 19:03:11 1998 @@ -193,13 +193,19 @@ /* Mask interrupts from the ethercard. */ outb_p(0x00, e8390_base + EN0_IMR); +#if 0 disable_irq(dev->irq); synchronize_irq(); +#endif + if (dev->interrupt) { printk(KERN_WARNING "%s: Tx request while isr active.\n",dev->name); outb_p(ENISR_ALL, e8390_base + EN0_IMR); +#if 0 enable_irq(dev->irq); +#endif + ei_local->stat.tx_errors++; dev_kfree_skb(skb); return 0; @@ -242,7 +248,10 @@ ei_local->irqlock = 0; dev->tbusy = 1; outb_p(ENISR_ALL, e8390_base + EN0_IMR); +#if 0 enable_irq(dev->irq); +#endif + ei_local->stat.tx_errors++; return 1; } @@ -293,7 +302,9 @@ /* Turn 8390 interrupts back on. */ ei_local->irqlock = 0; outb_p(ENISR_ALL, e8390_base + EN0_IMR); +#if 0 enable_irq(dev->irq); +#endif dev_kfree_skb (skb); ei_local->stat.tx_bytes += send_length; @@ -333,7 +344,9 @@ } dev->interrupt = 1; +#if 0 sti(); +#endif /* Change to page 0 and read the intr status reg. */ outb_p(E8390_NODMA+E8390_PAGE0, e8390_base + E8390_CMD); | |