Messages in this thread Patch in this message | | | Date | Fri, 22 May 1998 10:14:09 -0400 (EDT) | From | "Richard B. Johnson" <> | Subject | NE*0000 Fixes for 2.1.103 SMP and NonSMP |
| |
NE*000 fix for Linux-2.1.103
This is shortly after startup. You can check the timer interrupts for the "exact" time, if interested.
CPU0 CPU1 0: 45754 42339 IO-APIC-edge timer 1: 315 286 IO-APIC-edge keyboard 2: 0 0 XT-PIC cascade 4: 19 8 IO-APIC-edge serial 13: 1 0 XT-PIC fpu 16: 5831 5843 IO-APIC-level BusLogic BT-958 19: 656 630 IO-APIC-level NE2000 NMI: 0 IPI: 0
Note that Ingo fixed the startup race so the NE2000 interrupt count in reasonable.
This is after running my data-transfer test program for about an hour, again the timer ticks show the time.
CPU0 CPU1 0: 223484 170274 IO-APIC-edge timer 1: 377 327 IO-APIC-edge keyboard 2: 0 0 XT-PIC cascade 4: 19 9 IO-APIC-edge serial 13: 1 0 XT-PIC fpu 16: 5992 6012 IO-APIC-level BusLogic BT-958 19: 2237579 2237445 IO-APIC-level NE2000 NMI: 0 IPI: 0
The NE2* stuff seems to be running well and the interrupts are well shared.
This is the simple patch.
--- cut --- --- linux-2.1.103/drivers/net/ne.c.orig Thu Apr 9 19:20:29 1998 +++ linux-2.1.103/drivers/net/ne.c Fri May 22 09:02:10 1998 @@ -25,6 +25,9 @@ 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. Deallocated memory + last in cleanup_module() */ @@ -416,6 +419,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 +432,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++) { @@ -774,10 +776,10 @@ struct device *dev = &dev_ne[this_dev]; if (dev->priv != NULL) { unregister_netdev(dev); - kfree(dev->priv); dev->priv = NULL; free_irq(dev->irq, dev); release_region(dev->base_addr, NE_IO_EXTENT); + kfree(dev->priv); } } } --- cut ---
Cheers, Dick Johnson ***** FILE SYSTEM MODIFIED ***** Penguin : Linux version 2.1.103 on an i586 machine (66.15 BogoMips). Warning : It's hard to remain at the trailing edge of technology.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |