From nobody Tue Apr 29 18:30:37 2025 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 4Zn85C0562z5vN1v; Tue, 29 Apr 2025 18:30:39 +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 4Zn85B2S9jz4HMM; Tue, 29 Apr 2025 18:30:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745951438; 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=rFhOKJUGtbIEHygu9mFI/C1fN4fvSF3NoEcVWasaY+8=; b=nNPjv8XOi8rGHO26Gy6SFQF4eq44Z963VfKMHPCqrFcQwZJoIcyaGRSJLESe8632YbcU7Q 4NHaBV1nT7Q64uqgAcjGF8QLYBl3cZghS2PADPWLVfjQVwcD0OHqgJi5aqj47XthEVn2Ut /w02b/t6AGywzQay/S8qfbOHU/5JEiayzjOAkswnCASwR/qUl5JXxqsNROEThVGMJkUzME a2bbQr2Vsf0exmX5Xzkiu0fgmnQfWnTGyJLjdiGNloHT8mEmtBQlh/1kA/j7g3DOumh7GD PuHeKoCmHHmjllWWnhKGnXUytPFx/l0TnnxlxAn1Gm10mMD/et/8Kwj5lX4njA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745951438; a=rsa-sha256; cv=none; b=DGpcBek0ZleWbAbRnG+JQc5Jcjgthx1aax3ncJJ3Yw02i36l5uwccWQ5oYdhp2ELoc7g/M FuVIwKPxxXAsO5c4iLVmvQeY2HOJEHxsJFI3+yEIlKSjgcIIcgf4PcdOEwWMu00Y4Y5Vr7 vIHUFX8sBReIDs8qV1HM0oHglSO1tUc7JJT7RJKNPE2DYPUt8yfT4DmmSsGQWZTLti5XGz Cih2e3PGtecInWcdk00TtBRor6OHPn/HSHh4FmSO76tp+PhJg2VFS9v03pnT62JoTAKgge ls+jm5cxB1lYGI83AvS4IAHWy7VVmKPDhXwJfB/WWBtdsggWDiEzhPvdbmqriw== 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=1745951438; 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=rFhOKJUGtbIEHygu9mFI/C1fN4fvSF3NoEcVWasaY+8=; b=bRg5VJzwoZ41+8LGC60AKOPvnANhlgvnOxZgCazM3tYid27U4C0t45kF6cBDbdmunleJDT bFykxD8dE4rPBKaAzjxZMfor3KXfbKlPSl3ZDwQJr8cTDdVZqIi9ANJwVrY1bTG23vn60f O0/1aj8GxolW62EDiw3lS/3tm/hLAyUavjbZn4J7qLDEzd+1MG95hgVDyQxufyRLs9A0+f hbtJtT8O+IH+I+G4D05WJI7VlyqDkKulmSpIcQPzlx65Pksf+9+uPGdOD1YMpnfnPlQZWQ 3etHXUa01qAV1LtvoKF4lazESsAXwfm8RZ1KtNDZFl67PTDORLUdGn96vZQOdQ== 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 4Zn8594ypQzXV6; Tue, 29 Apr 2025 18:30:37 +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 53TIUbFP022555; Tue, 29 Apr 2025 18:30:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53TIUbb4022552; Tue, 29 Apr 2025 18:30:37 GMT (envelope-from git) Date: Tue, 29 Apr 2025 18:30:37 GMT Message-Id: <202504291830.53TIUbb4022552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 50c1d075dc8e - stable/14 - pcib: Use taskqueue_bus for hot-plug events instead of a private taskqueue 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 50c1d075dc8edf43af95e29b1664d8d7e8db5528 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=50c1d075dc8edf43af95e29b1664d8d7e8db5528 commit 50c1d075dc8edf43af95e29b1664d8d7e8db5528 Author: John Baldwin AuthorDate: 2025-03-10 17:32:38 +0000 Commit: John Baldwin CommitDate: 2025-04-29 14:36:16 +0000 pcib: Use taskqueue_bus for hot-plug events instead of a private taskqueue Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D49269 (cherry picked from commit b23314ecb99cedef1090bdaa486fbd25aa5a9558) --- sys/dev/pci/pci_pci.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index a9567b3e2c4c..eedfc671f577 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -956,8 +956,6 @@ SYSCTL_SBINTIME_MSEC(_hw_pci, OID_AUTO, pcie_hp_detach_timeout, CTLFLAG_RWTUN, &pcie_hp_detach_timeout, "Attention Button delay for PCI-express Eject."); -TASKQUEUE_DEFINE_THREAD(pci_hp); - static void pcib_probe_hotplug(struct pcib_softc *sc) { @@ -1044,7 +1042,7 @@ pcib_pcie_hotplug_command(struct pcib_softc *sc, uint16_t val, uint16_t mask) (ctl & new) & PCIEM_SLOT_CTL_CCIE) { sc->flags |= PCIB_HOTPLUG_CMD_PENDING; if (!cold) - taskqueue_enqueue_timeout(taskqueue_pci_hp, + taskqueue_enqueue_timeout(taskqueue_bus, &sc->pcie_cc_task, hz); } } @@ -1060,7 +1058,7 @@ pcib_pcie_hotplug_command_completed(struct pcib_softc *sc) device_printf(dev, "Command Completed\n"); if (!(sc->flags & PCIB_HOTPLUG_CMD_PENDING)) return; - taskqueue_cancel_timeout(taskqueue_pci_hp, &sc->pcie_cc_task, NULL); + taskqueue_cancel_timeout(taskqueue_bus, &sc->pcie_cc_task, NULL); sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING; wakeup(sc); } @@ -1179,10 +1177,10 @@ pcib_pcie_hotplug_update(struct pcib_softc *sc, uint16_t val, uint16_t mask, device_printf(sc->dev, "Data Link Layer inactive\n"); else - taskqueue_enqueue_timeout(taskqueue_pci_hp, + taskqueue_enqueue_timeout(taskqueue_bus, &sc->pcie_dll_task, hz); } else if (sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE) - taskqueue_cancel_timeout(taskqueue_pci_hp, &sc->pcie_dll_task, + taskqueue_cancel_timeout(taskqueue_bus, &sc->pcie_dll_task, NULL); pcib_pcie_hotplug_command(sc, val, mask); @@ -1194,7 +1192,7 @@ pcib_pcie_hotplug_update(struct pcib_softc *sc, uint16_t val, uint16_t mask, */ if (schedule_task && (pcib_hotplug_present(sc) != 0) != (sc->child != NULL)) - taskqueue_enqueue(taskqueue_pci_hp, &sc->pcie_hp_task); + taskqueue_enqueue(taskqueue_bus, &sc->pcie_hp_task); } static void @@ -1222,7 +1220,7 @@ pcib_pcie_intr_hotplug(void *arg) device_printf(dev, "Attention Button Pressed: Detach Cancelled\n"); sc->flags &= ~PCIB_DETACH_PENDING; - taskqueue_cancel_timeout(taskqueue_pci_hp, + taskqueue_cancel_timeout(taskqueue_bus, &sc->pcie_ab_task, NULL); } else if (old_slot_sta & PCIEM_SLOT_STA_PDS) { /* Only initiate detach sequence if device present. */ @@ -1231,7 +1229,7 @@ pcib_pcie_intr_hotplug(void *arg) "Attention Button Pressed: Detaching in %ld ms\n", (long)(pcie_hp_detach_timeout / SBT_1MS)); sc->flags |= PCIB_DETACH_PENDING; - taskqueue_enqueue_timeout_sbt(taskqueue_pci_hp, + taskqueue_enqueue_timeout_sbt(taskqueue_bus, &sc->pcie_ab_task, pcie_hp_detach_timeout, SBT_1S, 0); } else { @@ -1433,11 +1431,11 @@ pcib_setup_hotplug(struct pcib_softc *sc) dev = sc->dev; TASK_INIT(&sc->pcie_hp_task, 0, pcib_pcie_hotplug_task, sc); - TIMEOUT_TASK_INIT(taskqueue_pci_hp, &sc->pcie_ab_task, 0, + TIMEOUT_TASK_INIT(taskqueue_bus, &sc->pcie_ab_task, 0, pcib_pcie_ab_timeout, sc); - TIMEOUT_TASK_INIT(taskqueue_pci_hp, &sc->pcie_cc_task, 0, + TIMEOUT_TASK_INIT(taskqueue_bus, &sc->pcie_cc_task, 0, pcib_pcie_cc_timeout, sc); - TIMEOUT_TASK_INIT(taskqueue_pci_hp, &sc->pcie_dll_task, 0, + TIMEOUT_TASK_INIT(taskqueue_bus, &sc->pcie_dll_task, 0, pcib_pcie_dll_timeout, sc); sc->pcie_hp_lock = bus_topo_mtx(); @@ -1483,13 +1481,13 @@ pcib_detach_hotplug(struct pcib_softc *sc) /* Disable the card in the slot and force it to detach. */ if (sc->flags & PCIB_DETACH_PENDING) { sc->flags &= ~PCIB_DETACH_PENDING; - taskqueue_cancel_timeout(taskqueue_pci_hp, &sc->pcie_ab_task, + taskqueue_cancel_timeout(taskqueue_bus, &sc->pcie_ab_task, NULL); } sc->flags |= PCIB_DETACHING; if (sc->flags & PCIB_HOTPLUG_CMD_PENDING) { - taskqueue_cancel_timeout(taskqueue_pci_hp, &sc->pcie_cc_task, + taskqueue_cancel_timeout(taskqueue_bus, &sc->pcie_cc_task, NULL); tsleep(sc, 0, "hpcmd", hz); sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING; @@ -1512,10 +1510,10 @@ pcib_detach_hotplug(struct pcib_softc *sc) error = pcib_release_pcie_irq(sc); if (error) return (error); - taskqueue_drain(taskqueue_pci_hp, &sc->pcie_hp_task); - taskqueue_drain_timeout(taskqueue_pci_hp, &sc->pcie_ab_task); - taskqueue_drain_timeout(taskqueue_pci_hp, &sc->pcie_cc_task); - taskqueue_drain_timeout(taskqueue_pci_hp, &sc->pcie_dll_task); + taskqueue_drain(taskqueue_bus, &sc->pcie_hp_task); + taskqueue_drain_timeout(taskqueue_bus, &sc->pcie_ab_task); + taskqueue_drain_timeout(taskqueue_bus, &sc->pcie_cc_task); + taskqueue_drain_timeout(taskqueue_bus, &sc->pcie_dll_task); return (0); } #endif