From owner-freebsd-hackers Thu Apr 8 13:36: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 832A314D21; Thu, 8 Apr 1999 13:36:11 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from mailhub.xylan.com by xylan.com (8.8.7/SMI-SVR4 (xylan-mgw 2.2 [OUT])) id NAA21317; Thu, 8 Apr 1999 13:32:53 -0700 (PDT) Received: from utah.XYLAN.COM by mailhub.xylan.com (SMI-8.6/SMI-SVR4 (mailhub 2.1 [HUB])) id NAA22062; Thu, 8 Apr 1999 13:32:52 -0700 Received: from softweyr.com by utah.XYLAN.COM (SMI-8.6/SMI-SVR4 (xylan utah [SPOOL])) id OAA25912; Thu, 8 Apr 1999 14:32:25 -0600 Message-ID: <370D039D.FC2D907A@softweyr.com> Date: Thu, 08 Apr 1999 13:29:33 -0600 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: Nate Williams Cc: Roger Hardiman , hackers@FreeBSD.ORG, multimedia@FreeBSD.ORG Subject: Re: Bt848 corruption since upgrading to 3.1. Has DMA code changed? References: <370CB2DC.709E7CEA@cs.strath.ac.uk> <370CAA37.3645E2B9@softweyr.com> <370CD277.E9A64E04@cs.strath.ac.uk> <199904081837.MAA28461@mt.sri.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Nate Williams wrote: > > > > Does the driver explicitly turn on PCI bus mastering on the card? The > > > PCI initialization code no longer does this. This change bit the fxp > > > driver on some machines where the BIOS doesn't initialize bus mastering > > > on the card. > > > > The driver has this code which enables the Bus Mastering. > > It was added back in the days of 3.0-current (about 12 months ago) when > > the driver > > was common to 2.2.x and 3.x. That is why there is a #if around the code. Actually the #if is unnecessary, it only saves you the pci_conf_read and pci_conf_write, which are small potatoes in an attach routine. Worst case, you're turning on a bit that was already turned on. > > #if __FreeBSD__ > 2 > > fun = pci_conf_read(tag, PCI_COMMAND_STATUS_REG); > > pci_conf_write(tag, PCI_COMMAND_STATUS_REG, fun | 4); > > #endif > > Other than using a magic number of 4, that's almost the same as what's > used in the fxp code. However, that also enables adds 0x2, which has > another meaning. The correct name for "4" here would be PCIM_CMD_BUSMASTEREN. > (It should be updated to not use the magic numbers, and instead use the > constants supplied in , but that's a minor issue). Unless you're trying to maintain that and don't know to look in pcireg.h for the bit definitions. Magic numbers BAD! Other than that, I have no help to offer. Do you know for sure where it dies? I tracked down the problem in fxp with some simple printfs, and then several someones on -hackers pointed out the fix. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://www.softweyr.com/~softweyr wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message