rtl8139 pci mem freeze (more info)

Donald Becker becker@cesdis1.gsfc.nasa.gov
Mon Sep 27 17:54:38 1999


On Mon, 27 Sep 1999, Daniel Kobras wrote:

> I've been looking a bit further into the rtl8139 freezing my boxes when
> using PCI mem access, which I reported some days ago. Here's the minimal
> patch that makes the difference between messing up the PCI bus, locking
> the computer hard and on my Dual-PII even wrecking the ATX power off (this
> happens reliably on my SMP box but never on the UP one), and a network
> card that will complain loudly on tons of strange errors but at least
> leaves the system running. 

Good work.

My machines work fine in memory mode, so I cannot track these down myself.

> +#define outb_f(val,port)	do{writeb((val),(port));readb((port));}while(0)
> +#define outw_f(val,port)	do{writew((val),(port));readw((port));}while(0)
> +#define outl_f(val,port)	do{writel((val),(port));readl((port));}while(0)

These are, as you know, slow.

>  	for (i = 0; i < 6; i++)
> -		outb(dev->dev_addr[i], ioaddr + MAC0 + i);
> +		outb_f(dev->dev_addr[i], ioaddr + MAC0 + i);

This register may be written as a 32 bit word, and it's now documented as
such.
Please try
    outl(cpu_to_le32(*(u32*)dev->dev_addr), ioaddr + MAC0);
    outl(cpu_to_le32(*(u32*)(dev->dev_addr+4)), ioaddr + MAC0 + 4);

>  	/* We can safely update without stopping the chip. */
>  	outb(rx_mode, ioaddr + RxConfig);
> -	outl(mc_filter[0], ioaddr + MAR0 + 0);
> +	outl_f(mc_filter[0], ioaddr + MAR0 + 0);
>  	outl(mc_filter[1], ioaddr + MAR0 + 4);

Hmmm, this one might have to stay.

> Note that on my machine, I still don't have a running network with this
> patch - I keep getting rx underruns and assorted errors and only very
> rarely a ping will go out - but maybe this will give someone a clue as to
> what might be going on. My boxes are an AMD K6-200 on an HX board, 
> equipped with an Intel PIIX3 PCI bridge, and a Dual-PII/350 on BX, PIIX4. 

My K6 system has a SiS chipset.  I wonder if this is Intel-chipset-specific.

Donald Becker					  becker@cesdis.gsfc.nasa.gov
USRA-CESDIS, Center of Excellence in Space Data and Information Sciences.
Code 930.5, Goddard Space Flight Center,  Greenbelt, MD.  20771
301-286-0882	     http://cesdis.gsfc.nasa.gov/people/becker/whoiam.html

 | To unsubscribe, send mail to Majordomo@cesdis.gsfc.nasa.gov, and within the
 |  body of the mail, include only the text:
 |   unsubscribe this-list-name youraddress@wherever.org
 | You will be unsubscribed as speedily as possible.