From nobody Thu Feb 27 14:16:32 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 4Z3YL83vbZz5qFrK; Thu, 27 Feb 2025 14:16:32 +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 4Z3YL83HQ0z3xFv; Thu, 27 Feb 2025 14:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665792; 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=Iki9p/ojcXUO20vhyd1XGwOEY8QvaLkGpGtXz0BMy7Q=; b=NXJ6RSvzE+c4o8zHvGNWZwCAUUUFX1s6wE2m065/5yT7aTgbRd76s+TurM5eYmz2LQtPcN G3ZJ/LEAHSIBDZNGdkO+YxRQxxXDAc9yRwNSEpH5o7hjxaT3yB/TaanditdhO1hgKWnBzz Zbg4nkZd/XGrbJPed+WsXq+Vuw49jJcjR4wwjvGmgPC7o9a4e56glQN8DB9t/4pNJyY1G9 VDeC3bEl2iCYzMm7/+YVzoNMgATqxaca97MqfqhOXN+YuKiWWPQj8yfEe/66I23MHtIC78 4yM5inTG70OPk4TZuRwTAszlCp0Lx32B5+zTV4oJ/39lMsFDvoLe+np6OSPKRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665792; a=rsa-sha256; cv=none; b=ypFBSEMtSnpNJGT3boD18QOjHY/+bQQiNLxIfx+fMWHVxlM3kyUAW54El4qGMmO/E8Nu1E XRxuDmEo5/cxYpBmQukaDVhe1W5QdqEM/vIYIe/ACnGTwRalGTMj2MSd6smxzSp/6LLC44 BSnUeAyDY59DgZjFzH9JISt0rg/WpwUUcv7KvWvJDotqyU/Ri+4rGI+7zDkhnj5/jIZzrI 2y8IVHNyXmD+m7ST9uXhPyWKPk8dFp+lLagDRaxzlLVzH0QkNjo+sWl0KqA6YhV0XpT2jq 7KpLXscWKmu24kozTd7Yt0QkGdJ7j69BuNDCPG1BKw+AHMyiww33/yqVFsbc8Q== 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=1740665792; 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=Iki9p/ojcXUO20vhyd1XGwOEY8QvaLkGpGtXz0BMy7Q=; b=iDaF4/RuUhh0WtybB6G/XdzKXpHecTfFGOmloo009YpBcDdbCJSuKHvUf7Q7572aRiKu6Y 2jNidPkci1GCxvEvI2+onhwAx8TgvMRp9KqULpmBVWwqfFLhW1rxfi6tE06dHCdFU+8czM XEmuo1EaUvUnUtrChIn71+DfFM6UJJNGJVcFs4bILrlGEYynk5BYSK1xWwGCI9yj21ox0B VEQiy7qbcJuxMW/zCHaLCesSJOQvq4qK8phUrUWzpaiHIWZJbu/hfwjzMf+uzAxI2+2BQ1 S8vZ/BWB7Jt/XkRF/tTAgjp5lVb+Oe68qax47hRY1pOvsDQYsE1Gj7Y0ps5a8Q== 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 4Z3YL82nykzmpX; Thu, 27 Feb 2025 14:16:32 +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 51REGWls015652; Thu, 27 Feb 2025 14:16:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGW0o015649; Thu, 27 Feb 2025 14:16:32 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:32 GMT Message-Id: <202502271416.51REGW0o015649@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: d65f66c98337 - stable/14 - hyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources 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: d65f66c983376223b2a832e0cae71b7ec4dd38d5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d65f66c983376223b2a832e0cae71b7ec4dd38d5 commit d65f66c983376223b2a832e0cae71b7ec4dd38d5 Author: John Baldwin AuthorDate: 2024-01-23 17:35:58 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 hyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources Specifically for bus_activate/adjust/deactivate_bus methods. Differential Revision: https://reviews.freebsd.org/D43431 (cherry picked from commit 9c4effb1063d49748b4b7da4cc54f508ccad41fc) --- sys/dev/hyperv/pcib/vmbus_pcib.c | 41 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c b/sys/dev/hyperv/pcib/vmbus_pcib.c index be66393a7ab4..03fc5f09be6c 100644 --- a/sys/dev/hyperv/pcib/vmbus_pcib.c +++ b/sys/dev/hyperv/pcib/vmbus_pcib.c @@ -1712,6 +1712,18 @@ vmbus_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, return (res); } +static int +vmbus_pcib_adjust_resource(device_t dev, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ + struct vmbus_pcib_softc *sc = device_get_softc(dev); + + if (type == PCI_RES_BUS) + return (pci_domain_adjust_bus(sc->hbus->pci_domain, child, r, + start, end)); + return (bus_generic_adjust_resource(dev, child, type, r, start, end)); +} + static int vmbus_pcib_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) @@ -1728,6 +1740,30 @@ vmbus_pcib_release_resource(device_t dev, device_t child, int type, int rid, return (bus_generic_release_resource(dev, child, type, rid, r)); } +static int +vmbus_pcib_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct vmbus_pcib_softc *sc = device_get_softc(dev); + + if (type == PCI_RES_BUS) + return (pci_domain_activate_bus(sc->hbus->pci_domain, child, + rid, r)); + return (bus_generic_activate_resource(dev, child, type, rid, r)); +} + +static int +vmbus_pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct vmbus_pcib_softc *sc = device_get_softc(dev); + + if (type == PCI_RES_BUS) + return (pci_domain_deactivate_bus(sc->hbus->pci_domain, child, + rid, r)); + return (bus_generic_deactivate_resource(dev, child, type, rid, r)); +} + static int vmbus_pcib_get_cpus(device_t pcib, device_t dev, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) @@ -1981,9 +2017,10 @@ static device_method_t vmbus_pcib_methods[] = { DEVMETHOD(bus_read_ivar, vmbus_pcib_read_ivar), DEVMETHOD(bus_write_ivar, vmbus_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, vmbus_pcib_alloc_resource), + DEVMETHOD(bus_adjust_resource, vmbus_pcib_adjust_resource), DEVMETHOD(bus_release_resource, vmbus_pcib_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_activate_resource, vmbus_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, vmbus_pcib_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_cpus, vmbus_pcib_get_cpus),