diff options
author | yongari <yongari@FreeBSD.org> | 2013-10-29 06:37:27 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2013-10-29 06:37:27 +0000 |
commit | 70ab0619926b5574b33d3ab2f659e54db04703fd (patch) | |
tree | 9f845b011851070e7e80c75777810fb6fab39d01 /sys/dev/bce | |
parent | 84d76ac83fd24ca50b33ec572d49da239169a65a (diff) | |
download | FreeBSD-src-70ab0619926b5574b33d3ab2f659e54db04703fd.zip FreeBSD-src-70ab0619926b5574b33d3ab2f659e54db04703fd.tar.gz |
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.
Reported by: Paul Herman (herman <> cleverbridge dot com)
Tested by: sbruno, Paul Herman (herman <> cleverbridge dot com)
Diffstat (limited to 'sys/dev/bce')
-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 dce4fa9..a93b8af 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -5112,9 +5112,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); |