Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2747691ybg; Thu, 24 Oct 2019 14:39:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqz3h8kRkdqT02slAujKg9EavzeXNSWwY+iNk6yKigvW74p0SrOO4f+2aAuwDgF+9Jw7cl X-Received: by 2002:a17:906:86c2:: with SMTP id j2mr307757ejy.198.1571953160078; Thu, 24 Oct 2019 14:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571953160; cv=none; d=google.com; s=arc-20160816; b=EtT7DINf6innY2HwGcrzNMshCLPrlaRm9zt1uBrGa/qyndpeR+LZjOWyufd5Yd44BS bmQDraAxEiogYIvEdoqswhQFS1xQcYVIIN6sE4ipd5xla/mnAOzz2qdj0+lUSDSspFHi EtGG9+7k8kPluYjW5m+uuUqUvl/6V7cUvYWU5S/duk/QooibesT2X2fzugm/JRh6QngC PeXUgGMCCsu+pI9LzRB4lTTtc1XJzKrNL2b9rC7xR/3LxrvWpMmy2WwovCWxvAPYpkmp +dRYumf+QwylXoFPxyDp6j+L7Y3oe/wBTLI+e5ZPy4jhHcx8W8CfMgJ65bf6SWfBwcTQ MTQg== 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; bh=rBnqrwfSTh2mbIWwZpd9b9hudXdXX3wV/WFEw1SJ2yw=; b=v58xvp/qZVLq99cTbLHco06tXgA+l2Fugi4RiawbUIn7U3vvS/F9p1FS99vNkYjtlv gDqLbSFLYuyLwcQY0E1pVjXYpSucXsd6hwmr+T7rxOAnRwyXnXbQg0XpElnn1PvtghvP ZlMILQFRAu35vVhQLI0v6x8Py/p4qu+SY/66uKjDG6hn1LZCmEmujEPWbY57gQIM568W eLzMVn2kA+wcB5yV73FuSVRAAbo2tJHQINgJpwGRFhzxCXuU1j4Pl+vAlxkOwVx1n9eY 4EUPYSPUx6uPtawVLdH92qTiDSmcX7f+/SaV3ChNzs0bYnlw8AMRVgzwM7Yvlajmqgzz pwLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=iFEIIPVA; 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 d1si2235ejh.281.2019.10.24.14.38.55; Thu, 24 Oct 2019 14:39:20 -0700 (PDT) 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=iFEIIPVA; 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 S2408391AbfJXFcv (ORCPT + 99 others); Thu, 24 Oct 2019 01:32:51 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46354 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404071AbfJXFcu (ORCPT ); Thu, 24 Oct 2019 01:32:50 -0400 Received: by mail-pf1-f194.google.com with SMTP id b25so328737pfi.13 for ; Wed, 23 Oct 2019 22:32:48 -0700 (PDT) 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=rBnqrwfSTh2mbIWwZpd9b9hudXdXX3wV/WFEw1SJ2yw=; b=iFEIIPVA8uKmKnheZH9flgXxDqwNB8TvT/hAxkTujdv22+Uh6XfM9ezHaew7I99k96 daAe9W8uerzXppOSWikLb3ZLItnfUFs6sPVd6qpJKjyJKJviLmeeSWs1+p+E7zpxFLVV G/7yjStwwr92QuWQ6pEQtG9JH/rLpTHuhY3eQ= 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=rBnqrwfSTh2mbIWwZpd9b9hudXdXX3wV/WFEw1SJ2yw=; b=BsSoWDlJGptzOF1bDNvUv4TJYNiSF4kW2sDSAM8mQAuvUSHk+zfJupUvapWduPEZKv m3sITm0Vh7bfFVoaEiGmjWgBqFwtAyYcKAw077XUigBjKnPgMiAXNRc7vT9PvM9C2osd 0r5SdDbm5Kt1tQUm6C4xAvFrI9javmqmi0UKFSP5ycVzwlUkU5/RvTgpIOC40phPS/AJ 24++FZR3+Aozx6ZolFZ0cL3K0oSeGuEuRTW68qUG1yYOr1wcmVjCEd64F0yOraBwxDu3 0wxNt+5RQSK4lpujescy4tKOY7GWXQv3Ji7/HJTevXTk2NbQ7QNTmHtMphPdQHwd7txz C54A== X-Gm-Message-State: APjAAAXYo/Qs74Y7bhw2z3qvZ0pNQxmxOqt1vrCy5cBHiiyqlO5A+3Vj +f3/seKmGul5UFHV18vA1+OOIA== X-Received: by 2002:aa7:955a:: with SMTP id w26mr15690252pfq.193.1571895168042; Wed, 23 Oct 2019 22:32:48 -0700 (PDT) Received: from shitalt.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id e17sm29491331pfl.40.2019.10.23.22.32.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Oct 2019 22:32:47 -0700 (PDT) From: Sheetal Tigadoli To: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Greg Kroah-Hartman , Michal Simek , Rajan Vaja , Scott Branden , Ray Jui , Vikram Prakash , Jens Wiklander , Michael Chan , "David S. Miller" , Vikas Gupta , Vasundhara Volam Cc: Linux Kernel Mailing List , tee-dev@lists.linaro.org, bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org, Sheetal Tigadoli Subject: [PATCH V3 2/3] bnxt_en: Add support to invoke OP-TEE API to reset firmware Date: Thu, 24 Oct 2019 11:02:40 +0530 Message-Id: <1571895161-26487-3-git-send-email-sheetal.tigadoli@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1571895161-26487-1-git-send-email-sheetal.tigadoli@broadcom.com> References: <1571895161-26487-1-git-send-email-sheetal.tigadoli@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasundhara Volam In error recovery process when firmware indicates that it is completely down, initiate a firmware reset by calling OP-TEE API. Cc: Michael Chan Signed-off-by: Vasundhara Volam Signed-off-by: Sheetal Tigadoli --- 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 #include #include +#ifdef CONFIG_TEE_BNXT_FW +#include +#endif struct page_pool; -- 1.9.1