cxgb4: reset FW_OK flag on firmware crash
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Fri, 26 Jan 2018 11:35:54 +0000 (17:05 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Jan 2018 16:00:22 +0000 (11:00 -0500)
If firmware reports error, reset FW_OK flag.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

index af27d2b0f79f382967fe23d5e99be3247a4016d2..be795d0b0b7e184f2b0489278fc4aa88175f4fb7 100644 (file)
@@ -195,9 +195,11 @@ static void t4_report_fw_error(struct adapter *adap)
        u32 pcie_fw;
 
        pcie_fw = t4_read_reg(adap, PCIE_FW_A);
-       if (pcie_fw & PCIE_FW_ERR_F)
+       if (pcie_fw & PCIE_FW_ERR_F) {
                dev_err(adap->pdev_dev, "Firmware reports adapter error: %s\n",
                        reason[PCIE_FW_EVAL_G(pcie_fw)]);
+               adap->flags &= ~FW_OK;
+       }
 }
 
 /*