From nobody Mon Feb 28 06:55:44 2022 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 4756519D2A12; Mon, 28 Feb 2022 06:55:46 +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 4K6WNw5SKnz4Rqt; Mon, 28 Feb 2022 06:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646031345; 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=lGDgJZ9+V/8WIaTUHtHR/w0Qkt9Xnma/mJO5JZApY8E=; b=VMJt/BBuryRJUw6BX3+C0Z90YUIlEQ0jZlBaqxplGuy8cgAK7zRTb4KKOQ8uUMf/Evi8Xh kb2t8yHqzZvGWiQvbBsO1FbJeCzjz7KCzTOjw8KbRqjDisTkjEC9dAOKvV74wBM5AS/6Pq s7zo6f14v4GTL8syuNgiwcg4QXP6PZMsvkyqFUUSE9uOE0t2lNWFHx/36yp5KhCCD7VrcV Y5uEWF0+wxxR+icXQvNa8eXalMOpTMyNNjHjtrhBAx/jDmqSXOPoEXfwt3Yy+28/O18pLm hSFRIO0DuwMn5O7MNOWRdHxVQtvzYYxVW8EDXvF2IyedsqjEnqtPOst+5aC/hQ== 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 95AC316D25; Mon, 28 Feb 2022 06:55:44 +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 21S6ti4H077813; Mon, 28 Feb 2022 06:55:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21S6tixv077812; Mon, 28 Feb 2022 06:55:44 GMT (envelope-from git) Date: Mon, 28 Feb 2022 06:55:44 GMT Message-Id: <202202280655.21S6tixv077812@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: b6c0d81f7db2 - stable/13 - cxgbe(4): Fix panic on driver detach after a partially failed attach. 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: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b6c0d81f7db21e5b5a08b006afcd2ff9645595c0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646031345; 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=lGDgJZ9+V/8WIaTUHtHR/w0Qkt9Xnma/mJO5JZApY8E=; b=m/JBEM15wqi3uG01y2bNkrFWDwZP1mYO4Yh0oykGo1G8jaiI5bqbVV4zMaFEkv0LxVF4oH DZudiyynJaN/FISo0GRfIqQvskdGnoHjJwhgiK3nhzUUswWp84Zmnlgid+kd6Gv/MsORA4 /HXXPhos5AHZHyrBhHSv7Du9jeAX7DvQlFtSvJZxIp+8X1swVLruh1JqCpal0encb6km0E LcIDGTM9XdOwGSE9xsMiQelFJmRndZ1iNkHLqKvnzvWqK6IrtaygTVhqt+7Ispm5BqmBT4 Ptlp+NPXQVnnIPdfvUio4CQ6zlkqXoi9mDiTP7NCABn3dgdEL8qnhTNpkBaTPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646031345; a=rsa-sha256; cv=none; b=LnPd36fLwFw/GbxkjjQqmNtiNOQn0OhqliSYkG6CwEdoFzPgBdltTIU1yzwYfc+RiQEFFT HJ0qJNr9irQIBpSkwtIln30NTbM6wSViBohGqnNx25nJ3lCKyy42HmdKMNOL7EmcurI54d Yhi/+DEQkOLCcqsfwD73b21zbSvukoccToxMaus5yLLbuBCgD0QFBikTxRNI0mNUPj2qFc QwwO/eCqdqcafXou2grC0ebO2bpW1ZK0sReUJ7OYSgwrNIGEo2DR0m0Xg1IK0L4W0EV0aC gtEaCSWG5Z3306EI0P33qxlhX1eFceiLslBcjdSgWNM8Qpwt7NZaor9fL6dDyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=b6c0d81f7db21e5b5a08b006afcd2ff9645595c0 commit b6c0d81f7db21e5b5a08b006afcd2ff9645595c0 Author: Navdeep Parhar AuthorDate: 2021-12-29 00:46:09 +0000 Commit: Navdeep Parhar CommitDate: 2022-02-28 06:47:19 +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. Sponsored by: Chelsio Communications (cherry picked from commit b99651c52fa52cdef5688859e0bc7f3fb2085a2f) --- 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 bddacb448ff5..cbfaa7a6db60 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -1077,7 +1077,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); }