From owner-freebsd-hackers Wed Mar 17 16:47:18 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from xylan.com (postal.xylan.com [208.8.0.248]) by hub.freebsd.org (Postfix) with ESMTP id 8459C14D2A; Wed, 17 Mar 1999 16:47:12 -0800 (PST) (envelope-from wes@softweyr.com) Received: from mailhub.xylan.com by xylan.com (8.8.7/SMI-SVR4 (xylan-mgw 2.2 [OUT])) id QAA19636; Wed, 17 Mar 1999 16:46:20 -0800 (PST) Received: from utah.XYLAN.COM by mailhub.xylan.com (SMI-8.6/SMI-SVR4 (mailhub 2.1 [HUB])) id QAA21911; Wed, 17 Mar 1999 16:46:20 -0800 Received: from softweyr.com by utah.XYLAN.COM (SMI-8.6/SMI-SVR4 (xylan utah [SPOOL])) id RAA01113; Wed, 17 Mar 1999 17:46:17 -0700 Message-ID: <36F04CD0.B0D46F3B@softweyr.com> Date: Wed, 17 Mar 1999 17:46:08 -0700 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.5 [en] (X11; U; FreeBSD 3.1-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Mike Spengler , hackers@freebsd.org, jkh@freebsd.org Subject: Re: fxp driver causing lockup References: <199903172356.RAA14113@us.networkcs.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Mike Spengler wrote: > Wes Peters said: > > "John W. DeBoskey" wrote: > > > > > > Hi, > > > > > > I beleive you are correct. The following code fragment from > > > if_fxp.c is the lockup: > > > > > > /* > > > * Start the config command/DMA. > > > */ > > > fxp_scb_wait(sc); > > > CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, vtophys(&cbp->cb_status)); > > > CSR_WRITE_1(sc, FXP_CSR_SCB_COMMAND, FXP_SCB_COMMAND_CU_START); > > > /* ...and wait for it to complete. */ > > > while (!(cbp->cb_status & FXP_CB_STATUS_C)); > > > > Yup, that's it. I initially tracked this down under 3.0, but moved the > > machine back to 2.2.7 because I needed it to get work done. I've now > > stuffed two 3c905Bs into it for my main and test network, and can play > > with the Pro 100B without losing a network connection. > > There was a FreeBSD 2.2.x -> 3.x change in which the driver is now responsible > for setting the PCI busmaster enable bit. This may (or not) be your problem. > In the fxp_attach() function, you should insert the following before doing > the pci_map_mem() call: > > u_long val; > > val = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG); > val |= (PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN); > pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, val); > > Hope this helps! It did, it's working fine now. Here's the diff vs. 3.1-RELEASE: *** if_fxp.c.orig Wed Mar 17 17:06:51 1999 --- if_fxp.c Wed Mar 17 17:23:09 1999 *************** *** 98,103 **** --- 98,104 ---- #include /* for DELAY */ #include + #include /* for PCIM_CMD_xxx */ #include #include *************** *** 523,528 **** --- 524,530 ---- vm_offset_t pbase; struct ifnet *ifp; int s; + u_long val; sc = malloc(sizeof(struct fxp_softc), M_DEVBUF, M_NOWAIT); if (sc == NULL) *************** *** 531,536 **** --- 533,545 ---- callout_handle_init(&sc->stat_ch); s = splimp(); + + /* + * Enable bus mastering. + */ + val = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG); + val |= (PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN); + pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, val); /* * Map control/status registers. Can a couple of other hackers with EEPro 100's try this out to make sure it doesn't accidentally break anything else? If not, I'll commit it tomorrow. Thanks a TON, Mike. Now I can rip that second XL out of this machine and upgrade my other machine to 3.1 also. -- Where am I, and what am I doing in this handbasket? Wes Peters +1.801.915.2061 Softweyr LLC wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message