diff mbox series

bnxt_en: use new module_firmware_crashed()

Message ID 1589608157-22070-1-git-send-email-vasundhara-v.volam@broadcom.com
State New
Headers show
Series bnxt_en: use new module_firmware_crashed() | expand

Commit Message

Vasundhara Volam May 16, 2020, 5:49 a.m. UTC
This makes use of the new module_firmware_crashed() to help
annotate when firmware for device drivers crash. When firmware
crashes devices can sometimes become unresponsive, and recovery
sometimes requires a driver unload / reload and in the worst cases
a reboot.

Using a taint flag allows us to annotate when this happens clearly.

Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
Please append to the patchset:
("[PATCH v2 00/15] net: taint when the device driver firmware crashes")
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index f86b621..b208404 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -2009,6 +2009,7 @@  static int bnxt_async_event_process(struct bnxt *bp,
 		if (!bp->fw_reset_max_dsecs)
 			bp->fw_reset_max_dsecs = BNXT_DFLT_FW_RST_MAX_DSECS;
 		if (EVENT_DATA1_RESET_NOTIFY_FATAL(data1)) {
+			module_firmware_crashed();
 			netdev_warn(bp->dev, "Firmware fatal reset event received\n");
 			set_bit(BNXT_STATE_FW_FATAL_COND, &bp->state);
 		} else {
@@ -10183,6 +10184,7 @@  static void bnxt_force_fw_reset(struct bnxt *bp)
 
 void bnxt_fw_exception(struct bnxt *bp)
 {
+	module_firmware_crashed();
 	netdev_warn(bp->dev, "Detected firmware fatal condition, initiating reset\n");
 	set_bit(BNXT_STATE_FW_FATAL_COND, &bp->state);
 	bnxt_rtnl_lock_sp(bp);