From nobody Tue Jan 23 17:45:51 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 4TKDym2Pdvz57mFq; Tue, 23 Jan 2024 17:45:52 +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 4TKDyl6wVwz479M; Tue, 23 Jan 2024 17:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706031952; 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=KmZSuwjZ22iBLoXXPNI6CE3wi2rfGV+djHnBTr7ULXA=; b=KnoXHjZO2jNlRWoP6jnmIym+QnJaax8FckCGXOHn5zhr6TaA+SmYuegwF0mHQnUrqhWO4l jtiLZs+k9Bj6HR4PQ7xxKuQ9+05NhiLXQVVpYJoewIJPvL9/zUpXz8wl5h6JkvpgzKliLf LJleQOvaqguEYpcKCWgbX7lAkjYVjb3h6yZV45Q7shnVnnHaZGHjixzuJwtlmmvafaPzO2 w7VhAbD3hSNMzCGWT/h8MH63w5mB5lP8x8yFB792vLi+CwgBHplb9GDCU/9zbBdf8N/7d+ TuTPdAzRQ2933SZ94x3B7PtqXuJcZnzXFUM4IkUe/Rx693mgxlXx25AhdycAUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706031952; 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=KmZSuwjZ22iBLoXXPNI6CE3wi2rfGV+djHnBTr7ULXA=; b=h64Xq/3l4pqlr3S/SU3Ui7OOmtiftDkqTKgeQr+Qk4Suwmhbf/PAfH4fjP6/NH1Uv8nriQ 23jrs+Uz2ObamzZuGc6UGVTXOvu11aOGAZ2D300vUUkBQ/23S8Rvmi0FYWJHKWWBoqPlPL iAWdwIp52d2jR9A4xsdIGH9nEZ1ewj+EwnLSK6Vcu+Hv3M41isr7pESanEsloYJHEtSm2W EI4AKaJHtSrctKL/8TlsWfqoXhcqOcxvEAuNGG+QQ7yqy4NhNDPhVQ5Y9wQ39OKjspK+Rd b7zK6LI3b/rVU2SJ12f1EmPPtl47fmefN346L5YJer0OoS3mgPYJtwbhuCKLHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706031952; a=rsa-sha256; cv=none; b=atBnzPEEb4Nesz6g5+Mv46pYWuT9DnzCLL0IsyCfBE/m0AkZ+KN3wQTo+6E7p9GpiLK0vx bq0lgkuOOMabXXjQ60+PrrmW7ll46FmCaieRkHY16x4D76r8RBp8VCrL17oRtY1tsS6dCD 70Uxqryuk8bLWjOXpgGfUU7MGedfahv0QgYXQHRPyuz96RIzoeMxt+Fck3Ak4Qctvfinra frjsDbL3Vf55/an16iVUydkllp/IO8u6kwMzjxtzEcsv7XIHjqxyqnDRRNigE6dARsJxSf XvHWXM2d7kPxgLidVubTz8yjtbfCfVHdV6ixAXnpBYd4YJzoCfUgrDyXlMUBHQ== 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 4TKDyl61tczfpP; Tue, 23 Jan 2024 17:45:51 +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 40NHjpP7075658; Tue, 23 Jan 2024 17:45:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40NHjpf5075655; Tue, 23 Jan 2024 17:45:51 GMT (envelope-from git) Date: Tue, 23 Jan 2024 17:45:51 GMT Message-Id: <202401231745.40NHjpf5075655@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: 31e15e531c51 - main - x86: Use pci_domain_[de]activate_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: 31e15e531c51be35c6907bbb6b1a5ab125f08a0d Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=31e15e531c51be35c6907bbb6b1a5ab125f08a0d commit 31e15e531c51be35c6907bbb6b1a5ab125f08a0d Author: John Baldwin AuthorDate: 2024-01-23 17:35:47 +0000 Commit: John Baldwin CommitDate: 2024-01-23 17:35:47 +0000 x86: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43430 --- sys/x86/include/legacyvar.h | 4 ++++ sys/x86/pci/pci_bus.c | 22 +++++++++++++++++++++- sys/x86/pci/qpi.c | 4 +++- sys/x86/x86/mptable_pci.c | 4 +++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/sys/x86/include/legacyvar.h b/sys/x86/include/legacyvar.h index 2c9cf1391934..5627e9b90306 100644 --- a/sys/x86/include/legacyvar.h +++ b/sys/x86/include/legacyvar.h @@ -62,6 +62,10 @@ int legacy_pcib_adjust_resource(device_t dev, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end); int legacy_pcib_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); +int legacy_pcib_activate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r); +int legacy_pcib_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r); int legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); int legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq); diff --git a/sys/x86/pci/pci_bus.c b/sys/x86/pci/pci_bus.c index d06cfca53673..cfe0a3974187 100644 --- a/sys/x86/pci/pci_bus.c +++ b/sys/x86/pci/pci_bus.c @@ -625,6 +625,24 @@ legacy_pcib_release_resource(device_t dev, device_t child, int type, int rid, return (pci_domain_release_bus(0, child, rid, r)); return (bus_generic_release_resource(dev, child, type, rid, r)); } + +int +legacy_pcib_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type == PCI_RES_BUS) + return (pci_domain_activate_bus(0, child, rid, r)); + return (bus_generic_activate_resource(dev, child, type, rid, r)); +} + +int +legacy_pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type == PCI_RES_BUS) + return (pci_domain_deactivate_bus(0, child, rid, r)); + return (bus_generic_deactivate_resource(dev, child, type, rid, r)); +} #endif static device_method_t legacy_pcib_methods[] = { @@ -643,12 +661,14 @@ static device_method_t legacy_pcib_methods[] = { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) DEVMETHOD(bus_adjust_resource, legacy_pcib_adjust_resource), DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), + DEVMETHOD(bus_activate_resource, legacy_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, legacy_pcib_deactivate_resource), #else DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), diff --git a/sys/x86/pci/qpi.c b/sys/x86/pci/qpi.c index 9b31d7693798..38eed7f67f80 100644 --- a/sys/x86/pci/qpi.c +++ b/sys/x86/pci/qpi.c @@ -284,12 +284,14 @@ static device_method_t qpi_pcib_methods[] = { DEVMETHOD(bus_alloc_resource, qpi_pcib_alloc_resource), DEVMETHOD(bus_adjust_resource, legacy_pcib_adjust_resource), DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), + DEVMETHOD(bus_activate_resource, legacy_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, legacy_pcib_deactivate_resource), #else DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), diff --git a/sys/x86/x86/mptable_pci.c b/sys/x86/x86/mptable_pci.c index 38a16673551f..5792b0cb7387 100644 --- a/sys/x86/x86/mptable_pci.c +++ b/sys/x86/x86/mptable_pci.c @@ -174,11 +174,13 @@ static device_method_t mptable_hostb_methods[] = { #endif #if defined(NEW_PCIB) && defined(PCI_RES_BUS) DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), + DEVMETHOD(bus_activate_resource, legacy_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, legacy_pcib_deactivate_resource), #else DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),