Module Name: src Committed By: martin Date: Sat Nov 29 11:38:46 UTC 2014
Modified Files: src/sys/dev/pci [netbsd-6-0]: if_bge.c Log Message: Pullup revision 1.260 (via patch), requested by msaitoh in #1200: Set maximum read byte count to 2048 for PCI-X BCM5703/5704 devices. For PCI-X BCM5704, set maximum outstanding split transactions to 0. This change fixes a serious stability problem on those chips. To generate a diff of this commit: cvs rdiff -u -r1.200 -r1.200.6.1 src/sys/dev/pci/if_bge.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/if_bge.c diff -u src/sys/dev/pci/if_bge.c:1.200 src/sys/dev/pci/if_bge.c:1.200.6.1 --- src/sys/dev/pci/if_bge.c:1.200 Thu Feb 2 19:43:05 2012 +++ src/sys/dev/pci/if_bge.c Sat Nov 29 11:38:46 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.200 2012/02/02 19:43:05 tls Exp $ */ +/* $NetBSD: if_bge.c,v 1.200.6.1 2014/11/29 11:38:46 martin Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,7 +79,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.200 2012/02/02 19:43:05 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.200.6.1 2014/11/29 11:38:46 martin Exp $"); #include "vlan.h" @@ -3184,6 +3184,19 @@ bge_reset(struct bge_softc *sc) if (sc->bge_flags & BGE_PCIX) { reg = pci_conf_read(sc->sc_pc, sc->sc_pcitag, sc->bge_pcixcap + PCI_PCIX_CMD); + /* Set max memory read byte count to 2K */ + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5703) { + reg &= ~PCI_PCIX_CMD_BYTECNT_MASK; + reg |= PCI_PCIX_CMD_BCNT_2048; + } else if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5704){ + /* + * For 5704, set max outstanding split transaction + * field to 0 (0 means it supports 1 request) + */ + reg &= ~(PCI_PCIX_CMD_SPLTRANS_MASK + | PCI_PCIX_CMD_BYTECNT_MASK); + reg |= PCI_PCIX_CMD_BCNT_2048; + } pci_conf_write(sc->sc_pc, sc->sc_pcitag, sc->bge_pcixcap + PCI_PCIX_CMD, reg & ~PCI_PCIX_CMD_RELAXED_ORDER); }