linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
To: "Rafał Miłecki" <zajec5@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Michal Simek" <michal.simek@xilinx.com>,
	"Rajan Vaja" <rajan.vaja@xilinx.com>,
	"Scott Branden" <scott.branden@broadcom.com>,
	"Ray Jui" <ray.jui@broadcom.com>,
	"Vikram Prakash" <vikram.prakash@broadcom.com>,
	"Jens Wiklander" <jens.wiklander@linaro.org>,
	"Michael Chan" <michael.chan@broadcom.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Vikas Gupta" <vikas.gupta@broadcom.com>,
	"Vasundhara Volam" <vasundhara-v.volam@broadcom.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	tee-dev@lists.linaro.org, bcm-kernel-feedback-list@broadcom.com,
	netdev@vger.kernel.org,
	Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
Subject: [PATCH V2 2/3] bnxt_en: Add support to invoke OP-TEE API to reset firmware
Date: Thu, 17 Oct 2019 17:31:21 +0530	[thread overview]
Message-ID: <1571313682-28900-3-git-send-email-sheetal.tigadoli@broadcom.com> (raw)
In-Reply-To: <1571313682-28900-1-git-send-email-sheetal.tigadoli@broadcom.com>

From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>

In error recovery process when firmware indicates that it is
completely down, initiate a firmware reset by calling OP-TEE API.

Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 13 +++++++++++--
 drivers/net/ethernet/broadcom/bnxt/bnxt.h |  3 +++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index b4a8cf6..b60b24e 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -10581,14 +10581,23 @@ static void bnxt_fw_reset_writel(struct bnxt *bp, int reg_idx)
 static void bnxt_reset_all(struct bnxt *bp)
 {
 	struct bnxt_fw_health *fw_health = bp->fw_health;
-	int i;
+	int i, rc;
+
+	if (bp->fw_cap & BNXT_FW_CAP_ERR_RECOVER_RELOAD) {
+#ifdef CONFIG_TEE_BNXT_FW
+		rc = tee_bnxt_fw_load();
+		if (rc)
+			netdev_err(bp->dev, "Unable to reset FW rc=%d\n", rc);
+		bp->fw_reset_timestamp = jiffies;
+#endif
+		return;
+	}
 
 	if (fw_health->flags & ERROR_RECOVERY_QCFG_RESP_FLAGS_HOST) {
 		for (i = 0; i < fw_health->fw_reset_seq_cnt; i++)
 			bnxt_fw_reset_writel(bp, i);
 	} else if (fw_health->flags & ERROR_RECOVERY_QCFG_RESP_FLAGS_CO_CPU) {
 		struct hwrm_fw_reset_input req = {0};
-		int rc;
 
 		bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FW_RESET, -1, -1);
 		req.resp_addr = cpu_to_le64(bp->hwrm_cmd_kong_resp_dma_addr);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index d333589..0943715 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -25,6 +25,9 @@
 #include <net/dst_metadata.h>
 #include <net/xdp.h>
 #include <linux/dim.h>
+#ifdef CONFIG_TEE_BNXT_FW
+#include <linux/firmware/broadcom/tee_bnxt_fw.h>
+#endif
 
 struct page_pool;
 
-- 
1.9.1


  parent reply	other threads:[~2019-10-17 12:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17 12:01 [PATCH V2 0/3] Add OP-TEE based bnxt f/w manager Sheetal Tigadoli
2019-10-17 12:01 ` [PATCH V2 1/3] firmware: broadcom: add OP-TEE based BNXT " Sheetal Tigadoli
2019-10-17 19:16   ` Jakub Kicinski
2019-10-21  9:11     ` Sheetal Tigadoli
2019-10-17 12:01 ` Sheetal Tigadoli [this message]
2019-10-17 12:01 ` [PATCH V2 3/3] bnxt_en: Add support to collect crash dump via ethtool Sheetal Tigadoli
2019-10-17 19:21   ` Jakub Kicinski
2019-10-18  6:34     ` Vasundhara Volam
2019-10-18 17:01       ` Jakub Kicinski
2019-10-21  4:35         ` Vasundhara Volam
2019-10-21 23:00           ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1571313682-28900-3-git-send-email-sheetal.tigadoli@broadcom.com \
    --to=sheetal.tigadoli@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jens.wiklander@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=rajan.vaja@xilinx.com \
    --cc=ray.jui@broadcom.com \
    --cc=scott.branden@broadcom.com \
    --cc=tee-dev@lists.linaro.org \
    --cc=vasundhara-v.volam@broadcom.com \
    --cc=vikas.gupta@broadcom.com \
    --cc=vikram.prakash@broadcom.com \
    --cc=zajec5@gmail.com \
    --subject='Re: [PATCH V2 2/3] bnxt_en: Add support to invoke OP-TEE API to reset firmware' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).