Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1038903ybx; Wed, 30 Oct 2019 08:57:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQ6BuedA1J2KWAG9tLmI0kmrRreXPVn4HkyB7ktLNytOJN3GfDgoADv6tL7xODjIWMDnGZ X-Received: by 2002:a17:906:1da1:: with SMTP id u1mr167797ejh.275.1572451020568; Wed, 30 Oct 2019 08:57:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572451020; cv=none; d=google.com; s=arc-20160816; b=b3lYPXH04qLyuaWE1HRhFej3sgFMsxUa5kzk0ctZp07HIEIx4eG0VbDp1g8YYdSbLr Paq7PbLVWUdsca5jvvkMEcRXFsM/ZYzUjlKn2g9NvMJtAHySdoHBHL/JX6Mz87ggrEpy LTvVsmiHP1H0CpotFcKNEXLAT7gmRt1aH3ahG/acyG8pCQZ9q8Lg/waBmY5VKUhYbHQt AULb30pV1vZBHj56ypcoANuSXNdPTos6gLhKFQYpRz7O8x8ogNEWazuKrfj1nNYphEIj A5tVypb/Qlk0tEN+Xk6ozNOZM4J/K/EEMnsZHn/0toCviKI1HkkSNPzWuXIYI9ZXBAtS qSag== 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=1b/PjoEJ3+h+SBh6G5LSt0fwIln3xfl7/abE1bFQX1U=; b=HmWRfKKcuirimicoFCpmK9Q0+zilbVdfRl/b2cALxvfgT3RtumsorPSMuTnGobQ+cv wb4t7Iegl7JO07RgdK886hRwx2jDgRLOGR/5MmgrazZn0Pj6OJffA3AFLdKC6DcPumlo CREiOPfVWaQ/9LOZhWDNWVIasb6P81QDM95IeSFGZzN8Hd3tR5tzh0vv9UKMpyyZicnm XG6ul0Yul9ShhJDiyBmcBvMZGLBZ1kzkOSFhbvj+/nDTzYkL69ayCftES5HJcOYCKJW/ 41axzyZoR4QGBMqkbZEd5UCYNWH9AK5CGrsL/Dsd1kYaeNNBoS74+iHaQpHm1KKVNSfR 4upA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=hzrosYqS; 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 p48si1693520eda.80.2019.10.30.08.56.36; Wed, 30 Oct 2019 08:57:00 -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=hzrosYqS; 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 S1727697AbfJ3Pyy (ORCPT + 99 others); Wed, 30 Oct 2019 11:54:54 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:38598 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728443AbfJ3Pyq (ORCPT ); Wed, 30 Oct 2019 11:54:46 -0400 Received: by mail-wm1-f68.google.com with SMTP id 22so2740290wms.3 for ; Wed, 30 Oct 2019 08:54:45 -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=1b/PjoEJ3+h+SBh6G5LSt0fwIln3xfl7/abE1bFQX1U=; b=hzrosYqSyPDygsna85h8qSrUmUaQQxMkX5BA098fJ6vDLGNeTe4eqqS0Yy3jBSOVtU yi7+0L13abxGIkDRQBOEgU7GdtxmdESHz+6KLsloe65u6oPwjmoLHEVN6T4EuRTryQfL y7lk5lyyh2Rim0xK+TCKTlVwj7Asgp17IIy8s= 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=1b/PjoEJ3+h+SBh6G5LSt0fwIln3xfl7/abE1bFQX1U=; b=HJcZ5LPWbj1fPnoh6Q4fM8NvYCjSCwUA7bXpBEaEQStmGnZADzAvT+dWAS7mG87BpL UJ9Ek8nsefHtmPQhbFjzL4jRG86WoC5aG3/OEkVIJcteEi4nynFBicbeZo4dq0U8t4Jt jAfUE6j5gIFnIGnahUN39LEOOl26cMkKX4p55qm7jqhE9SBzmQzHlg5FuRjjPucJDGUS QqsBW9JHdM8gnp53wZyoRt9ne+XhgHIZZnNI8hfS1byKkQWFNl/KTrkpDVHMmLWtmvBa ENGoUZohfEd0D8Tl6wWrFTl7hjcIAOTM0sQ6csodomtxl3JbrZMJ1W+R3letb8WMSO8v W1vQ== X-Gm-Message-State: APjAAAU9Io21Qwt/OYslJqMv74YjDNL9r4c5wUYduDJ+dxwExEa0E3DU 28ZHRGnT0LjRblse0NS1TEFGJA== X-Received: by 2002:a1c:7719:: with SMTP id t25mr174595wmi.56.1572450884321; Wed, 30 Oct 2019 08:54:44 -0700 (PDT) Received: from shitalt.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id g184sm499931wma.8.2019.10.30.08.54.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Oct 2019 08:54:43 -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 net-next V4 2/3] bnxt_en: Add support to invoke OP-TEE API to reset firmware Date: Wed, 30 Oct 2019 21:24:23 +0530 Message-Id: <1572450864-16761-3-git-send-email-sheetal.tigadoli@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1572450864-16761-1-git-send-email-sheetal.tigadoli@broadcom.com> References: <1572450864-16761-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 8cdf71f8824d..c24caaaf05ca 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 d333589811a5..09437150f818 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; -- 2.17.1