summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authordavidcs <davidcs@FreeBSD.org>2014-09-17 22:11:20 +0000
committerdavidcs <davidcs@FreeBSD.org>2014-09-17 22:11:20 +0000
commitbadeddde87763438fc72356ea1e5ee42847528a1 (patch)
treee82a29555e0de3a4c0aaf7e51f0eda8d6be3fec7 /sys/dev
parent297fe2e27aa0d32618f3a271d0e07d83f917bb0b (diff)
downloadFreeBSD-src-badeddde87763438fc72356ea1e5ee42847528a1.zip
FreeBSD-src-badeddde87763438fc72356ea1e5ee42847528a1.tar.gz
MFC r268854
Initiate error recovery stats fail to update after 3 retries. Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to panic only if ECORE_STOP_ON_ERROR is defined. Approved by: re(gjb)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/bxe/bxe.c4
-rw-r--r--sys/dev/bxe/bxe.h9
-rw-r--r--sys/dev/bxe/bxe_stats.c5
-rw-r--r--sys/dev/bxe/ecore_reg.h2
-rw-r--r--sys/dev/bxe/ecore_sp.h16
5 files changed, 35 insertions, 1 deletions
diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c
index c4894ea..f472091 100644
--- a/sys/dev/bxe/bxe.c
+++ b/sys/dev/bxe/bxe.c
@@ -11478,6 +11478,10 @@ bxe_process_kill(struct bxe_softc *sc,
bxe_process_kill_chip_reset(sc, global);
mb();
+ /* clear errors in PGB */
+ if (!CHIP_IS_E1(sc))
+ REG_WR(sc, PGLUE_B_REG_LATCHED_ERRORS_CLR, 0x7f);
+
/* Recover after reset: */
/* MCP */
if (global && bxe_reset_mcp_comp(sc, val)) {
diff --git a/sys/dev/bxe/bxe.h b/sys/dev/bxe/bxe.h
index a0709f6..8c5a142 100644
--- a/sys/dev/bxe/bxe.h
+++ b/sys/dev/bxe/bxe.h
@@ -2301,11 +2301,20 @@ void ecore_storm_memset_struct(struct bxe_softc *sc, uint32_t addr,
} \
} while(0)
+#ifdef ECORE_STOP_ON_ERROR
+
#define bxe_panic(sc, msg) \
do { \
panic msg; \
} while (0)
+#else
+
+#define bxe_panic(sc, msg) \
+ device_printf((sc)->dev, "%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+
+#endif
+
#define CATC_TRIGGER(sc, data) REG_WR((sc), 0x2000, (data));
#define CATC_TRIGGER_START(sc) CATC_TRIGGER((sc), 0xcafecafe)
diff --git a/sys/dev/bxe/bxe_stats.c b/sys/dev/bxe/bxe_stats.c
index cfecc22..021c276 100644
--- a/sys/dev/bxe/bxe_stats.c
+++ b/sys/dev/bxe/bxe_stats.c
@@ -1306,7 +1306,10 @@ bxe_stats_update(struct bxe_softc *sc)
if (bxe_storm_stats_update(sc)) {
if (sc->stats_pending++ == 3) {
- bxe_panic(sc, ("storm stats not updated for 3 times\n"));
+ if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) {
+ atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT);
+ taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task);
+ }
}
return;
}
diff --git a/sys/dev/bxe/ecore_reg.h b/sys/dev/bxe/ecore_reg.h
index 916df8f..b256e78 100644
--- a/sys/dev/bxe/ecore_reg.h
+++ b/sys/dev/bxe/ecore_reg.h
@@ -1039,6 +1039,8 @@ __FBSDID("$FreeBSD$");
0x942cUL
#define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ \
0x9430UL
+#define PGLUE_B_REG_LATCHED_ERRORS_CLR \
+ 0x943CUL
#define PGLUE_B_REG_PGLUE_B_INT_STS \
0x9298UL
#define PGLUE_B_REG_PGLUE_B_INT_STS_CLR \
diff --git a/sys/dev/bxe/ecore_sp.h b/sys/dev/bxe/ecore_sp.h
index c3d9c3a..f07921e 100644
--- a/sys/dev/bxe/ecore_sp.h
+++ b/sys/dev/bxe/ecore_sp.h
@@ -223,6 +223,8 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *mac, uint32_t len)
#define ecore_sp_post(_sc, _a, _b, _c, _d) \
bxe_sp_post(_sc, _a, _b, U64_HI(_c), U64_LO(_c), _d)
+#ifdef ECORE_STOP_ON_ERROR
+
#define ECORE_DBG_BREAK_IF(exp) \
do { \
if (__predict_false(exp)) { \
@@ -242,6 +244,20 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *mac, uint32_t len)
} \
} while (0)
+#else
+
+#define ECORE_DBG_BREAK_IF(exp) \
+ printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+
+#define ECORE_BUG(exp) \
+ printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+
+#define ECORE_BUG_ON(exp) \
+ printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+
+
+#endif /* #ifdef ECORE_STOP_ON_ERROR */
+
#define ECORE_ERR(str, ...) \
BLOGE(sc, "ECORE: " str, ##__VA_ARGS__)
OpenPOWER on IntegriCloud