From nobody Tue Jan 23 17:45:52 2024 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 4TKDyn4bLFz57mmJ; Tue, 23 Jan 2024 17:45:53 +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 4TKDyn0v9Tz476h; Tue, 23 Jan 2024 17:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706031953; 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=GxcwfBDTkC+POYvX0ZgzaiP0EFHhtTQ8bIsKTwD+3MY=; b=OBUM9N5zrOq3FQ7LopKIRBRs5e1P6P6RmDqBmTU9AIrcLD7+xGwT8fhk8iHy1jlWXBMkh9 mHCI3n52pU5HHVbix/RdR3gP7zJdqlq3EU/le2SqvETC6Zr8Kx8X+GHerwMA7Ez+SvT9Ii R3rS8U6sA7B3efhoFksPl9TvMkcLbqJaXVbMEoz9JQzkcL9FEWxIW0y4jUTJfBi7iKe+M5 L5tAssObkLMPDwQwBxQWteHmz9UC3NF2mbDf+Mv0WYVp0JUeibjL+5zzuGNOxqB+Bg1FRn nor1sFHKra7qfPApB4J8jgmJAjA/h8aF8AGAkgUV3D9dUMJKyaZINEr2VbNFVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706031953; 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=GxcwfBDTkC+POYvX0ZgzaiP0EFHhtTQ8bIsKTwD+3MY=; b=izn3e9lxFFsdkO4zDm47C/tEVZM7JamWI7GbTQ38rYMqGvV6YZhChD8rF6exe1nUIiuW1L BaqufqeNhx8F3QrCE7GlmR3HMYsjblar0ZMmK01pkyV42AsLiEhMafApVz4yWOhjFCAejX lAwrCTm1C9YH6uRzE5/qUhe+qt49Uz5K+DmCJ/hT1qtCRq2jqHj/SUgMqxnnV4p4ID2a9D LJgEZxHtjUKO+HlRv22BZ8w3dY6p0j09r3bPRtf9ljms6lmtrDkXLD758Clp6PXiJF1+I5 uzuhOALRGEJGQvbuHyzZHJ65p4ZpxJA+zGCO9R4OZ0wImDAyvQhMZhs8V/j/4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706031953; a=rsa-sha256; cv=none; b=k4duUKtRYANVcFmJxwaA6U5zK7h+SI7KnLY4qyqjqmSNfFUwH1g9bv79TisuOC9/NFaSWE hhOcfm5pJ+/pkKL017LpTzpOFXKLDdgJSaf+i39VYXGTs75nDOr7qI2VTGxCc185LMRPKT G/qjSJxsIN0SSucstK7bWLQcj720/HkCtISq4pKa3+/Yios+idTGyU6Bq3fkxnjzjum0ws TJ2yPuKA0fbJPrz4bGyDcOEw1s3vY/+mXHDhTJBFSVdnJDTT3t0vuhx+bsYNNBDdZBsrgA Yen2EK4XCeLJdjANBlm0VGrZxoDhAjGXxOygEqMgtoSeG+Afvov0M+JslhmwVw== 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 4TKDyn00n9zgcM; Tue, 23 Jan 2024 17:45:53 +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 40NHjqTn075706; Tue, 23 Jan 2024 17:45:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40NHjqpu075703; Tue, 23 Jan 2024 17:45:52 GMT (envelope-from git) Date: Tue, 23 Jan 2024 17:45:52 GMT Message-Id: <202401231745.40NHjqpu075703@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: 9c4effb1063d - main - hyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 9c4effb1063d49748b4b7da4cc54f508ccad41fc Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9c4effb1063d49748b4b7da4cc54f508ccad41fc commit 9c4effb1063d49748b4b7da4cc54f508ccad41fc Author: John Baldwin AuthorDate: 2024-01-23 17:35:58 +0000 Commit: John Baldwin 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),