From nobody Thu Oct 19 21:24:04 2023 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 4SBLLs1vfRz4xtkV; Thu, 19 Oct 2023 21:24:05 +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 4SBLLs167Cz4LyF; Thu, 19 Oct 2023 21:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697750645; 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=tfqc8nJi+rcAucZ10vCGyx8YY8dcZm1CJBMa1B8ac/c=; b=s0cIvU6gZAEN1h95XgSffeDyl2bioVa4nzAvVUsdQP7ZEG+GRtQerXx5PMkkqPExrH6QMG xnWzzeHbmznkbyPTNY1PHiM+8SZj5LIKxHrB55lmhgsWp0a6RzHSR1tuGk5SEk3GZtqgkU cEJYk8PEU1vi9vYWO6Q/szmeiXn42vc7pnq2ZgJ4/eu6aLdxa0yk4R79R4IOZlVLA8s+r/ C/XSqGW8RsMvqBhthoeHyLskeKRh/gGoYWE+V1a+ekJlZpVfnLdu/Wb7rHE2nBMAwOIcfE RCgUOQ+8zzIsQlB6GMbRn+vnCV+MgoTCoVpPGasmwI7LU1yDrL1JlacmLvyo6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697750645; a=rsa-sha256; cv=none; b=Ip5KhD66pnJyB1URxhlXFHgmyakKkLT+hwBXZincNSa9WiOU8Zi51qgxiTDJspvp+zAaau NbuQ26wkWgGP+fhqmamnbCTFfy+bxh8doctSX/gdN3m8x+rdtfGbWNOrJryuLANnv9fusN w4AroU+cZkATCVMC6zqba/gQW/XjSgcxecLnR74j2aYBZ8UM1KtTL107vCEScgrXbgZRUn 8dlArTzwONH38gNtuIhp0KkEL53BtT4a2rBQXimi78l0XZzO8Tfz7PceL/4NzV3oXRPAHA z2Lo0zZlSjqzj3asfE/4vbt+y8Np+eCfFrHeEhdFFAr1bc0Cke8DUKw/pEKDAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697750645; 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=tfqc8nJi+rcAucZ10vCGyx8YY8dcZm1CJBMa1B8ac/c=; b=U4i7fIdG24Gct874c0cRbjLOgczhysqA0qfAs4u45vpAKSsVuhQpFqVgfPvggz3iB4hct7 YK7gOiaUl+ZEDa2qitVQNTFbmmG2JxFSLEI96au69k33uclKornmR5lG7bugPqYvxae7pq hSZJcP6zxWUhZ6t73ExkaJB1Zk6CylCXYX91lguyyJ4mYeHw2rAIqhgoFp6L5FXIRQayio XGAsiLU+wgkgqF6i2MvhrALNfeuvakO8dngKKKVpRcH8Dt2nROue5YC9x+QxAOJztDYvUA oGB40rLjJliYfWMnrTQXnMd47zNy9RNKwEfwVdeI6jYy3mVtcz1NUJY8QrfsCQ== 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 4SBLLs059qz15f4; Thu, 19 Oct 2023 21:24:05 +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 39JLO4xH076794; Thu, 19 Oct 2023 21:24:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39JLO4OL076791; Thu, 19 Oct 2023 21:24:04 GMT (envelope-from git) Date: Thu, 19 Oct 2023 21:24:04 GMT Message-Id: <202310192124.39JLO4OL076791@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: 10bbea2e25ef - stable/14 - mpi3mr: Move creation of watchdog to interupt config hook 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 10bbea2e25ef95936619b6522bbdeea2317e76a5 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=10bbea2e25ef95936619b6522bbdeea2317e76a5 commit 10bbea2e25ef95936619b6522bbdeea2317e76a5 Author: Sumit Saxena AuthorDate: 2023-10-19 21:15:50 +0000 Commit: Warner Losh CommitDate: 2023-10-19 21:21:12 +0000 mpi3mr: Move creation of watchdog to interupt config hook Move creation of watchdog process from just before we configure the interrupt config hook to into the config hook itself. This prevents it from racing the config intr hook and doing an extra reset of the card. This extra reset is usually harmless, but sometimes it can prevent discovery of devices if done at just the wrong time. This can lead to no disks being registered in a box full of disks, for example. Starting it later eliminates this race, making discovery reliable. Reviewed by: imp (cherry picked from commit 7e02c7074c4c6df77b860e0dbcd032a2ea04b98b) --- sys/dev/mpi3mr/mpi3mr_pci.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr_pci.c b/sys/dev/mpi3mr/mpi3mr_pci.c index d7278e5549e7..4935ac0d519c 100644 --- a/sys/dev/mpi3mr/mpi3mr_pci.c +++ b/sys/dev/mpi3mr/mpi3mr_pci.c @@ -307,6 +307,7 @@ static void mpi3mr_ich_startup(void *arg) { struct mpi3mr_softc *sc; + int error; sc = (struct mpi3mr_softc *)arg; mpi3mr_dprint(sc, MPI3MR_XINFO, "%s entry\n", __func__); @@ -314,8 +315,16 @@ mpi3mr_ich_startup(void *arg) mtx_lock(&sc->mpi3mr_mtx); mpi3mr_startup(sc); + mtx_unlock(&sc->mpi3mr_mtx); + error = mpi3mr_kproc_create(mpi3mr_watchdog_thread, sc, + &sc->watchdog_thread, 0, 0, "mpi3mr_watchdog%d", + device_get_unit(sc->mpi3mr_dev)); + + if (error) + device_printf(sc->mpi3mr_dev, "Error %d starting OCR thread\n", error); + mpi3mr_dprint(sc, MPI3MR_XINFO, "disestablish config intrhook\n"); config_intrhook_disestablish(&sc->mpi3mr_ich); sc->mpi3mr_ich.ich_arg = NULL; @@ -443,14 +452,6 @@ mpi3mr_pci_attach(device_t dev) goto load_failed; } - error = mpi3mr_kproc_create(mpi3mr_watchdog_thread, sc, - &sc->watchdog_thread, 0, 0, "mpi3mr_watchdog%d", - device_get_unit(sc->mpi3mr_dev)); - if (error) { - device_printf(sc->mpi3mr_dev, "Error %d starting OCR thread\n", error); - goto load_failed; - } - sc->mpi3mr_ich.ich_func = mpi3mr_ich_startup; sc->mpi3mr_ich.ich_arg = sc; if (config_intrhook_establish(&sc->mpi3mr_ich) != 0) {