The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=9c4effb1063d49748b4b7da4cc54f508ccad41fc

commit 9c4effb1063d49748b4b7da4cc54f508ccad41fc
Author:     John Baldwin <j...@freebsd.org>
AuthorDate: 2024-01-23 17:35:58 +0000
Commit:     John Baldwin <j...@freebsd.org>
CommitDate: 2024-01-23 17:35:58 +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
---
 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 ee7b82c10f23..f7c825d1bcf9 100644
--- a/sys/dev/hyperv/pcib/vmbus_pcib.c
+++ b/sys/dev/hyperv/pcib/vmbus_pcib.c
@@ -1711,6 +1711,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)
@@ -1727,6 +1739,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)
@@ -1970,9 +2006,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),

Reply via email to