diff options
author | yongari <yongari@FreeBSD.org> | 2013-11-04 08:46:50 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2013-11-04 08:46:50 +0000 |
commit | dda2180ec107d166442a8d866dc3c9724ec24a84 (patch) | |
tree | f3085a3e1797873ff213f0e08f5ed083c142aac5 | |
parent | 1c088d0f336cef1df380287b75851e69ffcd4525 (diff) | |
download | FreeBSD-src-dda2180ec107d166442a8d866dc3c9724ec24a84.zip FreeBSD-src-dda2180ec107d166442a8d866dc3c9724ec24a84.tar.gz |
MFC r257307:
Fix regression introduced in r235816.
r235816 triggered kernel panic or hang after warm boot.
Don't blindly restore BCE_EMAC_MODE media configuration in
bce_reset(). If driver is about to shutdown it will invoke
bce_reset() which in turn results in restoring BCE_EMAC_MODE
media configuration. This operation seems to confuse controller
firmware.
Approved by: re (glebius)
-rw-r--r-- | sys/dev/bce/if_bce.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index 3b27b8d..bfff931 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -5064,9 +5064,11 @@ bce_reset(struct bce_softc *sc, u32 reset_code) bce_reset_exit: /* Restore EMAC Mode bits needed to keep ASF/IPMI running. */ - val = REG_RD(sc, BCE_EMAC_MODE); - val = (val & ~emac_mode_mask) | emac_mode_save; - REG_WR(sc, BCE_EMAC_MODE, val); + if (reset_code == BCE_DRV_MSG_CODE_RESET) { + val = REG_RD(sc, BCE_EMAC_MODE); + val = (val & ~emac_mode_mask) | emac_mode_save; + REG_WR(sc, BCE_EMAC_MODE, val); + } DBEXIT(BCE_VERBOSE_RESET); return (rc); |