[tulip-bug] [PATCH] check_duplex bug causes HD operation, carrier
errors
Donald Becker
becker@scyld.com
Fri Jun 28 14:47:01 2002
On Thu, 27 Jun 2002, Bhavesh P. Davda wrote:
> Subject: [tulip-bug] [PATCH] check_duplex bug causes HD operation,
> carrier errors
>
> Finally was able to track this bug down to a fairly simple set of
> operations:
Errrmm, this patch stops the transmitter to change the duplex every
timer tick.
I'm not seeing the bug that this fixes.
It appears to fix a problem where the 'tp->full_duplex' variable is
initially set, but the chip has not been put in full duplex mode. Since
the driver thinks the duplex setting is fine, it is never updated.
This mismatch should be pretty clearly shown with tulip-diag.
> diff -Naur orig/tulip.c new/tulip.c
> --- orig/tulip.c Thu Jun 27 15:37:41 2002
> +++ new/tulip.c Thu Jun 27 15:39:05 2002
> @@ -1916,21 +1916,18 @@
> duplex = ((negotiated & 0x0300) == 0x0100
> || (negotiated & 0x00C0) == 0x0040);
> /* 100baseTx-FD or 10T-FD, but not 100-HD */
> - if (tp->full_duplex != duplex) {
> - tp->full_duplex = duplex;
> - if (negotiated & 0x0380) /* 100mbps. */
> - tp->csr6 &= ~0x00400000;
> - if (tp->full_duplex) tp->csr6 |= FullDuplex;
> - else tp->csr6 &= ~FullDuplex;
> - outl(tp->csr6 | RxOn, ioaddr + CSR6);
> - outl(tp->csr6 | TxOn | RxOn, ioaddr + CSR6);
> - if (tp->msg_level & NETIF_MSG_LINK)
> - printk(KERN_INFO "%s: Setting %s-duplex based on MII "
> - "#%d link partner capability of %4.4x.\n",
> - dev->name, tp->full_duplex ? "full" : "half",
> - tp->phys[0], mii_reg5);
> - return 1;
> - }
> + tp->full_duplex = duplex;
> + if (negotiated & 0x0380) /* 100mbps. */
> + tp->csr6 &= ~0x00400000;
> + if (tp->full_duplex) tp->csr6 |= FullDuplex;
> + else tp->csr6 &= ~FullDuplex;
> + outl(tp->csr6 | RxOn, ioaddr + CSR6);
> + outl(tp->csr6 | TxOn | RxOn, ioaddr + CSR6);
> + if (tp->msg_level & NETIF_MSG_LINK)
> + printk(KERN_INFO "%s: Setting %s-duplex based on MII "
> + "#%d link partner capability of %4.4x.\n",
> + dev->name, tp->full_duplex ? "full" : "half",
> + tp->phys[0], mii_reg5);
> return 0;
> }
>
>
--
Donald Becker becker@scyld.com
Scyld Computing Corporation http://www.scyld.com
410 Severn Ave. Suite 210 Second Generation Beowulf Clusters
Annapolis MD 21403 410-990-9993