From nobody Thu Feb 27 14:17:01 2025 X-Original-To: dev-commits-src-all@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 4Z3YLj5M0tz5qGFm; Thu, 27 Feb 2025 14:17:01 +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 4Z3YLj4tjlz3xPL; Thu, 27 Feb 2025 14:17:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665821; 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=7g0eAH2548jDaa2CnNzwPUVSi7GnuvZEk0yT2gUlol4=; b=joPVJnoR8xh0L/0/XQTksAlSEAkOOPgmRjsV+eMoty2Nm2JCpjwLUTxDzE69M+RJHiu3TZ aGJi/FiUtx3AT+/tmFB7GJ6LCl4YoO+SPSVoxBAxhBe/e8w0IlMWZvdxkVZbQDN/2XFn9u P/iHvYW16e5X+7jg9gWMj8HWd9t7RJCZXPIdz0aAJ/L31HONTd0lfnMdm9smf7wixa+Rsx cdPuBMkMExDlsjjiyS35Y5xfGJfLtjREflu5oWUb+4UpnJdQPvVfMCh0tbmAW361gF/R9b aRzh7RQw2GHR1e1+OxZ8KQ4a/LLQubZdPzqDBW4q9nnWCWEx2kZDKHpaWmdaxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665821; a=rsa-sha256; cv=none; b=DM9nwZS7oxW8C+o2OCTrLdw0Eg+lmwtx7UqlWQJuxeS+eUnyct1oSro47/LQv8v76CBDRq QpC7CLerGE9/509NOdSmtXYcU3rGVoNZpDR3QG635ZQlWM6dbE5v4i/egno4Abe7BEVcMF oaarxb5IICDJAxXxLj5LDSYJ8M65fj+B5uvY21ao+BJlr/+qe4jBntS5PKQILFOodQjLzx qE4w3HMmGs65BmNnFelt4FykRIFMq5xmkZ3W7SB09gPQ4pOGJ2ZFdIfnAZEV0hdvfjH2OR NykP6yUZiSJyn5WjM5J457EbZYATMhFrPkBI7uCZKCLCeM7cTUt7wB+2QyHjpg== 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=1740665821; 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=7g0eAH2548jDaa2CnNzwPUVSi7GnuvZEk0yT2gUlol4=; b=kssuN90tcIJI++Y050klfo5vyfi34YLMnJ44RuFKe2/n34Z7zpqm2Ho9EYiqLyUQpEghYZ l74PhXgw+cIwc0BSPXZujoTif57SN0BItXLyapicWRNVMLWIZtM14p+AdWhFrkg0x9lCaA bbvdvlkaHzQI0kOsjeVQtYuuci2N752igtOSl4yttFiA2YZTPpgjZQUCkTCsRf3IRDFOMN QtXHicsbnK0MwHTUV5iHlk3fEBkTLh2KQRezyBA+c6gjQEoQLG3Ei1Zd2zm6VerDwrGuna fwxAU1BlA+0s8E2lt54Nd9Wp8uVkaX2J2pLLFTysxwa3+PlbvHXPL6SOVA5MgQ== 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 4Z3YLj4VP9zmZT; Thu, 27 Feb 2025 14:17:01 +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 51REH1Ti016607; Thu, 27 Feb 2025 14:17:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH15g016604; Thu, 27 Feb 2025 14:17:01 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:01 GMT Message-Id: <202502271417.51REH15g016604@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: 2afea415b919 - stable/14 - pci_host_generic: Properly handle bus_release_resource of IRQ resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 2afea415b91992f401b795dc6cbdd9539367d344 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2afea415b91992f401b795dc6cbdd9539367d344 commit 2afea415b91992f401b795dc6cbdd9539367d344 Author: John Baldwin AuthorDate: 2024-02-16 01:56:01 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +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 (cherry picked from commit feefc3c71e33d8f97879c4889d5cf1ec82e98cd9) --- 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 *