From owner-freebsd-hackers Fri Sep 25 11:20:45 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA14499 for freebsd-hackers-outgoing; Fri, 25 Sep 1998 11:20:45 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA14493 for ; Fri, 25 Sep 1998 11:20:43 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.cdrom.com [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id LAA00418; Fri, 25 Sep 1998 11:25:43 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Message-Id: <199809251825.LAA00418@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Bill Paul cc: hackers@FreeBSD.ORG Subject: Re: RealTek + memory mapped registers + SMP == ?*%^(#!! In-reply-to: Your message of "Fri, 25 Sep 1998 12:56:42 EDT." <199809251656.MAA03274@skynet.ctr.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 25 Sep 1998 11:25:43 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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