From nobody Mon Oct 07 17:36:08 2024 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 4XMmXS72k0z5YT1H; Mon, 07 Oct 2024 17:36:08 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XMmXS6X0Dz4k2s; Mon, 7 Oct 2024 17:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728322568; 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=EL8vuF+Cdc9LPGa9lENQJBqble2437ZrkWALqJak0VE=; b=HP9N0DBosYAYTxWyztVZKWEDfOivmu+My185SpWJtP17RqC74rwAf1KUd4b4JfqDOM2I+W RqeE0fB2+dU9dGXvWbWhlnq63k/z6TCMsdFwkObHxEM5Gs3AxNSWieQBeCcgNEu4VR225K 1SK+nSsiRvrcOptL8xUtdr98vQiZQTKWLklTgzyLJ8Cb441D1E/uGlYkj9cbDuN98OBAnM /6aLUh3DY6w6bqqKUi35Hpcm4xskooMlFT3Ima42YNrDKv8ENhEuaGfp4r1ez/UmRW+Urm 3zpC5VH6mDqph1gtvC55RbnthYlSzYNMjXY6WKulI5Xn9bIXbzZBUNNAIJXwdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728322568; 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=EL8vuF+Cdc9LPGa9lENQJBqble2437ZrkWALqJak0VE=; b=Ab/i9zQfzhbMVBC049rqlDEfcITjyQ1UGr7jfzPjstDOKR7r5TCVNJFkgrw3DtvzOUTJlV 53o6nIcrFAMru65wsCIxFISNba8V5hFcOvOUG2zkGm4MrxHdUKDXdELCZASVu8Frnkzvjr AaF3X51JRAPOzgaVJ8cznhm880MwQVJs35QbnJBVtkImIu4px32HVtUIsa8PCvbDlw95B5 k7yHkw3pn5bxyhg0ULAseaCWKK1lFLhsdUcsoXGBjBFt7kqw5mpVNxVFSub1DFIYHIVYPk w3zpg9BIYkHJ8E55Ta+TDTDOYZ/mKdy6Tbxy8gIxzZQqD54OR4l/kcxVhyL0TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728322568; a=rsa-sha256; cv=none; b=Dz5h/GWXUkVsdF2rE58S8wUXmYxIw7VcC8SsrByC3OyUFtEnhTm+FStXH79k6fqus1hl+w OPRa0qRzSuX9IHq3xFiUunlJ4qfJ0WZr0QsdGJDqc4AQgm+yh1xjVkHLRUgwYSldeIgWpv HmAOshRs9WMETHyq+R1/GAKed1tmJCvwXCAbVvO8R5ceongPZr5KVAo6zeHVUStajirsY6 5m56Dok+8k8tmS2D/BHsVVcjNLyC8Qs6z1JKooS/vPGCDfBW/xSli01efwWgpGQ8n20fXA QQhyX0T9Ih9NILgDjwMWSezR+VJy0Fc7EjN7D/lGE5E4BVOr4DBztjZVd+b0Zw== 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 4XMmXS67HkzwML; Mon, 7 Oct 2024 17:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 497Ha82j071393; Mon, 7 Oct 2024 17:36:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 497Ha8N9071390; Mon, 7 Oct 2024 17:36:08 GMT (envelope-from git) Date: Mon, 7 Oct 2024 17:36:08 GMT Message-Id: <202410071736.497Ha8N9071390@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: 52e5a66eac22 - main - cxgbe(4): Use correct synchronization when marking the adapter offline. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 52e5a66eac22d24e29f204c5b65232378e71f4cf Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=52e5a66eac22d24e29f204c5b65232378e71f4cf commit 52e5a66eac22d24e29f204c5b65232378e71f4cf Author: Navdeep Parhar AuthorDate: 2024-10-04 18:11:22 +0000 Commit: Navdeep Parhar CommitDate: 2024-10-07 17:25:53 +0000 cxgbe(4): Use correct synchronization when marking the adapter offline. adapter->flags are guarded by a synch_op, as noted in the comment in adapter.h where the flags are defined. Fixes: 5241b210a4e cxgbe(4): Basic infrastructure for ULDs to participate in adapter reset. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 508f3f08f22a..57cc41bb50fa 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1990,18 +1990,23 @@ restart_adapter(struct adapter *sc) static inline void set_adapter_hwstatus(struct adapter *sc, const bool usable) { - mtx_lock(&sc->reg_lock); if (usable) { /* Must be marked reusable by the designated thread. */ + ASSERT_SYNCHRONIZED_OP(sc); MPASS(sc->reset_thread == curthread); + mtx_lock(&sc->reg_lock); atomic_clear_int(&sc->error_flags, HW_OFF_LIMITS); + mtx_unlock(&sc->reg_lock); } else { /* Mark the adapter totally off limits. */ + begin_synchronized_op(sc, NULL, SLEEP_OK, "t4hwsts"); + mtx_lock(&sc->reg_lock); atomic_set_int(&sc->error_flags, HW_OFF_LIMITS); + mtx_unlock(&sc->reg_lock); sc->flags &= ~(FW_OK | MASTER_PF); sc->reset_thread = NULL; + end_synchronized_op(sc, 0); } - mtx_unlock(&sc->reg_lock); } static int