Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Sep 1998 11:25:43 -0700
From:      Mike Smith <mike@smith.net.au>
To:        Bill Paul <wpaul@skynet.ctr.columbia.edu>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: RealTek + memory mapped registers + SMP == ?*%^(#!! 
Message-ID:  <199809251825.LAA00418@dingo.cdrom.com>
In-Reply-To: Your message of "Fri, 25 Sep 1998 12:56:42 EDT." <199809251656.MAA03274@skynet.ctr.columbia.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Uhm... this is a question for those with more hardware clues than I.
> Originally I set up the RealTek driver to use PCI memory mapped mode to
> access the chip registers. This worked fine on the development machine
> I used, which is a single processor Dell Optiplex GX1 (PII, 400Mhz).
> 
> SMP machines don't seem to like it though. I also have a Dell PowerEdge
> 2300/400 machine (dual PII 400Mhz, 256MB RAM) and on this machine, the
> driver causes the system to lock up when doing certain register access
> operations. It looks like the problem is performing multiple register
> accesses in rapid succession. For example, the first place it locks up
> is when attempting to load the MAC address: there's a small for(;;)
> loop like this:
> 
>         /* Init our MAC address */
>         for (i = 0; i < ETHER_ADDR_LEN; i++) {
>                 CSR_WRITE_1(sc, RL_IDR0 + i, sc->arpcom.ac_enaddr[i]);
>         }
> 
> The machine grinds to a halt at this point. The same thing happens
> with a uniprocessor kernel on the same hardware. If I switch to using 
> programmed I/O mode, everything works fine. (I updated the driver at 
> www.freebsd.org/~wpaul so that PIO mode is now the default.)
> 
> Can anyone think of a reason why this would happen? The machine also
> has two Intel EtherExpress Pro 100B adapters, and the fxp driver, which
> also uses memory mapped access, works fine. I suspect that there's
> just something bogus about the RealTek chip that's causing it, but I
> don't know what.

I would hazard a guess that the problem has to do with the fact that 
memory operations don't behave the same as I/O operations.  It would be 
interesting to know if the memory-mapped registers are marked as 
"cacheable", or "write-combined".

I doubt, given your colourful descriptions of the RealTek device's 
design, whether it would be able to handle memory accesses that didn't 
look like I/O accesses (possibly out of order, possibly combined or 
part of a cache line writeout if those options were set).

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809251825.LAA00418>