From patchwork Mon Oct 12 09:10:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 11831971 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 AB4D5C433E7 for ; Mon, 12 Oct 2020 09:11:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56EC32145D for ; Mon, 12 Oct 2020 09:11:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="LFTuaRK7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729249AbgJLJLS (ORCPT ); Mon, 12 Oct 2020 05:11:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729014AbgJLJLQ (ORCPT ); Mon, 12 Oct 2020 05:11:16 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11237C0613CE for ; Mon, 12 Oct 2020 02:11:16 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id w21so12924401pfc.7 for ; Mon, 12 Oct 2020 02:11:16 -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=48xDogQ+yVA231K9iKicWj7mmIKN7NZJhrv5CyAja4k=; b=LFTuaRK7B73pZLNXAsJmltXzAIgRQXdyYVg6s8n5k47xaIlM9umubisb8Zv8Mjja4N R2YyCMoSjXKprNv3wUChDvR0Q7xZUoWyAt6FJLPePC/1dOpozWsPU9oGR4ihL1w0LH6p +TIp8IWxd/xQzDCFp3MVUuyeI4KqX0WrrKQ9A= 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=48xDogQ+yVA231K9iKicWj7mmIKN7NZJhrv5CyAja4k=; b=p3FY/NtdtK/C9hjHlbcYLnPkiBvoKeYudT7jzfbSPzEdhVM7yArm2Q7ceLLOq97BP3 EWH3Kyx7lG+kuGGikfO7s/Ig4Je7ieJm0xmBPcwy/i2YA+o9sGYKCgbDLA/qI9tGB3ku JYRGUhGLlpDTxnYh1eqw72uqtrSkrxk4eO2rtEAAiPu/u/s2IGYTCawX7WP+9Vd/E5Gm BPEBXtBahDA9rM11SWIJwmXhUPC9gzePfgIoLN6BZh60qFMKEsmGYUc3tAACKnV7/3wL YEzLfq/LOwVQglO9hWcMXMjAL91FzYAST/u3if3NM6aqqeqUm5LKawxgmXlmST1GcUnQ AqQw== X-Gm-Message-State: AOAM531WsGQpvBzdIxlVo94m2jpxc1UQZ+23opeluuIpAKrMcEIcZwsZ RooRoGhuDazajym5PmR5n7PkroOouS46iw== X-Google-Smtp-Source: ABdhPJzlArkiEwVBkUPduqB0zRF4H28ldEDyGFfifgXSP8ADIPpxPAaO5tmuq/n6HZ+lfEugWY5Mww== X-Received: by 2002:a62:aa10:0:b029:152:b36e:b052 with SMTP id e16-20020a62aa100000b0290152b36eb052mr22019563pff.27.1602493875433; Mon, 12 Oct 2020 02:11:15 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id jy19sm1275932pjb.9.2020.10.12.02.11.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2020 02:11:14 -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 v2 1/9] bnxt_en: Return -EROFS to user space, if NVM writes are not permitted. Date: Mon, 12 Oct 2020 05:10:46 -0400 Message-Id: <1602493854-29283-2-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602493854-29283-1-git-send-email-michael.chan@broadcom.com> References: <1602493854-29283-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: