Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp882239ybg; Fri, 18 Oct 2019 08:44:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDTAUGkY38egj9OPdo4SMVXajRCwoW3EWBR5dvBn5QcPmNpS8BNh1u31zV1O0nP0m9m7QG X-Received: by 2002:aa7:c595:: with SMTP id g21mr10140071edq.79.1571413490259; Fri, 18 Oct 2019 08:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571413490; cv=none; d=google.com; s=arc-20160816; b=PUPsuIk6HZe53MSdBIhTehfBMpXqd+y9YhdU1m+VO6y4iZsv6/rv5bgmN31Ggy3mNH ceLvpzUbJN9oLLVW2lJlTwLp4GKto04EAPuZ7khCfav0CqHAlTBumOgJBymDVnoFCdKv u1DSAsGV3avR4MZOBDn66reVkOD483/c9kdPIgQPnxL7dE8DlWt4wKo+ojhQ3u6gLfe7 T41UCYWygAZ3jSb9FJBEifCSrUK+BaDo2gvah0pwNDERvaSt/1lHYX9DnM/DjUrtliTr 4riAXXosacwUr4vukjcSNvY34ODsSlkw+pOmt0csvh8GBDxfxsa3uwBnD9qSCW4MvjZ9 EHRA== 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=cE/W/XKqE93Qu4KJ9b+DKOYITnbP/46/RFsAgde8cgynsyeyZ94q9X8f1lrPXsVL0l whgImBEwh5u94rovgoe7MFyNpAsqEsP92nWykt268hxfO25rfGckN65fSRbHSn44/8LT h4BSss7a2I0aQzTtSwqZNwPs4pW8gU584oP6uF/muyqzI+Kzc9Wi7XOVoCFNlAS1d+AK pgbT6t3ZIEqpFkUQNUmR+YQiJBWMwH6g7sPRMWFrCl7qY4gouPdaCH7gSsPBwnt+DWEe NbA1MnL3tABCz1TsIupBb69Nl1G/NY7S5tBcrdKUO0esW6J7zIwzrMz6jrmkmPGBzLC3 ojJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=YXPnsMjK; 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 b16si4017713edb.341.2019.10.18.08.44.26; Fri, 18 Oct 2019 08:44:50 -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=YXPnsMjK; 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 S2502243AbfJQMBl (ORCPT + 99 others); Thu, 17 Oct 2019 08:01:41 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:56251 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502217AbfJQMBk (ORCPT ); Thu, 17 Oct 2019 08:01:40 -0400 Received: by mail-wm1-f68.google.com with SMTP id a6so2258562wma.5 for ; Thu, 17 Oct 2019 05:01:39 -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=YXPnsMjKQyf8JYK0M4k0KOdyEWa1AMAmiDYLNlKXmtX/pwgtbFV2kT3BgtWZXFaJWm QboEGQHvToLotMwSll1BfBlLHNTm9atHIsl4LVjub+12SS8qdBgMfGSdLVTzDMc0U0OS T0iDaKu9JVuF39SdlZMs4CvAzIS7P1m36IKps= 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=UrhIlugFeGh19B4++GUOoMA1euHd0zTRZMosgF8bW9x3IWPLHHUKSSFXWUk+kpzGcl jWSy+Jk6lt0vqF3yjXvL+/t8GVfDcGscwX6K3WAebMxTj6CF9kPu+ncGcqeQF4IXTjLi K9wgyguGi06uMYaP3/47gYPZ+HihrZTAoNjGZOyM4FnU/UYtJJrUupCPcD3r/sMejcE2 kfpB2qjcBltUPR8DYC826/P15QkYcpWGc7OyRT5mxVCI6qKwxFr+1G+o6fKktB+H8199 kx01yr5AK5wBA56Ve+JhUh6nKHLFLFqLX4VjpzN++gPDvQ2RM9TLtUctjiuAJem18e8n ERLg== X-Gm-Message-State: APjAAAUnLbo7D4tdaa98FocfBIntHv6DjnGpy9jJP51WviO7t/40IKGg 6TqNzR6rWYar99MLdM8ExV4ceg== X-Received: by 2002:a7b:c849:: with SMTP id c9mr2481040wml.70.1571313698937; Thu, 17 Oct 2019 05:01:38 -0700 (PDT) Received: from shitalt.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id y1sm2317949wrw.6.2019.10.17.05.01.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Oct 2019 05:01:38 -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 V2 2/3] bnxt_en: Add support to invoke OP-TEE API to reset firmware Date: Thu, 17 Oct 2019 17:31:21 +0530 Message-Id: <1571313682-28900-3-git-send-email-sheetal.tigadoli@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1571313682-28900-1-git-send-email-sheetal.tigadoli@broadcom.com> References: <1571313682-28900-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