From nobody Wed Dec 29 05:31:36 2021 X-Original-To: dev-commits-src-all@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 35C1F19167C9; Wed, 29 Dec 2021 05:31:37 +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 4JP0Q06pjcz3p3V; Wed, 29 Dec 2021 05:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C9D8B1F474; Wed, 29 Dec 2021 05:31:36 +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 1BT5VaZc084859; Wed, 29 Dec 2021 05:31:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BT5VaQv084858; Wed, 29 Dec 2021 05:31:36 GMT (envelope-from git) Date: Wed, 29 Dec 2021 05:31:36 GMT Message-Id: <202112290531.1BT5VaQv084858@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: b99651c52fa5 - main - cxgbe(4): Fix panic on driver detach after a partially failed attach. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b99651c52fa52cdef5688859e0bc7f3fb2085a2f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640755897; 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=/SoIAWMDxNyoolOyloSPYNHfN25CEUSdmkUXvEuXanw=; b=Zq+xovA6Q0F6kT0LZ4DlESE0NJFpPbdyfBro/x0dGJXS3sXQYF/55KChCH2cgdyTk8BiiJ 6KhV00SnodVDDU8UsDIT9IRz/tTGEnwhT8yDGownGjyYXPfhvQVl1BgHtgTXDCs7pYdax5 3x8en5AGREiLQNo2bvTpPLHJWrwA9aKSRZNtCMfL/iuw8MlmwdIApDP1KhaNBwM8R9plij hm4MasOddKLZaW7xEU4insGn+n46mEJhfXxmDygUUHL9GvYgAHKnIc2JQ0ArL/FxTZbVDM 5eVDRzwZeA4T1jxdDJK9YWxFiuls7t3W+3BA7QZQlzhkywodmuZ9tBjMWezYRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640755897; a=rsa-sha256; cv=none; b=e2M3GUnJU+xpR1KS+uA+jlctD3RJtxvpCk2jgTllt+1ywxR79vss299yBjFdDLqrRdpPTc aPEdIdRPcMqYcCn8S4mpQYWey2shJtyTIUl9Bq55jK5e2l+wnCggIZWXLjT0RU8r0qA+Tv lexNWpZWbTQjLZqLW1hOdWOJha1Xaen34jJR/KflT39H/bAx5R51xeNY6mEpTQ3hs1hTeE PEI9DQQVVtKTeoE71pF38RAxMzpanwV2niG8i49jmAhl6F4mnGIkO/qG+sFPJrRulRGqM9 7C30iFjlELmpn3ozEsBnlPsskUAiD4Aub2dzqB5+L5IDHJil0n5alvDM0DOLPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=b99651c52fa52cdef5688859e0bc7f3fb2085a2f commit b99651c52fa52cdef5688859e0bc7f3fb2085a2f Author: Navdeep Parhar AuthorDate: 2021-12-29 00:46:09 +0000 Commit: Navdeep Parhar CommitDate: 2021-12-29 00:57:37 +0000 cxgbe(4): Fix panic on driver detach after a partially failed attach. sge->ctrlq is not always allocated during attach (eg. if firmware initialization fails) and detach should be able to deal with this. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_sge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index c2f2f0a13f5b..a2948665fbd6 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -1078,7 +1078,8 @@ t4_teardown_adapter_queues(struct adapter *sc) ADAPTER_LOCK_ASSERT_NOTOWNED(sc); - if (!(sc->flags & IS_VF)) { + if (sc->sge.ctrlq != NULL) { + MPASS(!(sc->flags & IS_VF)); /* VFs don't allocate ctrlq. */ for_each_port(sc, i) free_ctrlq(sc, i); }