From nobody Fri Feb 16 01:56:36 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 4TbZmN42mWz51pcY; Fri, 16 Feb 2024 01:56:36 +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 4TbZmN3YRgz41fh; Fri, 16 Feb 2024 01:56:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708048596; 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=WrJe3BE2W4sKcPjGd37bGMQsocM58OCbFiuziaLH9FI=; b=Q60mlRoppix/PcqV4knvrbGlpLpGmhOaiRcJo9ovmAfhkJKcQmRzogOxSCDj5JdqXzf57S 3YNrMkN/plp4z9ReJJrA2YNg2rIH8yyFze8aItRmh8gGVpAwicqP6sjh4VPXjCT1GWfNJ/ fUzb5nX3AV2pXkFZjyosA5cP7ePsQC5CfAoHffpv457AWHqIJTQ1sU0q1rCov5GckxieTx MtMUb0ITJqkgV6udvQIPHFmHjNBAsLBVct9hr1yz2c/pnB/D0eB7Uk2vTEJDw0GMukfQ5U jBvSWBUjLGGA3YvAhDrd6OuA+wOv0WPLXbL3Ot+4+KB4eEjVFUPVtnDGeJalcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708048596; 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=WrJe3BE2W4sKcPjGd37bGMQsocM58OCbFiuziaLH9FI=; b=RtEseRfLSobIMkskRSEOuz5fop7AO1uzJZFRNLrNf3v5ShSJTudFoyVvlanMCmkLCQ4kGS 7HpxKsRcBc1yIbTNVwGtb3KwGnBpR/5lqmljRZ2JG8pGiJ+ezLoQBm47sHlF7JWefxY7tl q54pprbyViEjThA/1T8Qw2IDR9mjxhFkXcB+ka92bHq3EfWdvVzVWifD0qR8+RUtcPcNnr 69stTA5n5NxeflqtLZD3Wk3zqvuoHnebcvrYFsiV1uDbJlpy4tBhFHmnlZbkLmvNF6OhMH 4r0IW87U688QTzxrfPVK0OBl1Q6R+jyR/rFA0YeuaY1l7i3RyyZx0s1PamUHjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708048596; a=rsa-sha256; cv=none; b=G5cRNYo1kRP76alZOH8kkutToC7dGx33i1uG0qIGRruAMz1eDWWtBX79jKlPsB5Soj7lOd s49PpEShY0H3cS6i57yuW/dU6kmOqNMcl/fh1PPRrI0Di8wwNcOxve8FGSBpZkEthpnTkj h0PMvNEQYpY8cjC9IdbaMCuukm2bqFMhTRphO8m09pUyFiyN46n60GmrZJzxIPmMmQoBXG SGGdwZtHlfQ/Iu7CRzFtYuwHr7J5GcF5vaTsO9reMu0ZXnDf3GAW0w4t3B3QSXebNkIYFL 2sqA2rwL9xxFUe9KT5aLAESNJm6DhgWLDvcDZh/NXT+fu6EXQa+ynBq2iuBprw== 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 4TbZmN2dLZz15Zq; Fri, 16 Feb 2024 01:56:36 +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 41G1uahF006455; Fri, 16 Feb 2024 01:56:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41G1uanE006452; Fri, 16 Feb 2024 01:56:36 GMT (envelope-from git) Date: Fri, 16 Feb 2024 01:56:36 GMT Message-Id: <202402160156.41G1uanE006452@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: feefc3c71e33 - main - pci_host_generic: Properly handle bus_release_resource of IRQ 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: feefc3c71e33d8f97879c4889d5cf1ec82e98cd9 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=feefc3c71e33d8f97879c4889d5cf1ec82e98cd9 commit feefc3c71e33d8f97879c4889d5cf1ec82e98cd9 Author: John Baldwin AuthorDate: 2024-02-16 01:56:01 +0000 Commit: John Baldwin CommitDate: 2024-02-16 01:56:01 +0000 pci_host_generic: Properly handle bus_release_resource of IRQ resources Unlike other bus methods updated to use bus_generic_rman_* in commit d79b6b8ec267, the bus_release_resource method was using bus_generic_rman_release_resource for all types other than PCI_RES_BUS. Instead, bus_generic_rman_* should only be used for memory and I/O port resources for this driver. Tested by: cperciva Reviewed by: cperciva Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation Differential Revision: https://reviews.freebsd.org/D43925 --- sys/dev/pci/pci_host_generic.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index ca384d9a1483..386b8411d29a 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -431,16 +431,24 @@ int pci_host_generic_core_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct generic_pcie_core_softc *sc; sc = device_get_softc(dev); - +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) { + case PCI_RES_BUS: return (pci_domain_release_bus(sc->ecam, child, rid, res)); - } #endif - return (bus_generic_rman_release_resource(dev, child, type, rid, res)); + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_release_resource(dev, child, type, rid, + res)); + default: + return (bus_generic_release_resource(dev, child, type, rid, + res)); + } } static struct pcie_range *