From owner-svn-src-stable@FreeBSD.ORG Mon Dec 15 20:40:06 2008 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EACE61065672; Mon, 15 Dec 2008 20:40:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D968D8FC17; Mon, 15 Dec 2008 20:40:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBFKe61F016219; Mon, 15 Dec 2008 20:40:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBFKe6Gp016218; Mon, 15 Dec 2008 20:40:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200812152040.mBFKe6Gp016218@svn.freebsd.org> From: Marius Strobl Date: Mon, 15 Dec 2008 20:40:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186136 - in stable/6/sys: . dev/bge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 20:40:07 -0000 Author: marius Date: Mon Dec 15 20:40:06 2008 New Revision: 186136 URL: http://svn.freebsd.org/changeset/base/186136 Log: - Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which causes data corruption in combination with certain bridges. Information about this problem was kindly provided by davidch. [1] - As BGE_FLAG_PCIX is meant to indicate that the controller is in PCI-X mode, revert to the pre __FreeBSD_version 602101 method of reading the bus mode register rather than checking the mere existence of a PCI-X capability, which is also there when the NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC to be tuned incorrectly. PR: 128833 [1] Reviewed by: jhb Modified: stable/6/sys/ (props changed) stable/6/sys/dev/bge/if_bge.c Modified: stable/6/sys/dev/bge/if_bge.c ============================================================================== --- stable/6/sys/dev/bge/if_bge.c Mon Dec 15 20:36:32 2008 (r186135) +++ stable/6/sys/dev/bge/if_bge.c Mon Dec 15 20:40:06 2008 (r186136) @@ -1353,6 +1353,16 @@ bge_chipinit(struct bge_softc *sc) BGE_MODECTL_TX_NO_PHDR_CSUM); /* + * BCM5701 B5 have a bug causing data corruption when using + * 64-bit DMA reads, which can be terminated early and then + * completed later as 32-bit accesses, in combination with + * certain bridges. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5701 && + sc->bge_chipid == BGE_CHIPID_BCM5701_B5) + BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_FORCE_PCI32); + + /* * Tell the firmware the driver is running */ if (sc->bge_asf_mode & ASF_STACKUP) @@ -2448,26 +2458,21 @@ bge_attach(device_t dev) */ if (reg != 0) sc->bge_flags |= BGE_FLAG_PCIE; - } else if (pci_find_extcap(dev, PCIY_PCIX, ®) == 0) { - if (reg != 0) - sc->bge_flags |= BGE_FLAG_PCIX; - } - #else if (BGE_IS_5705_PLUS(sc)) { reg = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4); if ((reg & 0xFF) == BGE_PCIE_CAPID) sc->bge_flags |= BGE_FLAG_PCIE; +#endif } else { /* * Check if the device is in PCI-X Mode. * (This bit is not valid on PCI Express controllers.) */ - if ((pci_read_config(sc->bge_dev, BGE_PCI_PCISTATE, 4) & + if ((pci_read_config(dev, BGE_PCI_PCISTATE, 4) & BGE_PCISTATE_PCI_BUSMODE) == 0) sc->bge_flags |= BGE_FLAG_PCIX; } -#endif #if __FreeBSD_version > 602105 {