From patchwork Sun Oct 11 10:22:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 11830805 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFC84C433E7 for ; Sun, 11 Oct 2020 10:23:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84986208C7 for ; Sun, 11 Oct 2020 10:23:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="H36Sp+3m" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729532AbgJKKXY (ORCPT ); Sun, 11 Oct 2020 06:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727035AbgJKKXV (ORCPT ); Sun, 11 Oct 2020 06:23:21 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50174C0613CE for ; Sun, 11 Oct 2020 03:23:21 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id b193so10342204pga.6 for ; Sun, 11 Oct 2020 03:23:21 -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=Ii91hCS5hplljo/KuXwb4U+ptiWrjws631O9Fdy9F4s=; b=H36Sp+3mVVyog2SJabrPqTTeyfaGQ7jNirwLyhY5zBcYT8sIshKkKes+OlAXynp3J4 foy/WIggrgMs6Vm8z3BHWcg4UhWA+iy/+aeQFSzC06nplvfH/nb1A/x/l6JSnDkvDDGR Z+6pcTUeo3V6PrVzn2e2LFEPmHjTaSjdKgPn0= 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=Ii91hCS5hplljo/KuXwb4U+ptiWrjws631O9Fdy9F4s=; b=W7XSAX33M740xNIlaaKLeADGTFV7LaYSPv4D9Wq/AjVmnFlP1vXFwbIRGOh+wYGpw9 KqNEL2vayirM3QZLTZ2BW0zgaHklq3hJjLIMS0QSD6qUd5PFkQdOVbu8F4R8y2LVe1pS H9/TVB5P2xGsvW25D12tCK86ohdgpqE8KL2aMI/r7eHOtAROufddGaHJ0TbTH/m6LsjL /k1/OvMqEhWImTzESGYDXkRkwx8PrFovXYk7/n5wBUZAiFJmc497g5BXXvqFvf0E/x1h qY5o0pKi3RnO/twN1Og565eWX2YNsWnSliwFvqoQgindojyLM+AHE4Ssgw4Edz1rMLAO En1g== X-Gm-Message-State: AOAM5331/Ho70KQ2oBD1fRt82Viw+Pu/W4rTI1rjUI3SoqF+/lRY66Eo EUVGdjEay6CeaeG6/0e1tVrJ8A== X-Google-Smtp-Source: ABdhPJy5Ojgal9YndRoMq9VHmmlyWArk/vkiVvQp0uacuZSd0JXL/4d/P7IFo+feQP5VuymnfBELdw== X-Received: by 2002:a62:5bc2:0:b029:13e:d13d:a090 with SMTP id p185-20020a625bc20000b029013ed13da090mr19041749pfb.39.1602411800731; Sun, 11 Oct 2020 03:23:20 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id i1sm20155057pjh.52.2020.10.11.03.23.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Oct 2020 03:23:19 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com, Vasundhara Volam Subject: [PATCH net-next 1/9] bnxt_en: Return -EROFS to user space, if NVM writes are not permitted. Date: Sun, 11 Oct 2020 06:22:53 -0400 Message-Id: <1602411781-6012-2-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602411781-6012-1-git-send-email-michael.chan@broadcom.com> References: <1602411781-6012-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vasundhara Volam If NVRAM resources are locked, NVM writes are not permitted. In such scenarios, firmware returns HWRM_ERR_CODE_RESOURCE_LOCKED error to firmware commands. Reviewed-by: Edwin Peer Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 5e4b7fbeef06..d4402a2cd07f 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -4325,6 +4325,8 @@ static int bnxt_hwrm_to_stderr(u32 hwrm_err) switch (hwrm_err) { case HWRM_ERR_CODE_SUCCESS: return 0; + case HWRM_ERR_CODE_RESOURCE_LOCKED: + return -EROFS; case HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED: return -EACCES; case HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR: