From nobody Mon Mar 10 17:35:40 2025 X-Original-To: dev-commits-src-main@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 4ZBPDs0FNtz5r7Hf; Mon, 10 Mar 2025 17:35:41 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZBPDr3K14z3Th2; Mon, 10 Mar 2025 17:35:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741628140; 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=EaSoCk53SCn+HH0w0vKfwbZR49n29ae723ONldHCaEY=; b=TcKbizTzz6wIu8/8FLweSCksmL3CcPY2YUs2O5xm64JPqTv1fISdbNc9vZieTSFrfHYDcj 2b7uoXt5n9mhSSRq6d2n9BiOsBeE7rHC95MakffgwvQz7XcqwsSQ1NVZuHvp/IdD/gYqhs Q0IuwXvxH+j3F4FXrvUU7/Hzjj9ayYOXnOPMph7LxY0f6hTu/Rczg1c5uDsyWCOZuer5Gs vOBu8whr6Wf+2N4YXdr6l4hoKRcL/JPUuNkb1dUaMJqr34TQQgtWvHk/ikoQWhAdBuseww mb5sAzx1Ozwx57IAvyGcZsczKEFMT24HKH/xvlPFbAE1xowSzdAFEXelXhRffA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741628140; a=rsa-sha256; cv=none; b=JaahXx0txGRephAqPKs7AgqYB84qQLGGQXdWjIwHtZKkx/q1Hcw4h4nA4I2giaraV99WPu aj95NeCj9AI14CrA7rNyjTjq2ZHecrYXbH48TXZaLubKZhdDfqxEEK9kVy2g1RG/lXjtDs 7pFdGvdaoRS+921MkB2mgwK5A71YlRRHmlYAtsU0imHO89Ze0ijnyq9AQkwaYcOsmc//OV +H+eyfnjw1w3MkkMHgLZYCtl1u3nfi6jqUpwsvnjo8NL2ZYBdqR5QVMiceQGF+Ebvlvjnt zgAb8xKdtdZdNuDjT4fEHELv+9i5GLSmNMkaZqNSjEaFgfZk/ufbuhn9STpyBg== 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=1741628140; 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=EaSoCk53SCn+HH0w0vKfwbZR49n29ae723ONldHCaEY=; b=U1jzSbmpDqw01ALDW7E4tHFZfE+odB1cBUi5S+vF/DBjamd28+6H/rw53ZBpud3SMGyrHD vi11gQTN8WvF4qMRfEpDNhowkZJ2WAN0BYof1psfI7C5d9R6llLeIpUsQJMzg+Nw9CM8iQ 9+BxqoxT2tgP+Ie2AeCXNDkP8kC/Uhm/atR6KSjQsqwMYBvFUd9aIYWNLZGRrnDEeQSbS7 5W8rrm1O3opEinhDox097sJaj+EEGvwiQh9iggfbz3kmgaU5tDoBGwOaTVCtGX3lo9MM1d ywFyhDkYGdA9qxT6GhkWeW6Rc+ppGRPn7uZ4+CsKnxl86eI2kFLjFAbVcQD0Dw== 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 4ZBPDr2wbBzqBw; Mon, 10 Mar 2025 17:35:40 +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 52AHZewe027069; Mon, 10 Mar 2025 17:35:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52AHZeRi027066; Mon, 10 Mar 2025 17:35:40 GMT (envelope-from git) Date: Mon, 10 Mar 2025 17:35:40 GMT Message-Id: <202503101735.52AHZeRi027066@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b23314ecb99c - main - pcib: Use taskqueue_bus for hot-plug events instead of a private taskqueue List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: b23314ecb99cedef1090bdaa486fbd25aa5a9558 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b23314ecb99cedef1090bdaa486fbd25aa5a9558 commit b23314ecb99cedef1090bdaa486fbd25aa5a9558 Author: John Baldwin AuthorDate: 2025-03-10 17:32:38 +0000 Commit: John Baldwin CommitDate: 2025-03-10 17:32:38 +0000 pcib: Use taskqueue_bus for hot-plug events instead of a private taskqueue Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D49269 --- 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 44cbf327868c..10133c0c68d9 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -800,8 +800,6 @@ SYSCTL_INT(_hw_pci, OID_AUTO, enable_pcie_hp, CTLFLAG_RDTUN, &pci_enable_pcie_hp, 0, "Enable support for native PCI-express HotPlug."); -TASKQUEUE_DEFINE_THREAD(pci_hp); - static void pcib_probe_hotplug(struct pcib_softc *sc) { @@ -888,7 +886,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); } } @@ -904,7 +902,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); } @@ -1023,10 +1021,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); @@ -1038,7 +1036,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 @@ -1066,14 +1064,14 @@ 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. */ device_printf(dev, "Attention Button Pressed: Detaching in 5 seconds\n"); sc->flags |= PCIB_DETACH_PENDING; - taskqueue_enqueue_timeout(taskqueue_pci_hp, + taskqueue_enqueue_timeout(taskqueue_bus, &sc->pcie_ab_task, 5 * hz); } } @@ -1271,11 +1269,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(); @@ -1321,13 +1319,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; @@ -1350,10 +1348,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