Received: by 10.223.164.202 with SMTP id h10csp364945wrb; Thu, 30 Nov 2017 11:37:12 -0800 (PST) X-Google-Smtp-Source: AGs4zMZttan4R2pqUhAF9uiwkj5bbc9AqR3tHFOA4nH36DBZMSZ2pHqP2QdtlY1qanw6GatvSb8s X-Received: by 10.99.64.68 with SMTP id n65mr3376205pga.312.1512070632505; Thu, 30 Nov 2017 11:37:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512070632; cv=none; d=google.com; s=arc-20160816; b=L83Jt+emA+rWHTG18+ciBz3Yl5cDm/8wmO9ddtUjo9Gxmnc8LXssKv8IZZP0hpBWd+ GAI10K/shJInQpOxbT7zelBuw2A6oZAUhofDqXCVjc99vFTTs8Ymg6avG6J6t8eD3Mnq +MPUl81aEYmS5v8OiGjPte6Y8PEF/eiXzQXiKU6cMG//6uXV7CM3ToY/QPMCg6VwAMf3 8ksTtfkiftmrnk3hlysTXg3PR7kBfn1zIplX/OxzvxQSZMoh3dCKNPABl+Q/S4Qa9u73 nPEbZ69RQvhMlOYxX4cFOdFBEd1w7M2CokCHd1GTk4F3Wlcc8u700oroUQolYPymM9Ij CCyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=qVMkvEtm29NnFfz9LCmgUnQo7igXX5BjFR7ZnZB0t+M=; b=FpBvWUUcgZoFt7Z/ASc5RPuuoCU11L9rujgYl5TqkEKPt1Xuo9KPAti/1Yrob83CA6 OKM/6eL2si5eb/Sb6gcB+OlfzUy2bHuweHVy46UxlQ/5Gao2mm19Ohophgv8K16CfarQ uOIl+djxfkkEDL3e1voK19/Vpg4lBOEAwrgyO7WxOhwyQnDyaadA5HH0H0JDuJ4gKXkc oZbYU2ZC3ABh+890MqD2duldzy1U6795u4RXWzNKRo6vXY2aoKdFRntiqueb5vreICWw +pN8G/zOLGzCn1wZmgVBoReYMOskG8gfb7dM9a81PTBqS7nSoq9z12ZM4ryp8++3UOcT skMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=cKCVcgwS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s187si3480519pgc.532.2017.11.30.11.36.59; Thu, 30 Nov 2017 11:37:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=cKCVcgwS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751694AbdK3Tgj (ORCPT + 99 others); Thu, 30 Nov 2017 14:36:39 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33653 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbdK3Tgf (ORCPT ); Thu, 30 Nov 2017 14:36:35 -0500 Received: by mail-wr0-f195.google.com with SMTP id v22so7772004wrb.0 for ; Thu, 30 Nov 2017 11:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qVMkvEtm29NnFfz9LCmgUnQo7igXX5BjFR7ZnZB0t+M=; b=cKCVcgwSu7nPPAeVfCu2F3DAjKakZQMEdRiIGyK30k3z+MZKXChlnNk10VPHhWtL8M kggooZTatj5dafhkJ/IY2HUpKzX0D9WpmXYGwDqHdpUjOuJb5nunx4aHkLFolsc6LYa/ chKWQQnlJMSe/1INrnkGEuZkax7Z9HM91npSc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qVMkvEtm29NnFfz9LCmgUnQo7igXX5BjFR7ZnZB0t+M=; b=mY1psMrFJmXYQZ/L/4+ssDWhuj6L+PCO189DgLJeCZEe15EdMRyu1kiZ9uMgePhO3D h4IjW3+0UUdsEDp86IJtes2qeBjiyu9rWE68lAT+JAuS7vpzQ8H2agaPQHKxpycJWpg9 5c6iZSBLcSrKgyBpQ0QfwwgiM2gKbr8lrz7D7JIkWlZ/lRQjsP61F3eoAQwzQVGKxrLU +nbObeoC9MCQpbw1ildMl9aB3USp0tnC0FrsVBzA83BkAvltegcFMu+yIE23JKnpUXsb 8BNymUaNFXcEh1DFytR1hCmcjU1AG/FouT8TMC7yVZ5mguSTjOdlkIZZM5gsJHCoqc5H nQaA== X-Gm-Message-State: AJaThX4/irBaAf8tqp1adnymoneLXRQpBiwPlzYELWGj71JoRvTV/c5m yvA4Qc1mSgVGEHOnCPUAQXRytQ== X-Received: by 10.223.182.73 with SMTP id i9mr2965083wre.113.1512070594111; Thu, 30 Nov 2017 11:36:34 -0800 (PST) Received: from lbrmn-lnxub113.ric.broadcom.com ([192.19.224.250]) by smtp.gmail.com with ESMTPSA id j15sm5392819wmg.48.2017.11.30.11.36.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Nov 2017 11:36:33 -0800 (PST) From: Scott Branden To: "David S. Miller" , "Allan W. Nielsen" , Andrew Lunn , Raju Lakkaraju , Florian Fainelli Cc: BCM Kernel Feedback , linux-kernel@vger.kernel.org, Steve Lin , netdev@vger.kernel.org, Michael Chan , Scott Branden Subject: [PATCH 2/2] bnxt_en: Add ETH_RESET_AP support Date: Thu, 30 Nov 2017 11:36:00 -0800 Message-Id: <1512070560-16739-3-git-send-email-scott.branden@broadcom.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1512070560-16739-1-git-send-email-scott.branden@broadcom.com> References: <1512070560-16739-1-git-send-email-scott.branden@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add ETH_RESET_AP support handling to reset the internal Application Processor(s) of the SmartNIC card. Signed-off-by: Scott Branden --- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 11 +++++++++++ drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 7ce1d4b..fc2c483 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -1376,6 +1376,9 @@ static int bnxt_firmware_reset(struct net_device *dev, req.embedded_proc_type = FW_RESET_REQ_EMBEDDED_PROC_TYPE_CHIP; req.selfrst_status = FW_RESET_REQ_SELFRST_STATUS_SELFRSTASAP; break; + case BNXT_FW_RESET_AP: + req.embedded_proc_type = FW_RESET_REQ_EMBEDDED_PROC_TYPE_AP; + break; default: return -EINVAL; } @@ -2522,6 +2525,14 @@ static int bnxt_reset(struct net_device *dev, u32 *flags) rc = bnxt_firmware_reset(dev, BNXT_FW_RESET_CHIP); if (!rc) netdev_info(dev, "Reset request successful. Reload driver to complete reset\n"); + } 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) + netdev_info(dev, "Reset Application Processor request successful.\n"); } else { rc = -EINVAL; } diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h index ff601b4..836ef68 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h @@ -34,6 +34,7 @@ struct bnxt_led_cfg { #define BNXT_LED_DFLT_ENABLES(x) \ cpu_to_le32(BNXT_LED_DFLT_ENA << (BNXT_LED_DFLT_ENA_SHIFT * (x))) +#define BNXT_FW_RESET_AP 0xfffe #define BNXT_FW_RESET_CHIP 0xffff extern const struct ethtool_ops bnxt_ethtool_ops; -- 2.5.0 From 1585436382064406498@xxx Wed Nov 29 21:12:37 +0000 2017 X-GM-THRID: 1584414242059238864 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread