bnxt_en: fix clear flags in ethtool reset handling
authorScott Branden <scott.branden@broadcom.com>
Sat, 31 Mar 2018 17:54:09 +0000 (13:54 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Apr 2018 03:24:19 +0000 (23:24 -0400)
Clear flags when reset command processed successfully for components
specified.

Fixes: 6502ad5963a5 ("bnxt_en: Add ETH_RESET_AP support")
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

index 1801582076be4ba8be9541b2679dddb2a491557d..7af01a565741ec881483b72c2c212d038b5564fd 100644 (file)
@@ -2535,16 +2535,20 @@ static int bnxt_reset(struct net_device *dev, u32 *flags)
                        return -EOPNOTSUPP;
 
                rc = bnxt_firmware_reset(dev, BNXT_FW_RESET_CHIP);
-               if (!rc)
+               if (!rc) {
                        netdev_info(dev, "Reset request successful. Reload driver to complete reset\n");
+                       *flags = 0;
+               }
        } else if (*flags == ETH_RESET_AP) {
                /* This feature is not supported in older firmware versions */
                if (bp->hwrm_spec_code < 0x10803)
                        return -EOPNOTSUPP;
 
                rc = bnxt_firmware_reset(dev, BNXT_FW_RESET_AP);
-               if (!rc)
+               if (!rc) {
                        netdev_info(dev, "Reset Application Processor request successful.\n");
+                       *flags = 0;
+               }
        } else {
                rc = -EINVAL;
        }