Skip to content

Commit

Permalink
bnxt_en: Improve kernel log messages related to ethtool reset.
Browse files Browse the repository at this point in the history
Kernel log messages for failed AP reset commands should be suppressed.
These are expected to fail on devices that do not have an AP.  Add
missing driver reload message after AP reset and log it in a common
way without duplication.

Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Edwin Peer authored and David S. Miller committed May 4, 2020
1 parent 7a13240 commit 8cec094
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1762,9 +1762,14 @@ static int bnxt_hwrm_firmware_reset(struct net_device *dev, u8 proc_type,
req.selfrst_status = self_reset;
req.flags = flags;

rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
if (rc == -EACCES)
bnxt_print_admin_err(bp);
if (proc_type == FW_RESET_REQ_EMBEDDED_PROC_TYPE_AP) {
rc = hwrm_send_message_silent(bp, &req, sizeof(req),
HWRM_CMD_TIMEOUT);
} else {
rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
if (rc == -EACCES)
bnxt_print_admin_err(bp);
}
return rc;
}

Expand Down Expand Up @@ -2999,6 +3004,7 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
static int bnxt_reset(struct net_device *dev, u32 *flags)
{
struct bnxt *bp = netdev_priv(dev);
bool reload = false;
u32 req = *flags;

if (!req)
Expand All @@ -3022,7 +3028,7 @@ static int bnxt_reset(struct net_device *dev, u32 *flags)
if (!bnxt_firmware_reset_chip(dev)) {
netdev_info(dev, "Firmware reset request successful.\n");
if (!(bp->fw_cap & BNXT_FW_CAP_HOT_RESET))
netdev_info(dev, "Reload driver to complete reset\n");
reload = true;
*flags &= ~BNXT_FW_RESET_CHIP;
}
} else if (req == BNXT_FW_RESET_CHIP) {
Expand All @@ -3035,13 +3041,17 @@ static int bnxt_reset(struct net_device *dev, u32 *flags)
if (bp->hwrm_spec_code >= 0x10803) {
if (!bnxt_firmware_reset_ap(dev)) {
netdev_info(dev, "Reset application processor successful.\n");
reload = true;
*flags &= ~BNXT_FW_RESET_AP;
}
} else if (req == BNXT_FW_RESET_AP) {
return -EOPNOTSUPP; /* only request, fail hard */
}
}

if (reload)
netdev_info(dev, "Reload driver to complete reset\n");

return 0;
}

Expand Down

0 comments on commit 8cec094

Please sign in to comment.