From nobody Thu Jan 19 03:52:20 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xK2Pj0z2svYg; Thu, 19 Jan 2023 03:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xK1Pfrz3j7K; Thu, 19 Jan 2023 03:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SEKL27m47ZJNOzhYTYffYUVeKvzr4xUPsmEvI+MWTPE=; b=Mlyuj4eXBiWxgG3mguHZiJsXWqaNdI9fng0VISU5EY46CtMy1IYxNa0lDBHt9QcZd+5Ddl a2d61aUh0Z6vTeomnzMaDFwLmQrPhd61IQ/jdZgP0rS4Rxm8eLcy/nc1cQKT5KH6Pu6Ejs ruq82xRgqdnIozDKKRMZ97Bnl/gRleXwTdmSFcgGXO18MsBc/0c+4hUxkonW9KNSSyo8px l8+EUJmr+9SvQj5gp6LvDuXtQMlf+gyNJAnyC5Je+O78uUxmG8831U1G4YqgqlhbM4XaTp SB8xjWhRIDkg735EuHfoJ/zPdNBjt1Bg0x3Xg/2A+kGEoFIhH3B3xOCTsJ+Rdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SEKL27m47ZJNOzhYTYffYUVeKvzr4xUPsmEvI+MWTPE=; b=Y7p2N1J0RrJeQmxXISoC+P92PChq4KIEW0Qf7uiNnmGhCyGWBeeO1IW9LdEu3xNbepyLtm F+PC6/aro+iacNnWXi6QA5mFzFW/syvGT8VGM9G1AZ5xHC4TL7j+hvaUe8qfCONTFbE0OF zayXiL969uPtVF0KnfrjQyTkCgKXYTXUS9u3ez5GXHo9ijyAaqqUVh0eBn6xGcBvGMQEE+ KJne/jZsJQug2LACSzB2CoTlt+FoHVsC6A/4MOXfmtjAp7svbH+qZ1S1mBSlhA76lSR9RT T0H6KEJtSskrDp4vjMTgL8ORBxf3wonrNATowLr0gjUhXFPtp4lAG+uGtGxAjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100341; a=rsa-sha256; cv=none; b=K//Bq1ik8qauLBq1hjTM0z04LCDyKLZA+vNtJTLtqAyCE/JM+o0Y1wSti3zYWqlmpXKbw5 g6amOKkJnMa5GKiX2CAdP/Mp9XwWTFkzUgPLOtdOOyKmtdAPwnUmfp8qIn857OucTMXTDI zgoAbt8SRupBiIAbHzAVy6gBizm4HDrxxyqbD3c891ooo6VKLqw5CrhbI8nngfCV8ojv9q Qn83sDLCiYr1SauBXsi2l4Fq07F0tYZ4G98qEPNIY+j8N/we/VdfG6jR08NtTYnEnHMnQd gB+RDqOMdN7tU/ksuMvdcCywKxFw5KgydQ3I79bgpjVvIVUlxmQtT0lAHxrXpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xJ4T7jzcfm; Thu, 19 Jan 2023 03:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qKhY024675; Thu, 19 Jan 2023 03:52:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qKf0024662; Thu, 19 Jan 2023 03:52:20 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:20 GMT Message-Id: <202301190352.30J3qKf0024662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: eed0ac16edb5 - stable/13 - if_bnxt: Fix the issue when kernel invokes _init() again without _stop() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eed0ac16edb5aa0bb60780e2c11db40661716ab2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=eed0ac16edb5aa0bb60780e2c11db40661716ab2 commit eed0ac16edb5aa0bb60780e2c11db40661716ab2 Author: Sumit Saxena AuthorDate: 2022-11-04 22:28:51 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:06 +0000 if_bnxt: Fix the issue when kernel invokes _init() again without _stop() Fixed the issue when kernel invokes _init() when it is already in _init() state by invoking _stop() in such case. Reviewed by: imp Differential Revsion: https://reviews.freebsd.org/D36445 (cherry picked from commit baef1301a2bc60be3908f44dff1f83dbbd8f812a) --- sys/dev/bnxt/bnxt.h | 1 + sys/dev/bnxt/if_bnxt.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index f8f3f4ccc2f5..0d5824722b41 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -738,6 +738,7 @@ struct bnxt_softc { struct bnxt_ver_info *ver_info; struct bnxt_nvram_info *nvm_info; bool wol; + bool is_dev_init; struct bnxt_hw_lro hw_lro; uint8_t wol_filter_id; uint16_t rx_coal_usecs; diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index bc6dd1c2b1c5..8b26b4d64436 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -1749,7 +1749,11 @@ bnxt_init(if_ctx_t ctx) rc = bnxt_hwrm_func_reset(softc); if (rc) return; + } else if (softc->is_dev_init) { + bnxt_stop(ctx); } + + softc->is_dev_init = true; bnxt_clear_ids(softc); // TBD -- Check if it is needed for Thor as well @@ -1909,8 +1913,8 @@ bnxt_stop(if_ctx_t ctx) { struct bnxt_softc *softc = iflib_get_softc(ctx); + softc->is_dev_init = false; bnxt_do_disable_intr(&softc->def_cp_ring); - bnxt_hwrm_func_reset(softc); bnxt_func_reset(softc); bnxt_clear_ids(softc); return;