[netdrivers] Problem with sundance driver with DFE-580TX

Philippe De Muyter phdm at macqel.be
Mon Oct 3 04:20:11 PDT 2005


Hi, Peter & Michael,

Could you modify your driver as follow, and let know if that solves
ypur problem ?

Philippe

- add the following function just below sundance_probe :

static void sundance_reset(struct net_device *dev, unsigned long reset_cmd)
{
	unsigned long ioaddr;
	int boguscnt = 100;

	ioaddr = dev->base_addr + ASICCtrl;
	/* ST201 documentation states ASICCtrl is a 32bit register */
	iowrite32(reset_cmd | readl(ioaddr), ioaddr);
	while (ioread32(ioaddr) & (1 << 26))
		if (--boguscnt == 0) {
			printk("%s : reset not completed !!\n", dev->name);
			break;
		}
}

- replace the tx error handling with the following :

				if (tx_status & 0x1e) {
					if (netif_msg_tx_err(np))
						printk("%s: Transmit error status %4.4x.\n",
							   dev->name, tx_status);
					np->stats.tx_errors++;
					if (tx_status & 0x10
						np->stats.tx_fifo_errors++;
					if (tx_status & 0x08
						np->stats.collisions++;
					if (tx_status & 0x04
						np->stats.tx_fifo_errors++;
					if (tx_status & 0x02
						np->stats.tx_window_errors++;
					/* This reset has been verified ! phdm at macqel.be. */
					if (tx_status & 0x10) {	/* TxUnderrun */
						unsigned short txthreshold;

						txthreshold = ioread16 (ioaddr + TxThreshold);
						/* Restart Tx FIFO and transmitter */
						sundance_reset(dev, 0x00340000);
						iowrite16 (txthreshold, ioaddr + TxThreshold);
						/* No need to reset the Tx pointer here */
					}
					/* Restart the Tx. */
					iowrite16 (TxEnable, ioaddr + MACCtrl1);
				}
				/* Yup, this is a documentation bug.  It cost me *hours*. */
				iowrite16 (0, ioaddr + TxStatus);

Peter Loeppky wrote :
> I am having the same problem, but we are able to reset the interface by 
> cycling the interface, by bring it down and back up. But that only last 
> about a day and we get the timeout again. We are also using kernel 
> version 2.6.12. 
> 
> I have been digging through kernel source and trying to find a solution, 
> but no luck yet.
> 
...
> Michael Bordignon wrote: 
...
> I'm having a reoccuring problem using the sundance driver included with
> the 2.6.12 linux kernel. All of a sudden, one port will mysteriously
> stop working (pings return 'destination host unreachable'), and a reboot
> is required to get the port going again. Other ports seem unaffected.
> I've had the card replaced with a new one but this didn't fix the
> problem. The card is 32bit, running in a 64bit slot.


More information about the netdrivers mailing list