Module Name: src
Committed By: martin
Date: Mon Feb 16 08:32:33 UTC 2015
Modified Files:
src/sys/dev/pci [netbsd-6]: if_bge.c
Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1256):
sys/dev/pci/if_bge.c: revision 1.278
Fix three bugs reported by enami@:
- bge_miibus_writereg(): Fix a bug that BCM5906 may leave an APE lock.
- Fix hwcfg4 isn't printed correctly.
- Fix a bug that BGE_PHY_TEST_CTRL_REG isn't set correctly on some PCIe
devices.
To generate a diff of this commit:
cvs rdiff -u -r1.200.2.4 -r1.200.2.5 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.2.4 src/sys/dev/pci/if_bge.c:1.200.2.5
--- src/sys/dev/pci/if_bge.c:1.200.2.4 Sun Dec 7 16:39:55 2014
+++ src/sys/dev/pci/if_bge.c Mon Feb 16 08:32:33 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bge.c,v 1.200.2.4 2014/12/07 16:39:55 martin Exp $ */
+/* $NetBSD: if_bge.c,v 1.200.2.5 2015/02/16 08:32:33 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.2.4 2014/12/07 16:39:55 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.200.2.5 2015/02/16 08:32:33 martin Exp $");
#include "vlan.h"
@@ -1399,13 +1399,13 @@ bge_miibus_writereg(device_t dev, int ph
uint32_t autopoll;
int i;
- if (bge_ape_lock(sc, sc->bge_phy_ape_lock) != 0)
- return;
-
if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906 &&
(reg == BRGPHY_MII_1000CTL || reg == BRGPHY_MII_AUXCTL))
return;
+ if (bge_ape_lock(sc, sc->bge_phy_ape_lock) != 0)
+ return;
+
/* Reading with autopolling on may trigger PCI errors */
autopoll = CSR_READ_4(sc, BGE_MI_MODE);
if (autopoll & BGE_MIMODE_AUTOPOLL) {
@@ -3743,7 +3743,7 @@ bge_attach(device_t parent, device_t sel
hwcfg2 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_2);
if (sc->bge_flags & BGEF_PCIE)
hwcfg3 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_3);
- if (BGE_ASICREV(sc->bge_chipid == BGE_ASICREV_BCM5785))
+ if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785)
hwcfg4 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_4);
if (BGE_IS_5717_PLUS(sc))
hwcfg5 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_5);
@@ -4171,7 +4171,7 @@ bge_reset(struct bge_softc *sc)
* XXX: from FreeBSD/Linux; no documentation
*/
if (sc->bge_flags & BGEF_PCIE) {
- if (BGE_ASICREV(sc->bge_chipid != BGE_ASICREV_BCM5785) &&
+ if ((BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5785) &&
!BGE_IS_57765_PLUS(sc) &&
(CSR_READ_4(sc, BGE_PHY_TEST_CTRL_REG) ==
(BGE_PHY_PCIE_LTASS_MODE | BGE_PHY_PCIE_SCRAM_MODE))) {