Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp927837ybx; Thu, 31 Oct 2019 03:10:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaJz1cuBS3UN+z0RDuQg9Isxpv4xERR9FGQN8BcFReTnIWLwGzC6rdebzHMvHhZddS43Tq X-Received: by 2002:aa7:d6ca:: with SMTP id x10mr4967661edr.27.1572516622675; Thu, 31 Oct 2019 03:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572516622; cv=none; d=google.com; s=arc-20160816; b=OoZILZrpc2rCseChX4LxylcvR/cyOgtsXl6J3BLAt0WogspXfIdgoTqeKLFHyfleDB N920AuiV3eRyxqtHuydcP4P4b8zn6FDL9rWCy6kS2p5UVP+UCPY/un60k9UICBp7hU3H TwV9mFOifosvhVuCgxGSVC9Bg+S5H4wuQV+AX9nbwMAiUDY3m2JW08hlq50wOjtEzEbF mtu4cCcph3EHCIxwwKTZ2th8bfD2T498uVZWpg/VSo/jBpqzmEMAE17yVovtwwBWYn0N k/grmCx9chg9bRECNz01Y3DIEOHwBKTT930c+Z9xxT7xEQeTnFAD3b2EY5abfjWJeLdg IgKw== 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=HeevsC3B7MNaFkpjJvAhkgTNvsYyPX2eMhap0esKxL8cxnlTzVOBhRPa8Qk6ykX+Vc tj6PrEi4ooV2fe2nSnk/l1RweKGwfkCGaMH8UGdzrV2DuPWrQEWBMYQZqDfRzMBakuSO +Sp8bTvaMfgk7A3lPDLAqMBqLq9lkwI9qW9Y0MW2xBA9NzCDjK+iVAC1PxSF9p9faHCc /bWOUXaLP8356lNM0RqgtRqU5nR5LosEVF3uaKATOWCV3hAqzsUDgV0T5teRB62+cctV 6uYxImKpNJGOxuVv5/E5XwVY8whyM176cu2mZvGbjGJ8bkjrQASYgVpI6RG3vb3k4b5a Pgeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=UEM+IQJN; 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 l47si3791880edb.111.2019.10.31.03.09.59; Thu, 31 Oct 2019 03:10:22 -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=UEM+IQJN; 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 S1727506AbfJaKJD (ORCPT + 99 others); Thu, 31 Oct 2019 06:09:03 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42802 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727481AbfJaKJA (ORCPT ); Thu, 31 Oct 2019 06:09:00 -0400 Received: by mail-wr1-f68.google.com with SMTP id a15so5526286wrf.9 for ; Thu, 31 Oct 2019 03:08:59 -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=UEM+IQJNCIRkC+Zz26kydgCfcVSwtF8Sd742PhPGZYJ2EEjU2WLKAgZojPv2WPsVby e+y1oSgRNd+jPfiLxIVNc8TWj2ePd7zfp1wsNpsKrqFn8MqGNkNnVFhH4Koi6996tsoV yABReLlbrhd0UObtjrntiW2ZH4PrVilWXUYec= 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=GU0ts8fS8FmeUy0fvxo1E8HdAzmAVz2mvFQkk0br3tR1NK+J26vjh7aTFI7vPxL5BJ F1Ykb2vmHaZAelD5U6fchUdvmjCut224Q4zEZtKyf+Uij7apOycmQDJ9bZecKK2vuKPd XjgOpSyKBRAqSpSVy9cHXh4gUAsbjOTguqi9y8VM27O3ppoBXL1WjhXPbij2VO84dWhj vgbwBHLXGb3gSQWXMycOd3YfBUVENzFc88I5qhc/pt0nnv5FZMDQluoCmToZNwQUQenM XuJxiTUVDt0sZPUXgTMzpaRa5CQAHJTBXICNsr61Iu7ZawpAJZu2p3jt39RvsQJiQyI5 ySsQ== X-Gm-Message-State: APjAAAVtrRi1ZxhvYRsvQ9PsCG53tlupI63U9ft45oJQVrBnCplilI5G RooXEUY3UmFgWb53iHrBQmrfBQ== X-Received: by 2002:adf:ea8d:: with SMTP id s13mr3799182wrm.366.1572516538705; Thu, 31 Oct 2019 03:08:58 -0700 (PDT) Received: from shitalt.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id w8sm3719609wrr.44.2019.10.31.03.08.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Oct 2019 03:08:57 -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 V5 2/3] bnxt_en: Add support to invoke OP-TEE API to reset firmware Date: Thu, 31 Oct 2019 15:38:51 +0530 Message-Id: <1572516532-5977-3-git-send-email-sheetal.tigadoli@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1572516532-5977-1-git-send-email-sheetal.tigadoli@broadcom.com> References: <1572516532-5977-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