Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/dev/pci Pull up following revision(s) (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/823a2ec74a56
branches:  netbsd-6
changeset: 776904:823a2ec74a56
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Feb 16 08:32:33 2015 +0000

description:
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.

diffstat:

 sys/dev/pci/if_bge.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (53 lines):

diff -r 9195b2bc1e4a -r 823a2ec74a56 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Mon Feb 16 08:25:31 2015 +0000
+++ b/sys/dev/pci/if_bge.c      Mon Feb 16 08:32:33 2015 +0000
@@ -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 @@
        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 @@
                        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 @@
         * 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))) {



Home | Main Index | Thread Index | Old Index