From patchwork Tue Dec 5 23:44:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13480873 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="D4i3uEp4" Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B62AD122 for ; Tue, 5 Dec 2023 15:44:27 -0800 (PST) Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-77f0b3f1618so157475085a.0 for ; Tue, 05 Dec 2023 15:44:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1701819867; x=1702424667; 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=B8+UIis1C5FIRofcy9HcTllt1lZGjE1cFQ9qpFZJGBk=; b=D4i3uEp4lwtoReJw9K3fLmzPqNwAGr9tol/mtf2oJkx4wPXVRMlPy7yZrb4Y6aSoAX HpZGnurHFFU3OuKuh7AQKfw7DCWy2fVNoaiEWjks8kVVx0q+s3CZC/7nE4vbams/zt9I AEaNjQObroYNKQWq0FbSFS4vKOwNO+xi5R1DI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701819867; x=1702424667; 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=B8+UIis1C5FIRofcy9HcTllt1lZGjE1cFQ9qpFZJGBk=; b=NB1iBCO2U3I+/DMRRYb/1XsAelbKwF0ytRK3n3eKKQGSnIRJMWUlLhRIRi+00mRklt 1QzECIl27P8/Qc8fLlCzQNNkkw0fEhm9HpKCSLJKj87OxagRRihu9dIMRRZOnMhcZOlL MB9kke/srP6zzAKSMqH78FnFvrd3Gpz1ErmhE5bwPQSWtm9U08pEaChxQ1grKGeBT+QD mGWYyfTPFgATaRP0mzMci3YR3/7ffx4+7zMb2hdNWFgiyfHr/13l6MIJInWazvPc+L+H m6Aas+wPgBK4eS1z/lk9kfB8PYAnkA6gK+qI+bDv9yp/d5fVi/DqTbjE76oskeQZh0cp QLYA== X-Gm-Message-State: AOJu0YwYvCZU2i/1tVPKdWJcqQA3e7oou/BLtELYNzHNeiOTzTYoPa5p 9PVg8Lr9MfqJKw0xouAwgiEtMA== X-Google-Smtp-Source: AGHT+IGziAF7ABxS7rE9xBOjsevHQOeFca1H0gE+Kw+AA7qjF0UuA0sRTyjJOpWlynhpodjgKSi8KA== X-Received: by 2002:a05:620a:3724:b0:77b:dd1d:2afb with SMTP id de36-20020a05620a372400b0077bdd1d2afbmr37128qkb.65.1701819866357; Tue, 05 Dec 2023 15:44:26 -0800 (PST) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id y15-20020a37e30f000000b007788bb0ab8esm5450429qki.19.2023.12.05.15.44.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2023 15:44:25 -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 , Michael Chan Subject: [PATCH net 1/4] bnxt_en: Clear resource reservation during resume Date: Tue, 5 Dec 2023 15:44:01 -0800 Message-Id: <20231205234404.17501-2-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20231205234404.17501-1-michael.chan@broadcom.com> References: <20231205234404.17501-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: b4c66425771d ("bnxt_en: refactor bnxt_cancel_reservations()") Reviewed-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Andy Gospodarek Signed-off-by: Somnath Kotur 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 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;