aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bce
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2013-10-29 06:37:27 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2013-10-29 06:37:27 +0000
commit5aefcb0b4271e07523e5caa23a17d93b07a24cfe (patch)
tree9f845b011851070e7e80c75777810fb6fab39d01 /sys/dev/bce
parentc3767eab7717bd678c523275a40100deee65339f (diff)
downloadsrc-5aefcb0b4271e07523e5caa23a17d93b07a24cfe.tar.gz
src-5aefcb0b4271e07523e5caa23a17d93b07a24cfe.zip
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)
Notes
Notes: svn path=/head/; revision=257307
Diffstat (limited to 'sys/dev/bce')
-rw-r--r--sys/dev/bce/if_bce.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c
index dce4fa9c2907..a93b8afad567 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);