From patchwork Fri Dec 8 00:16:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13484497 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="X7UycMfw" Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61B7E19B1 for ; Thu, 7 Dec 2023 16:17:24 -0800 (PST) Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3b9e2a014e8so684591b6e.2 for ; Thu, 07 Dec 2023 16:17:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1701994643; x=1702599443; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=JvX8Mi5E9qyRoOEzQhxDkamqPpxWTtH+S0fBbrqPiIY=; b=X7UycMfwjqZdR7yuTfxadKFIy3HM8IKYmLDEn2siQz4nR3twmBsVvCdtRIhTGCzrCi uvT2yzP/4c/ITCKEYI1z0vfqOHDKTQ+yUEPfbgplCT6TFQVxyKL0d4RRB0rGp+IqdYSe KzFAiKBwcaj2r+9W2lRMHrE/Rjksze4ohA2l0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701994643; x=1702599443; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JvX8Mi5E9qyRoOEzQhxDkamqPpxWTtH+S0fBbrqPiIY=; b=pGycFMB/ZeS82/v2iJE4D/lFobdhFzJX1UnAuhFj9J7xzCIJi0Qx1+iPQU9lPYu4Uo Q1Qpa0FWhoK9hFVVhVsj3hSWGa9+stTz9oJYIpeUNFQAsNm958aNaHTOePeqVWY071OI GzoFZfs3wZxjmy64x99hlWq2xR4BrnbQcdaj8D+JD4KBqnz3tdh2/STkhDNy6s6VQ8uD vHeVyLXvsoPArAZjRUcZ/Bg3CRge23grZLIuywVeRBebi7W41BlsW6Qm4a/9KL/YDsyM 4YH1dDgmee2iMG9ZZwz1SaBOswlSVWTsdc6eEQ8J/qbXPRHqtu1ybANR+me/eC7O9FU3 2j8Q== X-Gm-Message-State: AOJu0Yzc1xHd3WvQAURVa59LqYBI2wK1kLL5r2tZnTDVsvPh5DvYPmVP pyUDPuJF8CqzeRjGCyth3HS5cg== X-Google-Smtp-Source: AGHT+IGtIkUBV4lA54YeUh6j3rLXdE+u58lfNcWYuUV0mjDvgBkimLuKpm3dFV8f6sL6Vo5bWkrnuw== X-Received: by 2002:a05:6358:720d:b0:170:5ca3:af41 with SMTP id h13-20020a056358720d00b001705ca3af41mr4439677rwa.1.1701994643151; Thu, 07 Dec 2023 16:17:23 -0800 (PST) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id o4-20020a056a0015c400b006cdd369e3d0sm356493pfu.201.2023.12.07.16.17.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2023 16:17:22 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, Somnath Kotur , Kalesh AP , Ajit Khaparde , Andy Gospodarek Subject: [PATCH net v3 1/4] bnxt_en: Clear resource reservation during resume Date: Thu, 7 Dec 2023 16:16:55 -0800 Message-Id: <20231208001658.14230-2-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20231208001658.14230-1-michael.chan@broadcom.com> References: <20231208001658.14230-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Somnath Kotur We are issuing HWRM_FUNC_RESET cmd to reset the device including all reserved resources, but not clearing the reservations within the driver struct. As a result, when the driver re-initializes as part of resume, it believes that there is no need to do any resource reservation and goes ahead and tries to allocate rings which will eventually fail beyond a certain number pre-reserved by the firmware. Fixes: 674f50a5b026 ("bnxt_en: Implement new method to reserve rings.") Reviewed-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Andy Gospodarek Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan --- v3: Fix Fixes tag. v2: Fix typo in SoB tag. --- 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 d0359b569afe..72f2fc983940 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -13940,6 +13940,8 @@ static int bnxt_resume(struct device *device) if (rc) goto resume_exit; + bnxt_clear_reservations(bp, true); + if (bnxt_hwrm_func_drv_rgtr(bp, NULL, 0, false)) { rc = -ENODEV; goto resume_exit;