From nobody Sun Nov 03 16:16:55 2024 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 4XhKVc0KdCz5cNr5; Sun, 03 Nov 2024 16:16:56 +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 4XhKVb4Td4z4SB1; Sun, 3 Nov 2024 16:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650615; 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=RlTb+rtfxWBXPxLcyE5ff4zl+v3ph/HDteje6QqQtOk=; b=iv2CoObS2rO6mMjzlVjwKXtsN6JZLmZ/6VFjeIUFIfyEp940F/RBI70SN8B5KcL4rAGRy3 aRQ63E6x+A/axsBDQBRwsm75/w1M17gbnAG4u2OjuBbxIFq8/1DbqNhDv/8Ckv9sNvSLJ+ WeYUg+9l12SfpgYmKrhfkmpR63GMBIOnbiuCD68KHWtakT2xxbKcSO95ibs7T1fm8cEegi huPtH9Pkf1OAV+3ZWkUfLgFHD/0ZYX5gYc396zH/QxSLSyfl0F0fPvyriYHyJiz4ygPFVp bXaCOtml/ZONANacBI61QYqJIFkKCkYTjEUYUlcICTMjyOtaL+7krhty/74eJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650615; 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=RlTb+rtfxWBXPxLcyE5ff4zl+v3ph/HDteje6QqQtOk=; b=PjRoRQ0oXPM/p6FwGnYi2M+I8VTRm0FcJL9NL/ILr4eLXPv5Q6ZZ779QF8sWtl3bf+lVBO ReCNqzINSapnk0ODBDjk3kjnCXDU/BZsH9g0ATt+w/hXM++NfMbuykT/fAryofZ6iA6c91 +I0ko2gATqmCHBsUWnIYtF47J/RsX+DRMrjC2CggkRjXBxhHKX5/8SQPmwoOXdOxPgrbmn zGKSFr8jTFTZMf8BGoeBNQ7aeW59+bDPDFwhDZZGkRirTIMRNRonW/GmmB5G2yZT05H5fN tC5SEz1Fv23ITazleCGG3b9XG/su1fdw5qqsqSZE9JHKjApefSH0BwRfUUbNlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650615; a=rsa-sha256; cv=none; b=LpR8Qu8s7Jo8RTi9AYS7IebbMc9AQLp+ndxNaX54adyGliOFCpZ7nFJA6vjWnoijpuh+LR J/F9nCdozE9TFa7YWhpqnrfbRU4hXSLd4PBukAbO2E50yOr4DIOOnyJaqXdwE6lEO0pk7R yjbYpkhfdYU+s3yKUu9IyQ+r4TETyeOeDUTG4LK4eXryxlhj42blifLQ+J2iKGB0DJyBW6 yN1at4GPTxDSMg6FwLtp5ryEkWKAqRbUiXLyzx8WgYHEUO5mo1H22ytaRww0lHLi/51PFD sjuT2Em4Dplh+46JM7luI8ACy2j7hIKWTZ5BWG3LOPU0S9hvVpvxn9cXiYojKA== 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 4XhKVb41m0zvvS; Sun, 3 Nov 2024 16:16:55 +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 4A3GGte5036569; Sun, 3 Nov 2024 16:16:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGt0T036564; Sun, 3 Nov 2024 16:16:55 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:55 GMT Message-Id: <202411031616.4A3GGt0T036564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 4b4c7b192400 - releng/14.2 - bus: Activate INTRNG interrupts in common code 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: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 4b4c7b1924004e53f501612c7ad97b860644e583 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=4b4c7b1924004e53f501612c7ad97b860644e583 commit 4b4c7b1924004e53f501612c7ad97b860644e583 Author: Andrew Turner AuthorDate: 2024-10-29 10:19:45 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:34 +0000 bus: Activate INTRNG interrupts in common code [MFC note: This is not a direct cherry-pick due to API changes in HEAD which are not present in stable/14.] We need to call into INTRNG to activate all interrupts on platforms that use it. Currently, interrupts are only activated in the nexus drivers for INTRNG platforms, but this does not handle other bus devices such as gpiobus that manage their own IRQ space. Reported by: cperciva Reviewed by: cperciva, jhb Approved by: re (kib) Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47282 (cherry picked from commit c85855a72db9f9d7b4326b676241e1dffabf0fae) (cherry picked from commit c54bdf84d5fb0b2c1923179fd30812ee68aaf423) --- sys/kern/subr_bus.c | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index f0831b30142b..f55a7210e825 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -53,6 +53,9 @@ #include #include #include +#ifdef INTRNG +#include +#endif #include @@ -4382,17 +4385,26 @@ bus_generic_rman_activate_resource(device_t dev, device_t child, int type, if (error != 0) return (error); - if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && - (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { - error = BUS_MAP_RESOURCE(dev, child, type, r, NULL, &map); - if (error != 0) { - rman_deactivate_resource(r); - return (error); - } + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + error = BUS_MAP_RESOURCE(dev, child, type, r, NULL, &map); + if (error != 0) + break; - rman_set_mapping(r, &map); + rman_set_mapping(r, &map); + } + break; +#ifdef INTRNG + case SYS_RES_IRQ: + error = intr_activate_irq(child, r); + break; +#endif } - return (0); + if (error != 0) + rman_deactivate_resource(r); + return (error); } /** @@ -4421,10 +4433,19 @@ bus_generic_rman_deactivate_resource(device_t dev, device_t child, int type, if (error != 0) return (error); - if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && - (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { - rman_get_mapping(r, &map); - BUS_UNMAP_RESOURCE(dev, child, type, r, &map); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + rman_get_mapping(r, &map); + BUS_UNMAP_RESOURCE(dev, child, type, r, &map); + } + break; +#ifdef INTRNG + case SYS_RES_IRQ: + intr_deactivate_irq(child, r); + break; +#endif } return (0); }