Author: yongari
Date: Tue Oct 29 06:37:27 2013
New Revision: 257307
URL: http://svnweb.freebsd.org/changeset/base/257307

Log:
  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)

Modified:
  head/sys/dev/bce/if_bce.c

Modified: head/sys/dev/bce/if_bce.c
==============================================================================
--- head/sys/dev/bce/if_bce.c   Tue Oct 29 05:37:05 2013        (r257306)
+++ head/sys/dev/bce/if_bce.c   Tue Oct 29 06:37:27 2013        (r257307)
@@ -5112,9 +5112,11 @@ bce_reset(struct bce_softc *sc, u32 rese
 
 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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to