Re: tulip_stop_rxtx() failed
On Thu, Nov 23, 2006 at 01:59:17PM +0200, Meelis Roos wrote: > Background: Motorola Powerstack II (RS/6000 clone), PRep PowerPC > machine, running Debian unstable userspace and latest git kernels. 1 > 21140 onboard, another in PCI slot. > > Occasionally there is the message > :00:06.0: tulip_stop_rxtx() failed > during bootup. It does not happen every time, just sometimes (about half > boots with different git kernels). Everything seems to be working fine > though. So this is nothing critical but just strange. I'm planning on making that message print out only at debug level > 0. It pops up on initialization of a couple of my cards, with no apparent ill effects, and I've had reports of log spamming due to it. -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[TULIP] Need new maintainer
The Tulip network driver needs a new maintainer! I no longer have time to maintain the Tulip network driver and I'm stepping down. Jeff Garzik would be happy to get volunteers. The only current major outstanding patch I know of is Grant's shutdown race patch, which was incorrectly dropped as obsoleted from -mm (my fault, I was moving at the time): http://www.mail-archive.com/[EMAIL PROTECTED]/msg12161.html I have a very much non-working patch to do it with the preferred order, ask me for it and I'll see if I can dig it up. It's unpleasant partly because it pointed out a lot of latent bugs (e.g., del_timer_sync() in interrupt context). Also, someone is working on support for an emulated Tulip card (yes, Tulip will _never_ die), so expect possible patches for that. -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] tulip: Remove tulip maintainer
Remove Val Henson as tulip maintainer and let her roam free, FREE! Signed-off-by: Val Henson <[EMAIL PROTECTED]> --- linux-2.6.orig/MAINTAINERS +++ linux-2.6/MAINTAINERS @@ -3569,11 +3569,9 @@ W: http://www.auk.cx/tms380tr/ S: Maintained TULIP NETWORK DRIVER -P: Valerie Henson -M: [EMAIL PROTECTED] L: [EMAIL PROTECTED] W: http://sourceforge.net/projects/tulip/ -S: Maintained +S: Orphan TUN/TAP driver P: Maxim Krasnyansky - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] possible deadlock in tulip driver
(No longer maintainer, btw.) What situation have you tested this under? Thanks, -VAL On Tue, Jul 24, 2007 at 11:49:08AM +0400, Denis V. Lunev wrote: > Calling flush_scheduled_work() may deadlock if called under rtnl_lock > (from dev->stop) as linkwatch_event() may be on the workqueue and it will try > to get the rtnl_lock > > Signed-off-by: Denis V. Lunev <[EMAIL PROTECTED]> > --- > > tulip_core.c |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > --- ./drivers/net/tulip/tulip_core.c.tulip2007-07-16 12:54:29.0 > +0400 > +++ ./drivers/net/tulip/tulip_core.c 2007-07-23 19:06:24.0 +0400 > @@ -726,8 +726,6 @@ static void tulip_down (struct net_devic > void __iomem *ioaddr = tp->base_addr; > unsigned long flags; > > - flush_scheduled_work(); > - > del_timer_sync (&tp->timer); > #ifdef CONFIG_TULIP_NAPI > del_timer_sync (&tp->oom_timer); > @@ -1788,6 +1786,8 @@ static void __devexit tulip_remove_one ( > if (!dev) > return; > > + flush_scheduled_work(); > + > tp = netdev_priv(dev); > unregister_netdev(dev); > pci_free_consistent (pdev, > - > To unsubscribe from this list: send the line "unsubscribe netdev" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [TULIP] Need new maintainer
On Mon, Jul 30, 2007 at 03:31:58PM -0400, Kyle McMartin wrote: > On Mon, Jul 30, 2007 at 01:04:13PM -0600, Valerie Henson wrote: > > The Tulip network driver needs a new maintainer! I no longer have > > time to maintain the Tulip network driver and I'm stepping down. Jeff > > Garzik would be happy to get volunteers. > > > > Since I already take care of a major consumer of these devices (parisc, > which pretty much all have tulip) I'm willing to take care of this. > Alternately, Grant is probably willing. And I coulda handed you a suitcase full of cards and I missed my chance! It's fine by me, although Jeff is the final arbiter. Thanks! -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC][PATCH] Add suspend and resume support to uli526x
On Sun, Jun 03, 2007 at 12:37:35PM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <[EMAIL PROTECTED]> > > Add suspend/resume support to the uli526x network driver (tested on x86_64, > with 'Ethernet controller: ALi Corporation M5263 Ethernet Controller, rev > 40'). > > Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]> Nice work! Looks good to me. Signed-off-by: Val Henson <[EMAIL PROTECTED]> -VAL > drivers/net/tulip/uli526x.c | 120 > ++-- > 1 file changed, 105 insertions(+), 15 deletions(-) > > Index: linux-2.6.22-rc3/drivers/net/tulip/uli526x.c > === > --- linux-2.6.22-rc3.orig/drivers/net/tulip/uli526x.c 2007-06-03 > 12:10:41.0 +0200 > +++ linux-2.6.22-rc3/drivers/net/tulip/uli526x.c 2007-06-03 > 12:14:33.0 +0200 > @@ -220,6 +220,10 @@ static int mode = 8; > static int uli526x_open(struct net_device *); > static int uli526x_start_xmit(struct sk_buff *, struct net_device *); > static int uli526x_stop(struct net_device *); > +#ifdef CONFIG_PM > +static int uli526x_suspend(struct pci_dev *pdev, pm_message_t state); > +static int uli526x_resume(struct pci_dev *pdev); > +#endif > static struct net_device_stats * uli526x_get_stats(struct net_device *); > static void uli526x_set_filter_mode(struct net_device *); > static const struct ethtool_ops netdev_ethtool_ops; > @@ -425,21 +429,14 @@ static void __devexit uli526x_remove_one > > > /* > - * Open the interface. > - * The interface is opened whenever "ifconfig" activates it. > + * Bring the interface up. > + * Used by uli526x_open and uli526x_resume. > */ > > -static int uli526x_open(struct net_device *dev) > +static void uli526x_up(struct net_device *dev) > { > - int ret; > struct uli526x_board_info *db = netdev_priv(dev); > > - ULI526X_DBUG(0, "uli526x_open", 0); > - > - ret = request_irq(dev->irq, &uli526x_interrupt, IRQF_SHARED, dev->name, > dev); > - if (ret) > - return ret; > - > /* system variable init */ > db->cr6_data = CR6_DEFAULT | uli526x_cr6_user_set; > db->tx_packet_cnt = 0; > @@ -467,7 +464,25 @@ static int uli526x_open(struct net_devic > db->timer.data = (unsigned long)dev; > db->timer.function = &uli526x_timer; > add_timer(&db->timer); > +} > + > + > +/* > + * Open the interface. > + * The interface is opened whenever "ifconfig" activates it. > + */ > > +static int uli526x_open(struct net_device *dev) > +{ > + int ret; > + > + ULI526X_DBUG(0, "uli526x_open", 0); > + > + ret = request_irq(dev->irq, &uli526x_interrupt, IRQF_SHARED, dev->name, > dev); > + if (ret) > + return ret; > + > + uli526x_up(dev); > return 0; > } > > @@ -613,17 +628,15 @@ static int uli526x_start_xmit(struct sk_ > > > /* > - * Stop the interface. > - * The interface is stopped when it is brought. > + * Take the interface down. > + * Used by uli526x_stop and uli526x_suspend. > */ > > -static int uli526x_stop(struct net_device *dev) > +static void uli526x_down(struct net_device *dev) > { > struct uli526x_board_info *db = netdev_priv(dev); > unsigned long ioaddr = dev->base_addr; > > - ULI526X_DBUG(0, "uli526x_stop", 0); > - > /* disable system */ > netif_stop_queue(dev); > > @@ -634,6 +647,21 @@ static int uli526x_stop(struct net_devic > outl(ULI526X_RESET, ioaddr + DCR0); > udelay(5); > phy_write(db->ioaddr, db->phy_addr, 0, 0x8000, db->chip_id); > +} > + > + > +/* > + * Stop the interface. > + * The interface is stopped when it is brought. > + */ > + > +static int uli526x_stop(struct net_device *dev) > +{ > + struct uli526x_board_info *db = netdev_priv(dev); > + > + ULI526X_DBUG(0, "uli526x_stop", 0); > + > + uli526x_down(dev); > > /* free interrupt */ > free_irq(dev->irq, dev); > @@ -654,6 +682,64 @@ static int uli526x_stop(struct net_devic > } > > > +#ifdef CONFIG_PM > + > +/* > + * Suspend the interface. > + */ > + > +static int uli526x_suspend(struct pci_dev *pdev, pm_message_t state) > +{ > + struct net_device *dev = pci_get_drvdata(pdev); > + > + ULI526X_DBUG(0, "uli526x_suspend", 0); > + > + if (dev && netdev_priv(dev)) { > + if (netif_running(dev)) { > + netif_device_detach(dev); > + uli526x_down(dev); > + } > + pci_save_state(pdev); > + pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); > + pci_disable_device(pdev); > + pci_set_power_state(pdev, pci_choose_state(pdev, state)); > + } > + return 0; > +} > + > +/* > + * Resume the interface. > + */ > + > +static int uli526x_resume(struct pci_dev *pdev) > +{ > + struct net_device *dev = pci_get_drvdata(pdev); > + struct uli526x_board_info *db = netdev_priv(dev); > + int er
[patch 0/4] [TULIP] Tulip updates
This patch set includes a fix for Lite-on from Guido Classen, some minor debugging/typo fixes, and a long-need rev to the version (the last time this was done was 2002!). -VAL -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 4/4] [TULIP] Rev tulip version
Rev tulip version... things have changed since 2002! Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip_core.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- tulip-2.6-mm-linux.orig/drivers/net/tulip/tulip_core.c +++ tulip-2.6-mm-linux/drivers/net/tulip/tulip_core.c @@ -17,11 +17,11 @@ #define DRV_NAME "tulip" #ifdef CONFIG_TULIP_NAPI -#define DRV_VERSION"1.1.14-NAPI" /* Keep at least for test */ +#define DRV_VERSION"1.1.15-NAPI" /* Keep at least for test */ #else -#define DRV_VERSION"1.1.14" +#define DRV_VERSION"1.1.15" #endif -#define DRV_RELDATE"May 11, 2002" +#define DRV_RELDATE"Feb 27, 2007" #include -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 3/4] [TULIP] Fix SytemError typo
Fix an annoying typo - SytemError -> SystemError Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/interrupt.c |4 ++-- drivers/net/tulip/tulip.h |2 +- drivers/net/tulip/winbond-840.c |2 +- 3 files changed, 4 insertions(+), 4 deletions(-) --- tulip-2.6-mm-linux.orig/drivers/net/tulip/interrupt.c +++ tulip-2.6-mm-linux/drivers/net/tulip/interrupt.c @@ -675,7 +675,7 @@ irqreturn_t tulip_interrupt(int irq, voi if (tp->link_change) (tp->link_change)(dev, csr5); } - if (csr5 & SytemError) { + if (csr5 & SystemError) { int error = (csr5 >> 23) & 7; /* oops, we hit a PCI error. The code produced corresponds * to the reason: @@ -745,7 +745,7 @@ irqreturn_t tulip_interrupt(int irq, voi TxFIFOUnderflow | TxJabber | TPLnkFail | - SytemError )) != 0); + SystemError )) != 0); #else } while ((csr5 & (NormalIntr|AbnormalIntr)) != 0); --- tulip-2.6-mm-linux.orig/drivers/net/tulip/tulip.h +++ tulip-2.6-mm-linux/drivers/net/tulip/tulip.h @@ -132,7 +132,7 @@ enum pci_cfg_driver_reg { /* The bits in the CSR5 status registers, mostly interrupt sources. */ enum status_bits { TimerInt = 0x800, - SytemError = 0x2000, + SystemError = 0x2000, TPLnkFail = 0x1000, TPLnkPass = 0x10, NormalIntr = 0x1, --- tulip-2.6-mm-linux.orig/drivers/net/tulip/winbond-840.c +++ tulip-2.6-mm-linux/drivers/net/tulip/winbond-840.c @@ -1148,7 +1148,7 @@ static irqreturn_t intr_handler(int irq, } /* Abnormal error summary/uncommon events handlers. */ - if (intr_status & (AbnormalIntr | TxFIFOUnderflow | SytemError | + if (intr_status & (AbnormalIntr | TxFIFOUnderflow | SystemError | TimerInt | TxDied)) netdev_error(dev, intr_status); -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 2/4] [TULIP] Quiet down tulip_stop_rxtx
Only print out debugging info for tulip_stop_rxtx if debug is on. Many cards (including at least two of my own) fail to stop properly during initialization according to this test with no apparent ill effects. Worse, it tends to spam logs when the driver doesn't work. Signed-off-by: Val Henson <[EMAIL PROTECTED]> Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) --- tulip-2.6-mm-linux.orig/drivers/net/tulip/tulip.h +++ tulip-2.6-mm-linux/drivers/net/tulip/tulip.h @@ -481,7 +481,7 @@ static inline void tulip_stop_rxtx(struc while (--i && (ioread32(ioaddr + CSR5) & (CSR5_TS|CSR5_RS))) udelay(10); - if (!i) + if (!i && (tulip_debug > 1)) printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed" " (CSR5 0x%x CSR6 0x%x)\n", pci_name(tp->pdev), -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 1/4] [TULIP] fix for Lite-On 82c168 PNIC
From: Guido Classen <[EMAIL PROTECTED]> This small patch fixes two issues with the Lite-On 82c168 PNIC adapters. I've tested it with two cards in different machines both chip rev 17 The first is the wrong register address CSR6 for writing the MII register which instead is 0xB8 (this may get a symbol too?) (see similar exisiting code at line 437) in tulip_core.c [Double-checked by Val Henson; yes, 0xB8 is correct register for autonegotiate on this card.] At least by my cards, the the bit 31 from the MII register seems to be somewhat unstable. This results in reading wrong values from the Phy-Registers und prevents the card from correct initialization. I've added a litte delay and an second test of the bit. If the bit is stil cleared the read/write process has definitely finished. [Original patch slightly massaged by Val Henson] Signed-off-by: Val Henson <[EMAIL PROTECTED]> Cc: Guido Classen <[EMAIL PROTECTED]> Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/media.c | 31 +++ drivers/net/tulip/tulip_core.c |4 ++-- 2 files changed, 29 insertions(+), 6 deletions(-) --- tulip-2.6-mm-linux.orig/drivers/net/tulip/tulip_core.c +++ tulip-2.6-mm-linux/drivers/net/tulip/tulip_core.c @@ -1701,8 +1701,8 @@ static int __devinit tulip_init_one (str tp->nwayset = 0; iowrite32(csr6_ttm | csr6_ca, ioaddr + CSR6); iowrite32(0x30, ioaddr + CSR12); - iowrite32(0x0001F078, ioaddr + CSR6); - iowrite32(0x0201F078, ioaddr + CSR6); /* Turn on autonegotiation. */ + iowrite32(0x0001F078, ioaddr + 0xB8); + iowrite32(0x0201F078, ioaddr + 0xB8); /* Turn on autonegotiation. */ } break; case MX98713: --- tulip-2.6-mm-linux.orig/drivers/net/tulip/media.c +++ tulip-2.6-mm-linux/drivers/net/tulip/media.c @@ -76,8 +76,20 @@ int tulip_mdio_read(struct net_device *d ioread32(ioaddr + 0xA0); while (--i > 0) { barrier(); - if ( ! ((retval = ioread32(ioaddr + 0xA0)) & 0x8000)) - break; + if ( ! ((retval = ioread32(ioaddr + 0xA0)) +& 0x8000)) { + /* +* Possible bug in 82c168 rev 17 - + * sometimes bit 31 is unstable and + * clears before actually finished. + * Delay and check if bit 31 is still + * cleared before believing it. +*/ +udelay(10); +if ( ! ((retval = ioread32(ioaddr + 0xA0)) +& 0x8000)) +break; +} } spin_unlock_irqrestore(&tp->mii_lock, flags); return retval & 0x; @@ -136,8 +148,19 @@ void tulip_mdio_write(struct net_device iowrite32(cmd, ioaddr + 0xA0); do { barrier(); - if ( ! (ioread32(ioaddr + 0xA0) & 0x8000)) - break; + if ( ! (ioread32(ioaddr + 0xA0) & 0x8000)) { + /* +* Possible bug in 82c168 rev 17 - + * sometimes bit 31 is unstable and + * clears before actually finished. + * Delay and check if bit 31 is still + * cleared before believing it. +*/ +udelay(10); +if ( ! (ioread32(ioaddr + 0xA0) +& 0x8000)) +break; +} } while (--i > 0); spin_unlock_irqrestore(&tp->mii_lock, flags); return; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 2/6] [TULIP] From: Thibaut VARENE <[EMAIL PROTECTED]>
Fix a problem with Tulip 21142 HP branded PCI cards (PN#: B5509-66001), which feature a NatSemi DP83840A PHY. Without that patch, it is impossible to properly initialize the card's PHY, and it's thus impossible to monitor/configure it. [VAL: I'm happy with the 1.5 ms max delay; it doesn't seem excessive.] Signed-off-by: Thibaut VARENE <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> Acked-by: Grant Grundler <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/tulip/media.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff -puN drivers/net/tulip/media.c~tulip-natsemi-dp83840a-phy-fix drivers/net/tulip/media.c --- a/drivers/net/tulip/media.c~tulip-natsemi-dp83840a-phy-fix +++ a/drivers/net/tulip/media.c @@ -263,11 +263,27 @@ void tulip_select_media(struct net_devic u16 *reset_sequence = &((u16*)(p+3))[init_length]; int reset_length = p[2 + init_length*2]; misc_info = reset_sequence + reset_length; - if (startup) + if (startup) { + int timeout = 10; /* max 1 ms */ for (i = 0; i < reset_length; i++) iowrite32(get_u16(&reset_sequence[i]) << 16, ioaddr + CSR15); + + /* flush posted writes */ + ioread32(ioaddr + CSR15); + + /* Sect 3.10.3 in DP83840A.pdf (p39) */ + udelay(500); + + /* Section 4.2 in DP83840A.pdf (p43) */ + /* and IEEE 802.3 "22.2.4.1.1 Reset" */ + while (timeout-- && + (tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET)) + udelay(100); + } for (i = 0; i < init_length; i++) iowrite32(get_u16(&init_sequence[i]) << 16, ioaddr + CSR15); + + ioread32(ioaddr + CSR15); /* flush posted writes */ } else { u8 *init_sequence = p + 2; u8 *reset_sequence = p + 3 + init_length; _ -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 5/6] [TULIP] Fix SytemError typo
Fix an annoying typo - SytemError -> SystemError Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/interrupt.c |4 ++-- drivers/net/tulip/tulip.h |2 +- drivers/net/tulip/winbond-840.c |2 +- 3 files changed, 4 insertions(+), 4 deletions(-) --- pristine-linux.orig/drivers/net/tulip/interrupt.c +++ pristine-linux/drivers/net/tulip/interrupt.c @@ -675,7 +675,7 @@ irqreturn_t tulip_interrupt(int irq, voi if (tp->link_change) (tp->link_change)(dev, csr5); } - if (csr5 & SytemError) { + if (csr5 & SystemError) { int error = (csr5 >> 23) & 7; /* oops, we hit a PCI error. The code produced corresponds * to the reason: @@ -745,7 +745,7 @@ irqreturn_t tulip_interrupt(int irq, voi TxFIFOUnderflow | TxJabber | TPLnkFail | - SytemError )) != 0); + SystemError )) != 0); #else } while ((csr5 & (NormalIntr|AbnormalIntr)) != 0); --- pristine-linux.orig/drivers/net/tulip/tulip.h +++ pristine-linux/drivers/net/tulip/tulip.h @@ -132,7 +132,7 @@ enum pci_cfg_driver_reg { /* The bits in the CSR5 status registers, mostly interrupt sources. */ enum status_bits { TimerInt = 0x800, - SytemError = 0x2000, + SystemError = 0x2000, TPLnkFail = 0x1000, TPLnkPass = 0x10, NormalIntr = 0x1, --- pristine-linux.orig/drivers/net/tulip/winbond-840.c +++ pristine-linux/drivers/net/tulip/winbond-840.c @@ -1148,7 +1148,7 @@ static irqreturn_t intr_handler(int irq, } /* Abnormal error summary/uncommon events handlers. */ - if (intr_status & (AbnormalIntr | TxFIFOUnderflow | SytemError | + if (intr_status & (AbnormalIntr | TxFIFOUnderflow | SystemError | TimerInt | TxDied)) netdev_error(dev, intr_status); -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 6/6] [TULIP] Rev tulip version
Rev tulip version... things have changed since 2002! Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip_core.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- pristine-linux.orig/drivers/net/tulip/tulip_core.c +++ pristine-linux/drivers/net/tulip/tulip_core.c @@ -17,11 +17,11 @@ #define DRV_NAME "tulip" #ifdef CONFIG_TULIP_NAPI -#define DRV_VERSION"1.1.14-NAPI" /* Keep at least for test */ +#define DRV_VERSION"1.1.15-NAPI" /* Keep at least for test */ #else -#define DRV_VERSION"1.1.14" +#define DRV_VERSION"1.1.15" #endif -#define DRV_RELDATE"May 11, 2002" +#define DRV_RELDATE"Feb 27, 2007" #include -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 1/6] [TULIP] From: Jim Gifford <[EMAIL PROTECTED]>, Grant Grundler <[EMAIL PROTECTED]>, Peter Horton <[EMAIL PROTECTED]>
With Grant's help I was able to get the tulip driver to work with 64 bit MIPS. [VAL: I'm happy with the 1.5 ms max delay; it doesn't seem excessive.] Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/media.c | 22 -- drivers/net/tulip/tulip.h |7 +-- 2 files changed, 25 insertions(+), 4 deletions(-) diff -puN drivers/net/tulip/media.c~tulip-fix-for-64-bit-mips drivers/net/tulip/media.c --- a/drivers/net/tulip/media.c~tulip-fix-for-64-bit-mips +++ a/drivers/net/tulip/media.c @@ -44,8 +44,10 @@ static const unsigned char comet_miireg2 /* MII transceiver control section. Read and write the MII registers using software-generated serial - MDIO protocol. See the MII specifications or DP83840A data sheet - for details. */ + MDIO protocol. + See IEEE 802.3-2002.pdf (Section 2, Chapter "22.2.4 Management functions") + or DP83840A data sheet for more details. + */ int tulip_mdio_read(struct net_device *dev, int phy_id, int location) { @@ -272,13 +274,29 @@ void tulip_select_media(struct net_devic int reset_length = p[2 + init_length]; misc_info = (u16*)(reset_sequence + reset_length); if (startup) { + int timeout = 10; /* max 1 ms */ iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12); for (i = 0; i < reset_length; i++) iowrite32(reset_sequence[i], ioaddr + CSR12); + + /* flush posted writes */ + ioread32(ioaddr + CSR12); + + /* Sect 3.10.3 in DP83840A.pdf (p39) */ + udelay(500); + + /* Section 4.2 in DP83840A.pdf (p43) */ + /* and IEEE 802.3 "22.2.4.1.1 Reset" */ + while (timeout-- && + (tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET)) + udelay(100); } for (i = 0; i < init_length; i++) iowrite32(init_sequence[i], ioaddr + CSR12); + + ioread32(ioaddr + CSR12); /* flush posted writes */ } + tmp_info = get_u16(&misc_info[1]); if (tmp_info) tp->advertising[phy_num] = tmp_info | 1; diff -puN drivers/net/tulip/tulip.h~tulip-fix-for-64-bit-mips drivers/net/tulip/tulip.h --- a/drivers/net/tulip/tulip.h~tulip-fix-for-64-bit-mips +++ a/drivers/net/tulip/tulip.h @@ -482,8 +482,11 @@ static inline void tulip_stop_rxtx(struc udelay(10); if (!i) - printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed\n", - pci_name(tp->pdev)); + printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed" + " (CSR5 0x%x CSR6 0x%x)\n", + pci_name(tp->pdev), + ioread32(ioaddr + CSR5), + ioread32(ioaddr + CSR6)); } } _ -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 3/6] [TULIP] fix for Lite-On 82c168 PNIC
From: Guido Classen <[EMAIL PROTECTED]> This small patch fixes two issues with the Lite-On 82c168 PNIC adapters. I've tested it with two cards in different machines both chip rev 17 The first is the wrong register address CSR6 for writing the MII register which instead is 0xB8 (this may get a symbol too?) (see similar exisiting code at line 437) in tulip_core.c [Double-checked by Val Henson; yes, 0xB8 is correct register for autonegotiate on this card.] At least by my cards, the the bit 31 from the MII register seems to be somewhat unstable. This results in reading wrong values from the Phy-Registers und prevents the card from correct initialization. I've added a litte delay and an second test of the bit. If the bit is stil cleared the read/write process has definitely finished. [Original patch slightly massaged by Val Henson] Signed-off-by: Val Henson <[EMAIL PROTECTED]> Cc: Guido Classen <[EMAIL PROTECTED]> Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/media.c | 31 +++ drivers/net/tulip/tulip_core.c |4 ++-- 2 files changed, 29 insertions(+), 6 deletions(-) --- pristine-linux.orig/drivers/net/tulip/tulip_core.c +++ pristine-linux/drivers/net/tulip/tulip_core.c @@ -1689,8 +1689,8 @@ static int __devinit tulip_init_one (str tp->nwayset = 0; iowrite32(csr6_ttm | csr6_ca, ioaddr + CSR6); iowrite32(0x30, ioaddr + CSR12); - iowrite32(0x0001F078, ioaddr + CSR6); - iowrite32(0x0201F078, ioaddr + CSR6); /* Turn on autonegotiation. */ + iowrite32(0x0001F078, ioaddr + 0xB8); + iowrite32(0x0201F078, ioaddr + 0xB8); /* Turn on autonegotiation. */ } break; case MX98713: --- pristine-linux.orig/drivers/net/tulip/media.c +++ pristine-linux/drivers/net/tulip/media.c @@ -76,8 +76,20 @@ int tulip_mdio_read(struct net_device *d ioread32(ioaddr + 0xA0); while (--i > 0) { barrier(); - if ( ! ((retval = ioread32(ioaddr + 0xA0)) & 0x8000)) - break; + if ( ! ((retval = ioread32(ioaddr + 0xA0)) +& 0x8000)) { + /* +* Possible bug in 82c168 rev 17 - + * sometimes bit 31 is unstable and + * clears before actually finished. + * Delay and check if bit 31 is still + * cleared before believing it. +*/ +udelay(10); +if ( ! ((retval = ioread32(ioaddr + 0xA0)) +& 0x8000)) +break; +} } spin_unlock_irqrestore(&tp->mii_lock, flags); return retval & 0x; @@ -136,8 +148,19 @@ void tulip_mdio_write(struct net_device iowrite32(cmd, ioaddr + 0xA0); do { barrier(); - if ( ! (ioread32(ioaddr + 0xA0) & 0x8000)) - break; + if ( ! (ioread32(ioaddr + 0xA0) & 0x8000)) { + /* +* Possible bug in 82c168 rev 17 - + * sometimes bit 31 is unstable and + * clears before actually finished. + * Delay and check if bit 31 is still + * cleared before believing it. +*/ +udelay(10); +if ( ! (ioread32(ioaddr + 0xA0) +& 0x8000)) +break; +} } while (--i > 0); spin_unlock_irqrestore(&tp->mii_lock, flags); return; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 4/6] [TULIP] Quiet down tulip_stop_rxtx
Only print out debugging info for tulip_stop_rxtx if debug is on. Many cards (including at least two of my own) fail to stop properly during initialization according to this test with no apparent ill effects. Worse, it tends to spam logs when the driver doesn't work. Signed-off-by: Val Henson <[EMAIL PROTECTED]> Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- pristine-linux.orig/drivers/net/tulip/tulip.h +++ pristine-linux/drivers/net/tulip/tulip.h @@ -481,7 +481,7 @@ static inline void tulip_stop_rxtx(struc while (--i && (ioread32(ioaddr + CSR5) & (CSR5_TS|CSR5_RS))) udelay(10); - if (!i) + if (!i && (tulip_debug > 1)) printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed" " (CSR5 0x%x CSR6 0x%x)\n", pci_name(tp->pdev), -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 4/6] [TULIP] Quiet down tulip_stop_rxtx
On Thu, Mar 15, 2007 at 11:25:10AM -0400, Jeff Garzik wrote: > > Here's the problem with this: this printk is signalling that the DMA > engines have not yet stopped, which is an event of which we should be wary. > > While it makes sense to do this patch, since the complaining cards > appear to work anyway, we also need to take into account the times when > this is not a spurious warning. > > Thus, I would consider maybe adding a warning somewhere in the > DMA-engine-start region of code, that complains if the DMA engines are > already active, or somesuch. Yeah, I agree it's signifying a problem, and we should have a warning (only one) until we figure out what's going on. Put on my to-do list. -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] fix MCA when shutting down tulip quad-NIC
On Tue, Apr 03, 2007 at 11:19:16PM +0200, Olaf Hering wrote: > From: [EMAIL PROTECTED] > > https://bugzilla.novell.com/show_bug.cgi?id=SUSE39204 Wow, registering for Novell's bugzilla is painful. And in the end I get "Access denied" on that bug. Can you give us this information some other way? > Shutting down the network causes an MCA because of an IO TLB error when > a DEC quad 10/100 card is in any slot. This problem was originally seen > on an HP rx4640. I'm not clear on why pci_disable_device() would fix this bug. Do you have an explanation (or can copy one out of the bug report)? I'm hesitant to make even obviously correct changes to the tulip driver without good evidence, given the incredible variety of buggy hardware out there. This looks to me like another iteration of the shutdown DMA/irq race at first glance. Grant has a patch for it; I'm working on one I consider cleaner. -VAL > > > Signed-off-by: Olaf Hering <[EMAIL PROTECTED]> > > --- > > Andrew: Why is it tp->pdev instead of pdev? > > drivers/net/tulip/tulip_core.c |1 + > 1 file changed, 1 insertion(+) > > Index: b/drivers/net/tulip/tulip_core.c > === > --- a/drivers/net/tulip/tulip_core.c > +++ b/drivers/net/tulip/tulip_core.c > @@ -1798,6 +1798,7 @@ static void __devexit tulip_remove_one ( > return; > > tp = netdev_priv(dev); > + pci_disable_device(tp->pdev); > unregister_netdev(dev); > pci_free_consistent (pdev, >sizeof (struct tulip_rx_desc) * RX_RING_SIZE + - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [parisc-linux] [git patches] tulip fixes from parisc-linux
On Sun, Jul 30, 2006 at 02:54:56PM -0400, Kyle McMartin wrote: > On Sun, Jul 30, 2006 at 11:35:32AM -0700, Andrew Morton wrote: > > hm. A couple of those patches have been futzing around in -mm for over a > > year and have been nacked by Jeff and are a regular source of grumpygrams. > > I've been sitting on them in the pathetic hope that someone will one day > > get down and address the bugs which they fix in an acceptable fashion, > > whatever that is. > > > > Jeff/Val seemed willing to merge the fixes as they stood. parisc-linux > merged Francois' tulip workqueue patch some time ago, and have been > running with it since without issue. This defers the tulip_select_media > work to process context, and so should be less of an issue. Hey Kyle, Thanks for splitting these out. Could you do us a favor and post the patches themselves? I'm not the only one who doesn't use git, and it will be a lot less confusing if we can directly ack the patches in email instead of referring to them third-hand. Thanks, -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 6/9] [TULIP] Fix IRQ/DMA race
On Wed, Aug 09, 2006 at 01:35:05AM -0400, Jeff Garzik wrote: > Kyle McMartin wrote: > >From: Grant Grundler <[EMAIL PROTECTED]> > > > >IRQs are racing with tulip_down(). > >DMA can be restarted by tulip_interrupt() _after_ we call > >tulip_stop_rxtx() and the DMA buffers are unmapped. The result > >is an MCA (hard crash on ia64) because of an IO TLB miss. > > > >Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> > >Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> > >--- > > drivers/net/tulip/interrupt.c |4 > > drivers/net/tulip/tulip_core.c | 17 +++-- > > 2 files changed, 11 insertions(+), 10 deletions(-) > > > >diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c > >index 99ccf2e..19faa0e 100644 > >--- a/drivers/net/tulip/interrupt.c > >+++ b/drivers/net/tulip/interrupt.c > >@@ -87,6 +87,10 @@ int tulip_refill_rx(struct net_device *d > > } > > tp->rx_ring[entry].status = cpu_to_le32(DescOwned); > > } > >+ > >+/* FIXME: restarting DMA breaks tulip_down() code path. > >+ tulip_down() will unmap the RX and TX descriptors. > >+ */ > > if(tp->chip_id == LC82C168) { > > if(((ioread32(tp->base_addr + CSR5)>>17)&0x07) == 4) { > > /* Rx stopped due to out of buffers, > >diff --git a/drivers/net/tulip/tulip_core.c > >b/drivers/net/tulip/tulip_core.c > >index 81905f4..363e5f6 100644 > >--- a/drivers/net/tulip/tulip_core.c > >+++ b/drivers/net/tulip/tulip_core.c > >@@ -742,21 +742,20 @@ #endif > > > > /* Disable interrupts by clearing the interrupt mask. */ > > iowrite32 (0x, ioaddr + CSR7); > >+ioread32 (ioaddr + CSR7); /* flush posted write */ > > > >-/* Stop the Tx and Rx processes. */ > >-tulip_stop_rxtx(tp); > >+spin_unlock_irqrestore (&tp->lock, flags); > > > >-/* prepare receive buffers */ > >-tulip_refill_rx(dev); > >+free_irq (dev->irq, dev); /* no more races after this */ > >+tulip_stop_rxtx(tp);/* Stop DMA */ > > same old comment: need to stop DMA before releasing interrupt handler. I'm testing my implementation of a version that checks for in-progress shutdown in the interupt handler; unfortunately TX died in overnight testing so there's more work to do. -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 38/41] xircom_cb: wire up errors from pci_register_driver()
On Mon, Aug 14, 2006 at 11:00:28PM -0700, [EMAIL PROTECTED] wrote: > From: Alexey Dobriyan <[EMAIL PROTECTED]> > > Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]> > Cc: Jeff Garzik <[EMAIL PROTECTED]> > Cc: Dominik Brodowski <[EMAIL PROTECTED]> > Cc: Valerie Henson <[EMAIL PROTECTED]> > Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Ack. Add my: Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> -VAL > --- > > drivers/net/tulip/xircom_cb.c |3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff -puN > drivers/net/tulip/xircom_cb.c~xircom_cb-wire-up-errors-from-pci_register_driver > drivers/net/tulip/xircom_cb.c > --- > a/drivers/net/tulip/xircom_cb.c~xircom_cb-wire-up-errors-from-pci_register_driver > +++ a/drivers/net/tulip/xircom_cb.c > @@ -1264,8 +1264,7 @@ static void investigate_write_descriptor > > static int __init xircom_init(void) > { > - pci_register_driver(&xircom_ops); > - return 0; > + return pci_register_driver(&xircom_ops); > } > > static void __exit xircom_exit(void) > _ > - > To unsubscribe from this list: send the line "unsubscribe netdev" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Proper pci_enable_device() error handling in resume routine
Hello, I'm trying to properly handle pci_enable_device() errors in the resume routines of a couple of tulip drivers. I noticed that several drivers pay attention to errors from pci_enable_device() in the init routine but ignore it on resume; other drivers vary wildly. What's proper behavior when resuming? Extant examples: 0. Don't call pci_enable_device() at all (8139too) 1. Ignore the return value (eepro100, many others) 2. Check for failure and bail out, but return success (sungem) -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Proper pci_enable_device() error handling in resume routine
On Mon, Aug 21, 2006 at 11:12:03AM -0700, Auke Kok wrote: > Valerie Henson wrote: > >I'm trying to properly handle pci_enable_device() errors in the resume > >routines of a couple of tulip drivers. I noticed that several drivers > >pay attention to errors from pci_enable_device() in the init routine > >but ignore it on resume; other drivers vary wildly. What's proper > >behavior when resuming? Extant examples: > > > >0. Don't call pci_enable_device() at all (8139too) > >1. Ignore the return value (eepro100, many others) > >2. Check for failure and bail out, but return success (sungem) > > Digging through e1000 I spot that we even pci_enable_device after a PCI > error, so it is good practice I think to make sure the device is up. I > suppose that most people can live without explicit re-enabling the device > (most NICs are on anyway), but if we do enable it explicitly we should > certainly check the result code. Interestingly enough we failed to do this > in e1000, so I'll submit a patch for that later. For people looking for how to implement this in their own driver, here's how I solved it in tulip (will submit later): --- drivers/net/tulip/tulip_core.c |5 - drivers/net/tulip/winbond-840.c | 10 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c @@ -1780,7 +1780,10 @@ static int tulip_resume(struct pci_dev * pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); - pci_enable_device(pdev); + if ((retval = pci_enable_device(pdev))) { + printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); + return retval; + } if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) { printk (KERN_ERR "tulip: request_irq failed in resume\n"); -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 02/10] [TULIP] Print physical address in tulip_init_one
From: Grant Grundler <[EMAIL PROTECTED]> As the cookie returned by pci_iomap() is fairly useless... [Compile warning on pci_resource_start() format fixed up by Valerie Henson.] Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip_core.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -1656,8 +1656,14 @@ static int __devinit tulip_init_one (str if (register_netdev(dev)) goto err_out_free_ring; - printk(KERN_INFO "%s: %s rev %d at %p,", - dev->name, chip_name, chip_rev, ioaddr); + printk(KERN_INFO "%s: %s rev %d at " +#ifdef CONFIG_TULIP_MMIO + "MMIO" +#else + "Port" +#endif + " %#llx,", dev->name, chip_name, chip_rev, + (unsigned long long) pci_resource_start(pdev, TULIP_BAR)); pci_set_drvdata(pdev, dev); if (eeprom_missing) -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 01/10] [TULIP] Change tulip maintainer
Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> MAINTAINERS|4 ++-- drivers/net/tulip/21142.c |2 +- drivers/net/tulip/eeprom.c |2 +- drivers/net/tulip/interrupt.c |2 +- drivers/net/tulip/media.c |2 +- drivers/net/tulip/pnic.c |2 +- drivers/net/tulip/pnic2.c |2 +- drivers/net/tulip/timer.c |2 +- drivers/net/tulip/tulip_core.c |2 +- 9 files changed, 10 insertions(+), 10 deletions(-) --- linux-2.6.18-rc4-mm1.orig/MAINTAINERS +++ linux-2.6.18-rc4-mm1/MAINTAINERS @@ -2956,8 +2956,8 @@ W:http://www.auk.cx/tms380tr/ S: Maintained TULIP NETWORK DRIVER -P: Jeff Garzik -M: [EMAIL PROTECTED] +P: Valerie Henson +M: [EMAIL PROTECTED] L: [EMAIL PROTECTED] W: http://sourceforge.net/projects/tulip/ S: Maintained --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/21142.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/21142.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/21142.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/eeprom.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/eeprom.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/eeprom.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/interrupt.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/interrupt.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/interrupt.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/media.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/media.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/media.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/pnic.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/pnic.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/pnic.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/pnic2.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/pnic2.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/pnic2.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. Modified to hep support PNIC_II by Kevin B. Hendricks --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/timer.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/timer.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/timer.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -1,7 +1,7 @@ /* tulip_core.c: A DEC 21x4x-family ethernet driver for Linux. */ /* - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 08/10] [TULIP] Handle pci_enable_device() errors in resume
Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/de2104x.c | 16 ++-- drivers/net/tulip/tulip_core.c |5 - drivers/net/tulip/winbond-840.c | 10 +++--- 3 files changed, 21 insertions(+), 10 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -1780,7 +1780,10 @@ static int tulip_resume(struct pci_dev * pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); - pci_enable_device(pdev); + if ((retval = pci_enable_device(pdev))) { + printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); + return retval; + } if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) { printk (KERN_ERR "tulip: request_irq failed in resume\n"); --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/winbond-840.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/winbond-840.c @@ -1626,14 +1626,18 @@ static int w840_resume (struct pci_dev * { struct net_device *dev = pci_get_drvdata (pdev); struct netdev_private *np = netdev_priv(dev); + int retval; rtnl_lock(); if (netif_device_present(dev)) goto out; /* device not suspended */ if (netif_running(dev)) { - pci_enable_device(pdev); - /* pci_power_on(pdev); */ - + if ((retval = pci_enable_device(pdev))) { + printk (KERN_ERR + "%s: pci_enable_device failed in resume\n", + dev->name); + return retval; + } spin_lock_irq(&np->lock); iowrite32(1, np->base_addr+PCIBusCfg); ioread32(np->base_addr+PCIBusCfg); --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/de2104x.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/de2104x.c @@ -2138,17 +2138,21 @@ static int de_resume (struct pci_dev *pd { struct net_device *dev = pci_get_drvdata (pdev); struct de_private *de = dev->priv; + int retval; rtnl_lock(); if (netif_device_present(dev)) goto out; - if (netif_running(dev)) { - pci_enable_device(pdev); - de_init_hw(de); - netif_device_attach(dev); - } else { - netif_device_attach(dev); + if (!netif_running(dev)) + goto out_attach; + if ((retval = pci_enable_device(pdev))) { + printk (KERN_ERR "%s: pci_enable_device failed in resume\n", + dev->name); + return retval; } + de_init_hw(de); +out_attach: + netif_device_attach(dev); out: rtnl_unlock(); return 0; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 00/10] [TULIP] Tulip update
This patch set includes all the non-controversial tulip patches from the parisc tree, plus a few extra cleanups. The major highlight is the patch moving tulip_select_media() and its associated delay to a work queue, a nice piece of work from Francois Romieu, with some tweaks by Kyle McMartin. -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 06/10] [TULIP] Clean up tulip.h
From: Grant Grundler <[EMAIL PROTECTED]> Update/cleanup some definitions in tulip.h and tulip_core.c. Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip.h | 17 +++-- drivers/net/tulip/tulip_core.c |7 ++- 2 files changed, 13 insertions(+), 11 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip.h +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip.h @@ -30,11 +30,10 @@ /* undefine, or define to various debugging levels (>4 == obscene levels) */ #define TULIP_DEBUG 1 -/* undefine USE_IO_OPS for MMIO, define for PIO */ #ifdef CONFIG_TULIP_MMIO -# undef USE_IO_OPS +#define TULIP_BAR 1 /* CBMA */ #else -# define USE_IO_OPS 1 +#define TULIP_BAR 0 /* CBIO */ #endif @@ -143,6 +142,7 @@ enum status_bits { RxNoBuf = 0x80, RxIntr = 0x40, TxFIFOUnderflow = 0x20, + RxErrIntr = 0x10, TxJabber = 0x08, TxNoBuf = 0x04, TxDied = 0x02, @@ -193,9 +193,14 @@ struct tulip_tx_desc { enum desc_status_bits { - DescOwned = 0x8000, - RxDescFatalErr = 0x8000, - RxWholePkt = 0x0300, + DescOwned= 0x8000, + DescWholePkt = 0x6000, + DescEndPkt = 0x4000, + DescStartPkt = 0x2000, + DescEndRing = 0x0200, + DescUseLink = 0x0100, + RxDescFatalErr = 0x008000, + RxWholePkt = 0x0300, }; --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -1369,11 +1369,8 @@ static int __devinit tulip_init_one (str if (pci_request_regions (pdev, "tulip")) goto err_out_free_netdev; -#ifndef USE_IO_OPS - ioaddr = pci_iomap(pdev, 1, tulip_tbl[chip_idx].io_size); -#else - ioaddr = pci_iomap(pdev, 0, tulip_tbl[chip_idx].io_size); -#endif + ioaddr = pci_iomap(pdev, TULIP_BAR, tulip_tbl[chip_idx].io_size); + if (!ioaddr) goto err_out_free_res; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 04/10] [TULIP] Flush MMIO writes in reset sequence
From: Grant Grundler <[EMAIL PROTECTED]> The obvious safe registers to read is one from PCI config space. Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip_core.c |2 ++ 1 files changed, 2 insertions(+) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -295,12 +295,14 @@ static void tulip_up(struct net_device * /* Reset the chip, holding bit 0 set at least 50 PCI cycles. */ iowrite32(0x0001, ioaddr + CSR0); + pci_read_config_dword(tp->pdev, PCI_COMMAND, &i); /* flush write */ udelay(100); /* Deassert reset. Wait the specified 50 PCI cycles after a reset by initializing Tx and Rx queues and the address filter list. */ iowrite32(tp->csr0, ioaddr + CSR0); + pci_read_config_dword(tp->pdev, PCI_COMMAND, &i); /* flush write */ udelay(100); if (tulip_debug > 1) -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 07/10] [TULIP] Use tulip.h in winbond-840.c
From: Grant Grundler <[EMAIL PROTECTED]> Include "tulip.h" in winbond-840.c and clean up lots of redundant definitions. Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/winbond-840.c | 68 ++-- 1 files changed, 24 insertions(+), 44 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/winbond-840.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/winbond-840.c @@ -90,10 +90,8 @@ static int full_duplex[MAX_UNITS] = {-1, Making the Tx ring too large decreases the effectiveness of channel bonding and packet priority. There are no ill effects from too-large receive rings. */ -#define TX_RING_SIZE 16 #define TX_QUEUE_LEN 10 /* Limit ring entries actually used. */ #define TX_QUEUE_LEN_RESTART 5 -#define RX_RING_SIZE 32 #define TX_BUFLIMIT(1024-128) @@ -137,6 +135,8 @@ static int full_duplex[MAX_UNITS] = {-1, #include #include +#include "tulip.h" + /* These identify the driver base version and may not be removed. */ static char version[] = KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " DRV_RELDATE " Donald Becker <[EMAIL PROTECTED]>\n" @@ -242,8 +242,8 @@ static const struct pci_id_info pci_id_t }; /* This driver was written to use PCI memory space, however some x86 systems - work only with I/O space accesses. Pass -DUSE_IO_OPS to use PCI I/O space - accesses instead of memory space. */ + work only with I/O space accesses. See CONFIG_TULIP_MMIO in .config +*/ /* Offsets to the Command and Status Registers, "CSRs". While similar to the Tulip, these registers are longword aligned. @@ -261,21 +261,11 @@ enum w840_offsets { CurTxDescAddr=0x4C, CurTxBufAddr=0x50, }; -/* Bits in the interrupt status/enable registers. */ -/* The bits in the Intr Status/Enable registers, mostly interrupt sources. */ -enum intr_status_bits { - NormalIntr=0x1, AbnormalIntr=0x8000, - IntrPCIErr=0x2000, TimerInt=0x800, - IntrRxDied=0x100, RxNoBuf=0x80, IntrRxDone=0x40, - TxFIFOUnderflow=0x20, RxErrIntr=0x10, - TxIdle=0x04, IntrTxStopped=0x02, IntrTxDone=0x01, -}; - /* Bits in the NetworkConfig register. */ enum rx_mode_bits { - AcceptErr=0x80, AcceptRunt=0x40, - AcceptBroadcast=0x20, AcceptMulticast=0x10, - AcceptAllPhys=0x08, AcceptMyPhys=0x02, + AcceptErr=0x80, + RxAcceptBroadcast=0x20, AcceptMulticast=0x10, + RxAcceptAllPhys=0x08, AcceptMyPhys=0x02, }; enum mii_reg_bits { @@ -297,13 +287,6 @@ struct w840_tx_desc { u32 buffer1, buffer2; }; -/* Bits in network_desc.status */ -enum desc_status_bits { - DescOwn=0x8000, DescEndRing=0x0200, DescUseLink=0x0100, - DescWholePkt=0x6000, DescStartPkt=0x2000, DescEndPkt=0x4000, - DescIntr=0x8000, -}; - #define MII_CNT1 /* winbond only supports one MII */ struct netdev_private { struct w840_rx_desc *rx_ring; @@ -371,7 +354,6 @@ static int __devinit w840_probe1 (struct int irq; int i, option = find_cnt < MAX_UNITS ? options[find_cnt] : 0; void __iomem *ioaddr; - int bar = 1; i = pci_enable_device(pdev); if (i) return i; @@ -393,10 +375,8 @@ static int __devinit w840_probe1 (struct if (pci_request_regions(pdev, DRV_NAME)) goto err_out_netdev; -#ifdef USE_IO_OPS - bar = 0; -#endif - ioaddr = pci_iomap(pdev, bar, netdev_res_size); + + ioaddr = pci_iomap(pdev, TULIP_BAR, netdev_res_size); if (!ioaddr) goto err_out_free_res; @@ -838,7 +818,7 @@ static void init_rxtx_rings(struct net_d np->rx_buf_sz,PCI_DMA_FROMDEVICE); np->rx_ring[i].buffer1 = np->rx_addr[i]; - np->rx_ring[i].status = DescOwn; + np->rx_ring[i].status = DescOwned; } np->cur_rx = 0; @@ -923,7 +903,7 @@ static void init_registers(struct net_de } #elif defined(__powerpc__) || defined(__i386__) || defined(__alpha__) || defined(__ia64__) || defined(__x86_64__) i |= 0xE000; -#elif defined(__sparc__) +#elif defined(__sparc__) || defined (CONFIG_PARISC) i |= 0x4800; #else #warning Processor architecture undefined @@ -1043,11 +1023,11 @@ static int start_tx(struct sk_buff *skb, /* Now acquire the irq spinlock. * The difficult race is the the ordering between -* increasing np->cur_tx and setting DescOwn: +* increasing np->cur_tx and setting DescOwned: * - if np->cur_tx is increased first the interrupt * handler could consider the packet as transmitted -* s
[patch 09/10] [TULIP] Update tulip version
Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip_core.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -17,11 +17,11 @@ #define DRV_NAME "tulip" #ifdef CONFIG_TULIP_NAPI -#define DRV_VERSION"1.1.14-NAPI" /* Keep at least for test */ +#define DRV_VERSION"1.1.15-NAPI" /* Keep at least for test */ #else -#define DRV_VERSION"1.1.14" +#define DRV_VERSION"1.1.15" #endif -#define DRV_RELDATE"May 6, 2006" +#define DRV_RELDATE"Aug 23, 2006" #include -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 03/10] [TULIP] Make DS21143 printout match lspci output
From: Thibaut Varene <[EMAIL PROTECTED]> Signed-off-by: Thibaut Varene <[EMAIL PROTECTED]> Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip_core.c |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -147,7 +147,7 @@ struct tulip_chip_table tulip_tbl[] = { HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_PCI_MWI, tulip_timer }, /* DC21142, DC21143 */ - { "Digital DS21143 Tulip", 128, 0x0801fbff, + { "Digital DS21142/43 Tulip", 128, 0x0801fbff, HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII | HAS_ACPI | HAS_NWAY | HAS_INTR_MITIGATION | HAS_PCI_MWI, t21142_timer }, -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 10/10] [TULIP] Update winbond840.c version
Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/winbond-840.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/winbond-840.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/winbond-840.c @@ -45,8 +45,8 @@ */ #define DRV_NAME "winbond-840" -#define DRV_VERSION"1.01-d" -#define DRV_RELDATE"Nov-17-2001" +#define DRV_VERSION"1.01-e" +#define DRV_RELDATE"Aug-23-2006" /* Automatically extracted configuration info: -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 05/10] [TULIP] Defer tulip_select_media() to process context
From: Francois Romieu <[EMAIL PROTECTED]> Move tulip_select_media() processing to a workqueue, instead of delaying in interrupt context, edited by Kyle McMartin to use kevent thread, instead of creating its own workqueue. Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/21142.c |4 +- drivers/net/tulip/timer.c | 14 +++- drivers/net/tulip/tulip.h | 19 ++-- drivers/net/tulip/tulip_core.c | 64 +++-- 4 files changed, 60 insertions(+), 41 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/21142.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/21142.c @@ -26,9 +26,9 @@ static u16 t21142_csr15[] = { 0x0008, 0x /* Handle the 21143 uniquely: do autoselect with NWay, not the EEPROM list of available transceivers. */ -void t21142_timer(unsigned long data) +void t21142_media_task(void *data) { - struct net_device *dev = (struct net_device *)data; + struct net_device *dev = data; struct tulip_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->base_addr; int csr12 = ioread32(ioaddr + CSR12); --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/timer.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/timer.c @@ -18,13 +18,14 @@ #include "tulip.h" -void tulip_timer(unsigned long data) +void tulip_media_task(void *data) { - struct net_device *dev = (struct net_device *)data; + struct net_device *dev = data; struct tulip_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->base_addr; u32 csr12 = ioread32(ioaddr + CSR12); int next_tick = 2*HZ; + unsigned long flags; if (tulip_debug > 2) { printk(KERN_DEBUG "%s: Media selection tick, %s, status %8.8x mode" @@ -126,6 +127,15 @@ void tulip_timer(unsigned long data) } break; } + + + spin_lock_irqsave(&tp->lock, flags); + if (tp->timeout_recovery) { + tulip_tx_timeout_complete(tp, ioaddr); + tp->timeout_recovery = 0; + } + spin_unlock_irqrestore(&tp->lock, flags); + /* mod_timer synchronizes us with potential add_timer calls * from interrupts. */ --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip.h +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip.h @@ -44,7 +44,8 @@ struct tulip_chip_table { int io_size; int valid_intrs;/* CSR7 interrupt enable settings */ int flags; - void (*media_timer) (unsigned long data); + void (*media_timer) (unsigned long); + void (*media_task) (void *); }; @@ -366,6 +367,7 @@ struct tulip_private { unsigned int medialock:1; /* Don't sense media type. */ unsigned int mediasense:1; /* Media sensing in progress. */ unsigned int nway:1, nwayset:1; /* 21143 internal NWay. */ + unsigned int timeout_recovery:1; unsigned int csr0; /* CSR0 setting. */ unsigned int csr6; /* Current CSR6 control settings. */ unsigned char eeprom[EEPROM_SIZE]; /* Serial EEPROM contents. */ @@ -384,6 +386,7 @@ struct tulip_private { void __iomem *base_addr; int csr12_shadow; int pad0; /* Used for 8-byte alignment */ + struct work_struct media_work; }; @@ -398,7 +401,7 @@ struct eeprom_fixup { /* 21142.c */ extern u16 t21142_csr14[]; -void t21142_timer(unsigned long data); +void t21142_media_task(void *data); void t21142_start_nway(struct net_device *dev); void t21142_lnk_change(struct net_device *dev, int csr5); @@ -436,7 +439,7 @@ void pnic_lnk_change(struct net_device * void pnic_timer(unsigned long data); /* timer.c */ -void tulip_timer(unsigned long data); +void tulip_media_task(void *data); void mxic_timer(unsigned long data); void comet_timer(unsigned long data); @@ -488,4 +491,14 @@ static inline void tulip_restart_rxtx(st tulip_start_rxtx(tp); } +static inline void tulip_tx_timeout_complete(struct tulip_private *tp, void __iomem *ioaddr) +{ + /* Stop and restart the chip's Tx processes. */ + tulip_restart_rxtx(tp); + /* Trigger an immediate transmit demand. */ + iowrite32(0, ioaddr + CSR1); + + tp->stats.tx_errors++; +} + #endif /* __NET_TULIP_H__ */ --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -130,7 +130,14 @@ int tulip_debug = TULIP_DEBUG; int tulip_debug = 1; #endif +static void tulip_timer(unsigned long data) +{ + struct net_device *dev = (struct net_device *)data; + struct tulip_private *tp = netdev_priv(dev); + if (netif_running(dev)) + schedule_work(&tp->media_work); +} /* * T
Re: [patch 08/10] [TULIP] Handle pci_enable_device() errors in resume
On Sat, Aug 26, 2006 at 05:41:58PM +0100, Alan Cox wrote: > Ar Gwe, 2006-08-25 am 17:02 -0700, ysgrifennodd Valerie Henson: > > pci_set_power_state(pdev, PCI_D0); > > pci_restore_state(pdev); > > > > - pci_enable_device(pdev); > > + if ((retval = pci_enable_device(pdev))) { > > + printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); > > + return retval; > > + } > Should you not stick it back in D3 if you are being neat about this ? I don't know. Any thoughts from the peanut gallery? I've spent some time trolling both docs and other drivers, but I haven't yet found an example of a driver that correctly handles all the resume error cases. Also, at least one other driver does a pci_disable_device() if the request_irq() fails - should tulip do this too? > NAK: What about rtnl_lock() Gah. Thanks, how about the patch below instead? -VAL Subject: [TULIP] Handle pci_enable_device() errors in resume Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/de2104x.c | 16 ++-- drivers/net/tulip/tulip_core.c |5 - drivers/net/tulip/winbond-840.c | 12 3 files changed, 22 insertions(+), 11 deletions(-) --- linux-2.6.18-rc4-mm1-tulip.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1-tulip/drivers/net/tulip/tulip_core.c @@ -1780,7 +1780,10 @@ static int tulip_resume(struct pci_dev * pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); - pci_enable_device(pdev); + if ((retval = pci_enable_device(pdev))) { + printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); + return retval; + } if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) { printk (KERN_ERR "tulip: request_irq failed in resume\n"); --- linux-2.6.18-rc4-mm1-tulip.orig/drivers/net/tulip/winbond-840.c +++ linux-2.6.18-rc4-mm1-tulip/drivers/net/tulip/winbond-840.c @@ -1626,14 +1626,18 @@ static int w840_resume (struct pci_dev * { struct net_device *dev = pci_get_drvdata (pdev); struct netdev_private *np = netdev_priv(dev); + int retval = 0; rtnl_lock(); if (netif_device_present(dev)) goto out; /* device not suspended */ if (netif_running(dev)) { - pci_enable_device(pdev); - /* pci_power_on(pdev); */ - + if ((retval = pci_enable_device(pdev))) { + printk (KERN_ERR + "%s: pci_enable_device failed in resume\n", + dev->name); + goto out; + } spin_lock_irq(&np->lock); iowrite32(1, np->base_addr+PCIBusCfg); ioread32(np->base_addr+PCIBusCfg); @@ -1651,7 +1655,7 @@ static int w840_resume (struct pci_dev * } out: rtnl_unlock(); - return 0; + return retval; } #endif --- linux-2.6.18-rc4-mm1-tulip.orig/drivers/net/tulip/de2104x.c +++ linux-2.6.18-rc4-mm1-tulip/drivers/net/tulip/de2104x.c @@ -2138,17 +2138,21 @@ static int de_resume (struct pci_dev *pd { struct net_device *dev = pci_get_drvdata (pdev); struct de_private *de = dev->priv; + int retval = 0; rtnl_lock(); if (netif_device_present(dev)) goto out; - if (netif_running(dev)) { - pci_enable_device(pdev); - de_init_hw(de); - netif_device_attach(dev); - } else { - netif_device_attach(dev); + if (!netif_running(dev)) + goto out_attach; + if ((retval = pci_enable_device(pdev))) { + printk (KERN_ERR "%s: pci_enable_device failed in resume\n", + dev->name); + goto out; } + de_init_hw(de); +out_attach: + netif_device_attach(dev); out: rtnl_unlock(); return 0; - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 00/10] [TULIP] Tulip update
[Resend with bugs fixed.] This patch set includes all the non-controversial tulip patches from the parisc tree, plus a few extra cleanups. The major highlight is the patch moving tulip_select_media() and its associated delay to a work queue, a nice piece of work from Francois Romieu, with some tweaks by Kyle McMartin. -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 01/10] [TULIP] Change tulip maintainer
Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> MAINTAINERS|4 ++-- drivers/net/tulip/21142.c |2 +- drivers/net/tulip/eeprom.c |2 +- drivers/net/tulip/interrupt.c |2 +- drivers/net/tulip/media.c |2 +- drivers/net/tulip/pnic.c |2 +- drivers/net/tulip/pnic2.c |2 +- drivers/net/tulip/timer.c |2 +- drivers/net/tulip/tulip_core.c |2 +- 9 files changed, 10 insertions(+), 10 deletions(-) --- linux-2.6.18-rc4-mm1.orig/MAINTAINERS +++ linux-2.6.18-rc4-mm1/MAINTAINERS @@ -2956,8 +2956,8 @@ W:http://www.auk.cx/tms380tr/ S: Maintained TULIP NETWORK DRIVER -P: Jeff Garzik -M: [EMAIL PROTECTED] +P: Valerie Henson +M: [EMAIL PROTECTED] L: [EMAIL PROTECTED] W: http://sourceforge.net/projects/tulip/ S: Maintained --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/21142.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/21142.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/21142.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/eeprom.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/eeprom.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/eeprom.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/interrupt.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/interrupt.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/interrupt.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/media.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/media.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/media.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/pnic.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/pnic.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/pnic.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/pnic2.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/pnic2.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/pnic2.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. Modified to hep support PNIC_II by Kevin B. Hendricks --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/timer.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/timer.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/timer.c - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -1,7 +1,7 @@ /* tulip_core.c: A DEC 21x4x-family ethernet driver for Linux. */ /* - Maintained by Jeff Garzik <[EMAIL PROTECTED]> + Maintained by Valerie Henson <[EMAIL PROTECTED]> Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 02/10] [TULIP] Print physical address in tulip_init_one
From: Grant Grundler <[EMAIL PROTECTED]> As the cookie returned by pci_iomap() is fairly useless... [Compile warning on pci_resource_start() format fixed up by Valerie Henson.] Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip_core.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -1656,8 +1656,14 @@ static int __devinit tulip_init_one (str if (register_netdev(dev)) goto err_out_free_ring; - printk(KERN_INFO "%s: %s rev %d at %p,", - dev->name, chip_name, chip_rev, ioaddr); + printk(KERN_INFO "%s: %s rev %d at " +#ifdef CONFIG_TULIP_MMIO + "MMIO" +#else + "Port" +#endif + " %#llx,", dev->name, chip_name, chip_rev, + (unsigned long long) pci_resource_start(pdev, TULIP_BAR)); pci_set_drvdata(pdev, dev); if (eeprom_missing) -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 04/10] [TULIP] Flush MMIO writes in reset sequence
From: Grant Grundler <[EMAIL PROTECTED]> The obvious safe registers to read is one from PCI config space. Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip_core.c |2 ++ 1 files changed, 2 insertions(+) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -295,12 +295,14 @@ static void tulip_up(struct net_device * /* Reset the chip, holding bit 0 set at least 50 PCI cycles. */ iowrite32(0x0001, ioaddr + CSR0); + pci_read_config_dword(tp->pdev, PCI_COMMAND, &i); /* flush write */ udelay(100); /* Deassert reset. Wait the specified 50 PCI cycles after a reset by initializing Tx and Rx queues and the address filter list. */ iowrite32(tp->csr0, ioaddr + CSR0); + pci_read_config_dword(tp->pdev, PCI_COMMAND, &i); /* flush write */ udelay(100); if (tulip_debug > 1) -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 07/10] [TULIP] Use tulip.h in winbond-840.c
From: Grant Grundler <[EMAIL PROTECTED]> Include "tulip.h" in winbond-840.c and clean up lots of redundant definitions. Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/winbond-840.c | 68 ++-- 1 files changed, 24 insertions(+), 44 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/winbond-840.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/winbond-840.c @@ -90,10 +90,8 @@ static int full_duplex[MAX_UNITS] = {-1, Making the Tx ring too large decreases the effectiveness of channel bonding and packet priority. There are no ill effects from too-large receive rings. */ -#define TX_RING_SIZE 16 #define TX_QUEUE_LEN 10 /* Limit ring entries actually used. */ #define TX_QUEUE_LEN_RESTART 5 -#define RX_RING_SIZE 32 #define TX_BUFLIMIT(1024-128) @@ -137,6 +135,8 @@ static int full_duplex[MAX_UNITS] = {-1, #include #include +#include "tulip.h" + /* These identify the driver base version and may not be removed. */ static char version[] = KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " DRV_RELDATE " Donald Becker <[EMAIL PROTECTED]>\n" @@ -242,8 +242,8 @@ static const struct pci_id_info pci_id_t }; /* This driver was written to use PCI memory space, however some x86 systems - work only with I/O space accesses. Pass -DUSE_IO_OPS to use PCI I/O space - accesses instead of memory space. */ + work only with I/O space accesses. See CONFIG_TULIP_MMIO in .config +*/ /* Offsets to the Command and Status Registers, "CSRs". While similar to the Tulip, these registers are longword aligned. @@ -261,21 +261,11 @@ enum w840_offsets { CurTxDescAddr=0x4C, CurTxBufAddr=0x50, }; -/* Bits in the interrupt status/enable registers. */ -/* The bits in the Intr Status/Enable registers, mostly interrupt sources. */ -enum intr_status_bits { - NormalIntr=0x1, AbnormalIntr=0x8000, - IntrPCIErr=0x2000, TimerInt=0x800, - IntrRxDied=0x100, RxNoBuf=0x80, IntrRxDone=0x40, - TxFIFOUnderflow=0x20, RxErrIntr=0x10, - TxIdle=0x04, IntrTxStopped=0x02, IntrTxDone=0x01, -}; - /* Bits in the NetworkConfig register. */ enum rx_mode_bits { - AcceptErr=0x80, AcceptRunt=0x40, - AcceptBroadcast=0x20, AcceptMulticast=0x10, - AcceptAllPhys=0x08, AcceptMyPhys=0x02, + AcceptErr=0x80, + RxAcceptBroadcast=0x20, AcceptMulticast=0x10, + RxAcceptAllPhys=0x08, AcceptMyPhys=0x02, }; enum mii_reg_bits { @@ -297,13 +287,6 @@ struct w840_tx_desc { u32 buffer1, buffer2; }; -/* Bits in network_desc.status */ -enum desc_status_bits { - DescOwn=0x8000, DescEndRing=0x0200, DescUseLink=0x0100, - DescWholePkt=0x6000, DescStartPkt=0x2000, DescEndPkt=0x4000, - DescIntr=0x8000, -}; - #define MII_CNT1 /* winbond only supports one MII */ struct netdev_private { struct w840_rx_desc *rx_ring; @@ -371,7 +354,6 @@ static int __devinit w840_probe1 (struct int irq; int i, option = find_cnt < MAX_UNITS ? options[find_cnt] : 0; void __iomem *ioaddr; - int bar = 1; i = pci_enable_device(pdev); if (i) return i; @@ -393,10 +375,8 @@ static int __devinit w840_probe1 (struct if (pci_request_regions(pdev, DRV_NAME)) goto err_out_netdev; -#ifdef USE_IO_OPS - bar = 0; -#endif - ioaddr = pci_iomap(pdev, bar, netdev_res_size); + + ioaddr = pci_iomap(pdev, TULIP_BAR, netdev_res_size); if (!ioaddr) goto err_out_free_res; @@ -838,7 +818,7 @@ static void init_rxtx_rings(struct net_d np->rx_buf_sz,PCI_DMA_FROMDEVICE); np->rx_ring[i].buffer1 = np->rx_addr[i]; - np->rx_ring[i].status = DescOwn; + np->rx_ring[i].status = DescOwned; } np->cur_rx = 0; @@ -923,7 +903,7 @@ static void init_registers(struct net_de } #elif defined(__powerpc__) || defined(__i386__) || defined(__alpha__) || defined(__ia64__) || defined(__x86_64__) i |= 0xE000; -#elif defined(__sparc__) +#elif defined(__sparc__) || defined (CONFIG_PARISC) i |= 0x4800; #else #warning Processor architecture undefined @@ -1043,11 +1023,11 @@ static int start_tx(struct sk_buff *skb, /* Now acquire the irq spinlock. * The difficult race is the the ordering between -* increasing np->cur_tx and setting DescOwn: +* increasing np->cur_tx and setting DescOwned: * - if np->cur_tx is increased first the interrupt * handler could consider the packet as transmitted -* s
[patch 03/10] [TULIP] Make DS21143 printout match lspci output
From: Thibaut Varene <[EMAIL PROTECTED]> Signed-off-by: Thibaut Varene <[EMAIL PROTECTED]> Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip_core.c |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -147,7 +147,7 @@ struct tulip_chip_table tulip_tbl[] = { HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_PCI_MWI, tulip_timer }, /* DC21142, DC21143 */ - { "Digital DS21143 Tulip", 128, 0x0801fbff, + { "Digital DS21142/43 Tulip", 128, 0x0801fbff, HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII | HAS_ACPI | HAS_NWAY | HAS_INTR_MITIGATION | HAS_PCI_MWI, t21142_timer }, -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 09/10] [TULIP] Update tulip version
Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip_core.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -17,11 +17,11 @@ #define DRV_NAME "tulip" #ifdef CONFIG_TULIP_NAPI -#define DRV_VERSION"1.1.14-NAPI" /* Keep at least for test */ +#define DRV_VERSION"1.1.15-NAPI" /* Keep at least for test */ #else -#define DRV_VERSION"1.1.14" +#define DRV_VERSION"1.1.15" #endif -#define DRV_RELDATE"May 6, 2006" +#define DRV_RELDATE"Aug 23, 2006" #include -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 08/10] [TULIP] Handle pci_enable_device() errors in resume
Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/de2104x.c | 16 ++-- drivers/net/tulip/tulip_core.c |5 - drivers/net/tulip/winbond-840.c | 12 3 files changed, 22 insertions(+), 11 deletions(-) --- linux-2.6.18-rc4-mm1-tulip.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1-tulip/drivers/net/tulip/tulip_core.c @@ -1780,7 +1780,10 @@ static int tulip_resume(struct pci_dev * pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); - pci_enable_device(pdev); + if ((retval = pci_enable_device(pdev))) { + printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); + return retval; + } if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) { printk (KERN_ERR "tulip: request_irq failed in resume\n"); --- linux-2.6.18-rc4-mm1-tulip.orig/drivers/net/tulip/winbond-840.c +++ linux-2.6.18-rc4-mm1-tulip/drivers/net/tulip/winbond-840.c @@ -1626,14 +1626,18 @@ static int w840_resume (struct pci_dev * { struct net_device *dev = pci_get_drvdata (pdev); struct netdev_private *np = netdev_priv(dev); + int retval = 0; rtnl_lock(); if (netif_device_present(dev)) goto out; /* device not suspended */ if (netif_running(dev)) { - pci_enable_device(pdev); - /* pci_power_on(pdev); */ - + if ((retval = pci_enable_device(pdev))) { + printk (KERN_ERR + "%s: pci_enable_device failed in resume\n", + dev->name); + goto out; + } spin_lock_irq(&np->lock); iowrite32(1, np->base_addr+PCIBusCfg); ioread32(np->base_addr+PCIBusCfg); @@ -1651,7 +1655,7 @@ static int w840_resume (struct pci_dev * } out: rtnl_unlock(); - return 0; + return retval; } #endif --- linux-2.6.18-rc4-mm1-tulip.orig/drivers/net/tulip/de2104x.c +++ linux-2.6.18-rc4-mm1-tulip/drivers/net/tulip/de2104x.c @@ -2138,17 +2138,21 @@ static int de_resume (struct pci_dev *pd { struct net_device *dev = pci_get_drvdata (pdev); struct de_private *de = dev->priv; + int retval = 0; rtnl_lock(); if (netif_device_present(dev)) goto out; - if (netif_running(dev)) { - pci_enable_device(pdev); - de_init_hw(de); - netif_device_attach(dev); - } else { - netif_device_attach(dev); + if (!netif_running(dev)) + goto out_attach; + if ((retval = pci_enable_device(pdev))) { + printk (KERN_ERR "%s: pci_enable_device failed in resume\n", + dev->name); + goto out; } + de_init_hw(de); +out_attach: + netif_device_attach(dev); out: rtnl_unlock(); return 0; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 05/10] [TULIP] Defer tulip_select_media() to process context
From: Francois Romieu <[EMAIL PROTECTED]> Move tulip_select_media() processing to a workqueue, instead of delaying in interrupt context, edited by Kyle McMartin to use kevent thread, instead of creating its own workqueue. Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/21142.c |4 +- drivers/net/tulip/timer.c | 14 +++- drivers/net/tulip/tulip.h | 19 ++-- drivers/net/tulip/tulip_core.c | 64 +++-- 4 files changed, 60 insertions(+), 41 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/21142.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/21142.c @@ -26,9 +26,9 @@ static u16 t21142_csr15[] = { 0x0008, 0x /* Handle the 21143 uniquely: do autoselect with NWay, not the EEPROM list of available transceivers. */ -void t21142_timer(unsigned long data) +void t21142_media_task(void *data) { - struct net_device *dev = (struct net_device *)data; + struct net_device *dev = data; struct tulip_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->base_addr; int csr12 = ioread32(ioaddr + CSR12); --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/timer.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/timer.c @@ -18,13 +18,14 @@ #include "tulip.h" -void tulip_timer(unsigned long data) +void tulip_media_task(void *data) { - struct net_device *dev = (struct net_device *)data; + struct net_device *dev = data; struct tulip_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->base_addr; u32 csr12 = ioread32(ioaddr + CSR12); int next_tick = 2*HZ; + unsigned long flags; if (tulip_debug > 2) { printk(KERN_DEBUG "%s: Media selection tick, %s, status %8.8x mode" @@ -126,6 +127,15 @@ void tulip_timer(unsigned long data) } break; } + + + spin_lock_irqsave(&tp->lock, flags); + if (tp->timeout_recovery) { + tulip_tx_timeout_complete(tp, ioaddr); + tp->timeout_recovery = 0; + } + spin_unlock_irqrestore(&tp->lock, flags); + /* mod_timer synchronizes us with potential add_timer calls * from interrupts. */ --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip.h +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip.h @@ -44,7 +44,8 @@ struct tulip_chip_table { int io_size; int valid_intrs;/* CSR7 interrupt enable settings */ int flags; - void (*media_timer) (unsigned long data); + void (*media_timer) (unsigned long); + void (*media_task) (void *); }; @@ -366,6 +367,7 @@ struct tulip_private { unsigned int medialock:1; /* Don't sense media type. */ unsigned int mediasense:1; /* Media sensing in progress. */ unsigned int nway:1, nwayset:1; /* 21143 internal NWay. */ + unsigned int timeout_recovery:1; unsigned int csr0; /* CSR0 setting. */ unsigned int csr6; /* Current CSR6 control settings. */ unsigned char eeprom[EEPROM_SIZE]; /* Serial EEPROM contents. */ @@ -384,6 +386,7 @@ struct tulip_private { void __iomem *base_addr; int csr12_shadow; int pad0; /* Used for 8-byte alignment */ + struct work_struct media_work; }; @@ -398,7 +401,7 @@ struct eeprom_fixup { /* 21142.c */ extern u16 t21142_csr14[]; -void t21142_timer(unsigned long data); +void t21142_media_task(void *data); void t21142_start_nway(struct net_device *dev); void t21142_lnk_change(struct net_device *dev, int csr5); @@ -436,7 +439,7 @@ void pnic_lnk_change(struct net_device * void pnic_timer(unsigned long data); /* timer.c */ -void tulip_timer(unsigned long data); +void tulip_media_task(void *data); void mxic_timer(unsigned long data); void comet_timer(unsigned long data); @@ -488,4 +491,14 @@ static inline void tulip_restart_rxtx(st tulip_start_rxtx(tp); } +static inline void tulip_tx_timeout_complete(struct tulip_private *tp, void __iomem *ioaddr) +{ + /* Stop and restart the chip's Tx processes. */ + tulip_restart_rxtx(tp); + /* Trigger an immediate transmit demand. */ + iowrite32(0, ioaddr + CSR1); + + tp->stats.tx_errors++; +} + #endif /* __NET_TULIP_H__ */ --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -130,7 +130,14 @@ int tulip_debug = TULIP_DEBUG; int tulip_debug = 1; #endif +static void tulip_timer(unsigned long data) +{ + struct net_device *dev = (struct net_device *)data; + struct tulip_private *tp = netdev_priv(dev); + if (netif_running(dev)) + schedule_work(&tp->media_work); +} /* * T
[patch 10/10] [TULIP] Update winbond840.c version
Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/winbond-840.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/winbond-840.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/winbond-840.c @@ -45,8 +45,8 @@ */ #define DRV_NAME "winbond-840" -#define DRV_VERSION"1.01-d" -#define DRV_RELDATE"Nov-17-2001" +#define DRV_VERSION"1.01-e" +#define DRV_RELDATE"Aug-23-2006" /* Automatically extracted configuration info: -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 06/10] [TULIP] Clean up tulip.h
From: Grant Grundler <[EMAIL PROTECTED]> Update/cleanup some definitions in tulip.h and tulip_core.c. Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]> Signed-off-by: Valerie Henson <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip.h | 17 +++-- drivers/net/tulip/tulip_core.c |7 ++- 2 files changed, 13 insertions(+), 11 deletions(-) --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip.h +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip.h @@ -30,11 +30,10 @@ /* undefine, or define to various debugging levels (>4 == obscene levels) */ #define TULIP_DEBUG 1 -/* undefine USE_IO_OPS for MMIO, define for PIO */ #ifdef CONFIG_TULIP_MMIO -# undef USE_IO_OPS +#define TULIP_BAR 1 /* CBMA */ #else -# define USE_IO_OPS 1 +#define TULIP_BAR 0 /* CBIO */ #endif @@ -143,6 +142,7 @@ enum status_bits { RxNoBuf = 0x80, RxIntr = 0x40, TxFIFOUnderflow = 0x20, + RxErrIntr = 0x10, TxJabber = 0x08, TxNoBuf = 0x04, TxDied = 0x02, @@ -193,9 +193,14 @@ struct tulip_tx_desc { enum desc_status_bits { - DescOwned = 0x8000, - RxDescFatalErr = 0x8000, - RxWholePkt = 0x0300, + DescOwned= 0x8000, + DescWholePkt = 0x6000, + DescEndPkt = 0x4000, + DescStartPkt = 0x2000, + DescEndRing = 0x0200, + DescUseLink = 0x0100, + RxDescFatalErr = 0x008000, + RxWholePkt = 0x0300, }; --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/tulip_core.c +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/tulip_core.c @@ -1369,11 +1369,8 @@ static int __devinit tulip_init_one (str if (pci_request_regions (pdev, "tulip")) goto err_out_free_netdev; -#ifndef USE_IO_OPS - ioaddr = pci_iomap(pdev, 1, tulip_tbl[chip_idx].io_size); -#else - ioaddr = pci_iomap(pdev, 0, tulip_tbl[chip_idx].io_size); -#endif + ioaddr = pci_iomap(pdev, TULIP_BAR, tulip_tbl[chip_idx].io_size); + if (!ioaddr) goto err_out_free_res; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: New tulip maintainer...
On 6/8/06, Grant Grundler <[EMAIL PROTECTED]> wrote: On Thu, Jun 08, 2006 at 11:41:28AM -0400, Jeff Garzik wrote: > Now that we have a new tulip maintainer, perhaps a resend of the > long-outstanding tulip phy patches could be resent? All the tulip patches I have are archived here: ftp://ftp.parisc-linux.org/patches/ Anything else tulip I've been involved with is available via CVS from cvs.parisc-linux.org/linux-2.6/ Thibaut Varene has also committed his changes to that CVS. Hey folks, Just a quick note to say that, yes, in a moment of weak-willed delusion, I did let Jeff pressure me into becoming the tulip maintainer. I will accept tokens of condolence in the form of beer, money, and old tulip cards (email me for my shipping address). I'm going to be a tiny bit busy the next couple of weeks - minor things like running the file systems workshop and moving house - but I am paying attention and will start testing and shipping patches as soon as possible. One quick note: please use my spiffy [EMAIL PROTECTED] address (see From: address) for Linux stuff. Besides giving props to my employer, it's much easier to send/receive patches from that account. -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: PATCHv3 2.6.17-rc5 tulip free_irq() called too late
On Tue, Jun 13, 2006 at 05:55:31PM -0600, Grant Grundler wrote: > On Thu, Jun 08, 2006 at 11:01:20AM -0600, Grant Grundler wrote: > > Here is a new patch that moves free_irq() into tulip_down(). > > The resulting code is structured the same as cp_close(). > > Val, > Two details are wrong in version 2 and are fixed in v3 (appended below): > > o we don't need synchronize_irq() before calling free_irq(). > (It should be removed from cp_close() too) > Thanks to willy for pointing me at kernel/irq/manage.c. > > o tulip_stop_rxtx() has to be called _after_ free_irq(). > ie. v2 patch didn't fix the original race condition > and when under test, dies about as fast as the original code. > > Tested on rx4640 (HP IA64) for several hours. > Please apply. Thanks, I'll take a look next week (after the workshop and moving). -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: PATCHv3 2.6.17-rc5 tulip free_irq() called too late
On Tue, Jun 13, 2006 at 05:55:31PM -0600, Grant Grundler wrote: > On Thu, Jun 08, 2006 at 11:01:20AM -0600, Grant Grundler wrote: > > Here is a new patch that moves free_irq() into tulip_down(). > > The resulting code is structured the same as cp_close(). > > Val, > Two details are wrong in version 2 and are fixed in v3 (appended below): > > o we don't need synchronize_irq() before calling free_irq(). > (It should be removed from cp_close() too) > Thanks to willy for pointing me at kernel/irq/manage.c. > > o tulip_stop_rxtx() has to be called _after_ free_irq(). > ie. v2 patch didn't fix the original race condition > and when under test, dies about as fast as the original code. > > Tested on rx4640 (HP IA64) for several hours. > Please apply. Hi folks, The quick summary of my thoughts on this patch is that it isn't the ideal patch, but it works and it's well-tested. Doing my preferred fix (adding a shutdown flag) would be invasive and take many weeks to reach the level of stability of Grant's patch. So I'm taking this patch but adding a comment describing my preferred fix. Here's the long version. The obvious ordering of bringing up the card is: request_irq() setup DMA resources enable interrupts start DMA engine And the obvious ordering of shutting it down is: stop DMA engine disable interrupts remove DMA resources free_irq() The problem with the above shutdown order is that we can receive an interrupt in between stopping DMA and disabling interrupts, and the tulip irq handler will reenable DMA =><= Boom! The solution I prefer is to make the irq handler aware of whether we are shutting down or not, and not reenable DMA in that case. However, it is a non-trivial patch to get right, and I would rather have the bug fixed short-term with the ordering Grant uses: disable interrupts free_irq() stop rxtx remove DMA resources Make sense to everyone? I'll redo the patch with the comment and get Grant's sign-off. -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 1/2] tulip: fix for 64-bit mips
On Sun, Jun 25, 2006 at 05:44:00PM -0600, Grant Grundler wrote: > On Sun, Jun 25, 2006 at 10:31:08AM +0100, Martin Michlmayr wrote: > > * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2006-06-25 01:45]: > > > Cc: Valerie Henson <[EMAIL PROTECTED]> > > > > > > [akpm: this is a previously-nacked patch, but the problem is real] > > ia64 and parisc need the changes to tulip_select_media() too. > > > > And, for the record, Jeff's suggestion as to how to rework the patch: > > > > | Answer hasn't changed since this was last discussed: sleep, rather than > > | delay for an extra-long time. That's the only hurdle for the tulip > > | patches you keep resending. > > > > | Francois Romieu even had an untested patch that attempted this, > > | somewhere. > > > > Now we just need someone to complete this work... > > Kyle McMartin has the work queue patch merged into the cvs.parisc-linux.org > CVS tree. It would be easiest to accept this patch and then add the > tulip work queue patch next. I like the work queue approach; I'll be talking with Kyle and Grant about it. > Note that the work queue does NOT solve all of the "spin delay with > interrupts blocked" problems. tulip_stop_rxtx() polls for nearly as long > and tulip_select_media(). Let's chat... -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Fix tulip shutdown DMA/irq race
From: Grant Grundler <[EMAIL PROTECTED]> IRQs are racing with tulip_down(). DMA can be restarted by the interrupt handler _after_ we call tulip_stop_rxtx() and the DMA buffers are unmapped. The result is an MCA (hard crash on ia64) because of an IO TLB miss. The long-term fix is to make the interrupt handler shutdown aware. Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Acked-by: Valerie Henson <[EMAIL PROTECTED]> --- tulip_core.c | 37 - 1 files changed, 24 insertions(+), 13 deletions(-) diff -Nru a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c --- a/drivers/net/tulip/tulip_core.c2006-06-22 16:24:11 -07:00 +++ b/drivers/net/tulip/tulip_core.c2006-06-22 16:24:11 -07:00 @@ -18,11 +18,11 @@ #define DRV_NAME "tulip" #ifdef CONFIG_TULIP_NAPI -#define DRV_VERSION"1.1.13-NAPI" /* Keep at least for test */ +#define DRV_VERSION"1.1.14-NAPI" /* Keep at least for test */ #else -#define DRV_VERSION"1.1.13" +#define DRV_VERSION"1.1.14" #endif -#define DRV_RELDATE"May 11, 2002" +#define DRV_RELDATE"May 6, 2006" #include @@ -739,23 +739,36 @@ #endif spin_lock_irqsave (&tp->lock, flags); + /* + FIXME: We should really add a shutdown-in-progress flag and + check it in the interrupt handler to see whether we should + reenable DMA or not. The preferred ordering here would be: + + stop DMA engine + disable interrupts + remove DMA resources + free_irq() + + The below works but is non-obvious and doesn't match the + ordering of bring-up. -VAL + */ + /* Disable interrupts by clearing the interrupt mask. */ iowrite32 (0x, ioaddr + CSR7); + ioread32 (ioaddr + CSR7); /* flush posted write */ - /* Stop the Tx and Rx processes. */ - tulip_stop_rxtx(tp); + spin_unlock_irqrestore (&tp->lock, flags); - /* prepare receive buffers */ - tulip_refill_rx(dev); + free_irq (dev->irq, dev); /* no more races after this */ + tulip_stop_rxtx(tp);/* Stop DMA */ - /* release any unconsumed transmit buffers */ - tulip_clean_tx_ring(tp); + /* Put driver back into the state we start with */ + tulip_refill_rx(dev); /* prepare RX buffers */ + tulip_clean_tx_ring(tp);/* clean up unsent TX buffers */ if (ioread32 (ioaddr + CSR6) != 0x) tp->stats.rx_missed_errors += ioread32 (ioaddr + CSR8) & 0x; - spin_unlock_irqrestore (&tp->lock, flags); - init_timer(&tp->timer); tp->timer.data = (unsigned long)dev; tp->timer.function = tulip_tbl[tp->chip_id].media_timer; @@ -781,7 +794,6 @@ printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n", dev->name, ioread32 (ioaddr + CSR5)); - free_irq (dev->irq, dev); /* Free all the skbuffs in the Rx queue. */ for (i = 0; i < RX_RING_SIZE; i++) { @@ -1752,7 +1764,6 @@ tulip_down(dev); netif_device_detach(dev); - free_irq(dev->irq, dev); pci_save_state(pdev); pci_disable_device(pdev); - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
More info on section mismatches (was Re: [PATCH] [TULIP] Fix section mismatch in de2104x.c)
On Fri, Oct 06, 2006 at 02:39:41PM -0400, Jeff Garzik wrote: > Matthew Wilcox wrote: > >From: Helge Deller <[EMAIL PROTECTED]> > > > >WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to > >.init.text:de_init_one from .data.rel.local after 'de_driver' (at offset > >0x20) > >WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to > >.exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset > >0x28) > > I'm a bit blind, so help me out here... what precisely is mismatched? > > AFAICS everything is properly marked __init or __exit. (Cc'd Richard Henderson as resident gcc guru.) We're discussing a way to get more information out of section mismatch reports so that the causes of section mismatches are a little more obvious. I'd like to see something like: foo() is marked __init at line 34 bar() calls foo() at line 57 Arjan points out that optimization may make this difficult; I'm happy with a separate script running at a lower level of optimization that you can run by hand when one of these warnings shows up. Ideas? -VAL - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html