From: Sepherosa Ziehau Date: Thu, 28 Jun 2012 03:40:17 +0000 (+0800) Subject: bge: Limit BCM5701 B5 to 32-bit mode X-Git-Tag: v3.2.0~755^2~7 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/33dd4678c4f21b949ac1560323e69463fd0e842a bge: Limit BCM5701 B5 to 32-bit mode This is a workaround for a bug which causes data corruption in combination with certain bridges. Obtained-from: FreeBSD 185812 --- diff --git a/sys/dev/netif/bge/if_bge.c b/sys/dev/netif/bge/if_bge.c index 9f58abbff6..6f44e62ade 100644 --- a/sys/dev/netif/bge/if_bge.c +++ b/sys/dev/netif/bge/if_bge.c @@ -1295,6 +1295,16 @@ bge_chipinit(struct bge_softc *sc) BGE_MODECTL_MAC_ATTN_INTR|BGE_MODECTL_HOST_SEND_BDS| 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); + /* * Disable memory write invalidate. Apparently it is not supported * properly by these devices.