From 70ab0619926b5574b33d3ab2f659e54db04703fd Mon Sep 17 00:00:00 2001 From: yongari Date: Tue, 29 Oct 2013 06:37:27 +0000 Subject: 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) --- sys/dev/bce/if_bce.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/dev/bce') 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); -- cgit v1.1