From nobody Fri Jan 19 17:17:46 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 4TGmXB3pPTz56xTL; Fri, 19 Jan 2024 17:17: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 4TGmXB1jZnz4NBl; Fri, 19 Jan 2024 17:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684666; 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=tNG9avuCgBpDKv5o//W5KpCloVbNkxn0wRgc+QH7NxI=; b=DdCYtq198FBR4DIl4mLl9CxdOba0l/Cnie9NuSFl3vEogB/OxvoU8lrKGvX6JZPqoTrt2O 8sCllH0V+YizyKUJ456D0jUbZ2YL/Lwj3hnNbUrS43cRedPfBevOMeCF/cBmllX5mXdOo3 EitwBJtLaGk6VvLno9O3kCXo9eLip02pOuCFyxsGiZAdsZCs2AnDKXKPdxrmuriRKSgvzp q7Cj/iklka6AB15uSryeY9QvgTh5Zktr+hDCPyUPB5ySE6Fz5F4NWVM95o88/VqWdtZg6R QRygFE4RE2L/VcQAIE1brGM4FrzWZoJ2BVr8tenl0y/QUvSuWdoqCas1h7VK2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684666; 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=tNG9avuCgBpDKv5o//W5KpCloVbNkxn0wRgc+QH7NxI=; b=BZK9xZLEv5InzEbcMgGPUNPLesLLDvsWF00+AukN1d95dHwPMpIBFFPXM98mHkmHoNmjsV UD+vX+hP8TGuPyulB8Y6QCetRK/BSTDqkmCZGdhfGRHo25QKiNQFXy0/mrtSwg1ZGels68 nUvKvWy4ti4I2xbkplVCXWZs0Qb21SVHNmzZ3Ws0YGXM/ZpXZslze32Lkh7Z5uw+7w1DT0 xo40lO5EMYWpDf8sWynIFSFsaXzNF4GkxpuHqLARv/fQnEqYdAjqICVeWjVmelYTnUoSvc 6dgXfOe2xV74tuc246i4Am7bkq8+5eHpPTrjHs+R8zk6q5N4/X8g71zgHwBF4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705684666; a=rsa-sha256; cv=none; b=ysKZOtyhYvsN+DkYR3OBqvGVzjRvziOFMEMHztabh4C17CQ5zdvQ6rVHEKtoarOYCHn/qX MLXHKmnd8m6dNAaX3SrpDgNddlu4A10/lrD2DC/x+8nHmhJOfQnLdepDw65WpSC9tmPvHI Nhcxz4E8cboQQlzUOZ7dvJYfgC/WCA420utxDNGGdwz00HYvCSX7cNIxmMiA/A56VWCaMP IP1ja8FD1rl/EEEmrAFhiNaPreVfks0F+caWDVfcCmNhUI4KGFxXrEttS/dBQdh08+gk8y 1ZIO90tjP9gzOwl9qKw+uKsZEO3U0bkQxbru5WWW0op095xeaZMUoOzpnDZrYw== 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 4TGmXB0q3lz10jL; Fri, 19 Jan 2024 17:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40JHHk4m097509; Fri, 19 Jan 2024 17:17:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40JHHkGo097506; Fri, 19 Jan 2024 17:17:46 GMT (envelope-from git) Date: Fri, 19 Jan 2024 17:17:46 GMT Message-Id: <202401191717.40JHHkGo097506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: e2b71e1490a3 - stable/14 - mpi3mr: Minor tweak to task queue pausing 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: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e2b71e1490a37d8e42a6e1dc408cd83296360e1f Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=e2b71e1490a37d8e42a6e1dc408cd83296360e1f commit e2b71e1490a37d8e42a6e1dc408cd83296360e1f Author: Warner Losh AuthorDate: 2023-11-29 01:50:57 +0000 Commit: Alexander Motin CommitDate: 2024-01-19 17:16:50 +0000 mpi3mr: Minor tweak to task queue pausing Use a while loop with cancel / drain to make sure that all tasks have completed before proceeding to reset. Suggested by: jhb Sponsored by: Netflix (cherry picked from commit 272a406042608da9bc3e67e41c6b7fc31d4166b8) --- sys/dev/mpi3mr/mpi3mr.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr.c b/sys/dev/mpi3mr/mpi3mr.c index 73a40b374c1a..01ecceb430d6 100644 --- a/sys/dev/mpi3mr/mpi3mr.c +++ b/sys/dev/mpi3mr/mpi3mr.c @@ -5861,13 +5861,16 @@ static int mpi3mr_issue_reset(struct mpi3mr_softc *sc, U16 reset_type, inline void mpi3mr_cleanup_event_taskq(struct mpi3mr_softc *sc) { /* - * Block the taskqueue before draining. This means any new tasks won't - * be queued to a worker thread. But it doesn't stop the current workers - * that are running. taskqueue_drain waits for those correctly in the - * case of thread backed taskqueues. + * Block the taskqueue before draining. This means any new tasks won't + * be queued to the taskqueue worker thread. But it doesn't stop the + * current workers that are running. taskqueue_drain waits for those + * correctly in the case of thread backed taskqueues. The while loop + * ensures that all taskqueue threads have finished their current tasks. */ taskqueue_block(sc->cam_sc->ev_tq); - taskqueue_drain(sc->cam_sc->ev_tq, &sc->cam_sc->ev_task); + while (taskqueue_cancel(sc->cam_sc->ev_tq, &sc->cam_sc->ev_task, NULL) != 0) { + taskqueue_drain(sc->cam_sc->ev_tq, &sc->cam_sc->ev_task); + } } /**