From owner-freebsd-hackers Wed Apr 21 10:29:26 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from boreas.isi.edu (boreas.isi.edu [128.9.160.161]) by hub.freebsd.org (Postfix) with ESMTP id D701B15428 for ; Wed, 21 Apr 1999 10:29:22 -0700 (PDT) (envelope-from faber@ISI.EDU) Received: from ISI.EDU (vex-e.isi.edu [128.9.160.240]) by boreas.isi.edu (8.8.7/8.8.6) with ESMTP id KAA15016; Wed, 21 Apr 1999 10:26:48 -0700 (PDT) Message-Id: <199904211726.KAA15016@boreas.isi.edu> X-Mailer: exmh version 2.0.2 2/24/98 To: Ben Black Cc: freebsd-hackers@freebsd.org, paul@originative.co.uk (Paul Richards) Subject: Re: PCnet/PCI still broken in -stable? In-reply-to: Your message of "Wed, 21 Apr 1999 04:49:21 PDT." <19990421044920.J98028@layer8.net> X-Url: http://www.isi.edu/~faber Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 21 Apr 1999 10:26:48 -0700 From: Ted Faber Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ben Black wrote: >I've got an IBM 325 server with integrated PCnet/PCI ethernet which >worked fine under 3.1-release, but now does nothing but spew >device timeout -- resetting messages in -stable. I saw an exchange from >September indicating a patch to fix a similar sounding problem. > >Any ideas? Sure. Try this. I submitted a similar patch to Paul Richards, and although it works for him in general, someone's having a problem with a combination SCSI-PCnet/PCI ethernet so he hasn't committed it. Paul: this patch is slightly different than the one I mailed you originally. For some reason, unfathomable to me now, the patch I sent you has the driver becoming a bus master *after* it calls the pci attach routine, not before. This is almost certainly a bug, and I wouldn't be surprised if it was causing the problems with the SCSI card (of course, I wouldn't be surprised if it wasn't :-)). Give this new patch a try and see if it helps. The patch is relative to the /sys directory on 3.1-RELEASE, but you should be able to apply it manually if it doesn't work on -stable. Let me know of any problems or comments. *** pci/if_lnc_p.c.orig Mon Mar 8 21:38:19 1999 --- pci/if_lnc_p.c Wed Apr 21 10:13:39 1999 *************** *** 72,88 **** int unit; { unsigned iobase; void *lnc; /* device specific data for interrupt handler ... */ - /* pci_map_port correctly initializes bridge chips -- tvf */ - if ( !pci_map_port(config_id,PCI_MAP_REG_START,(u_short *)&iobase) ) printf("lnc%d: pci_port_map_attach failed?!\n",unit); lnc = lnc_attach_ne2100_pci(unit, iobase); if (!lnc) return; - if(!(pci_map_int(config_id, lncintr_sc, (void *)lnc, &net_imask))) { free (lnc, M_DEVBUF); return; --- 72,95 ---- int unit; { unsigned iobase; + unsigned data; /* scratch to make this device a bus master*/ void *lnc; /* device specific data for interrupt handler ... */ if ( !pci_map_port(config_id,PCI_MAP_REG_START,(u_short *)&iobase) ) printf("lnc%d: pci_port_map_attach failed?!\n",unit); + + /* Make this device a bus master. This was implictly done by + pci_map_port under 2.2.x -- tvf */ + + data = pci_cfgread(config_id, PCIR_COMMAND, 4); + data |= PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN; + pci_cfgwrite(config_id, PCIR_COMMAND, data, 4); + lnc = lnc_attach_ne2100_pci(unit, iobase); + if (!lnc) return; if(!(pci_map_int(config_id, lncintr_sc, (void *)lnc, &net_imask))) { free (lnc, M_DEVBUF); return; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message