From nobody Sun Nov 03 16:02:27 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 4XhK9x2fJ9z5cN17; Sun, 03 Nov 2024 16:02:29 +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 4XhK9w0nf1z4NBH; Sun, 3 Nov 2024 16:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649748; 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=T5dYrnAKAPcR4T58lyJH8FYt7BdTzttamrL00LmfDyk=; b=xYi8ZcuG2wQinfvW89pz8qyBTbo0TGchzNA5lRYEpenMU0inB6CuML4SFvWNlz30dAMqCZ pW8dEn3eSVnAzuPBknzwRGqvhXerQbyq2jypoiKCZSAvVBXIkUuV/z1/0Jp9iU8McB7qe2 YJ/wrUideN/5xruJ5vZ5VXgiYwJJYDK+yJ7qwMQaND5ICTpokCHtOjPV6ct/Zlx7QvpkQ0 C+dtGdcEtba4/MSCzQaaOBe91pLeRyyHgOkJCCFUdsqdTN65I2E53pnDyMUjUWNz6vEOLC jE/4Csot1+XEQPUV5uQs0mIuVIYhW3R04sekx6TN+EY7YunVDbDaU8/brJIAww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649748; 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=T5dYrnAKAPcR4T58lyJH8FYt7BdTzttamrL00LmfDyk=; b=yLSGJP0urG/uHhtLAkcLtOeuz6rMnnL7/y/G9Px2ka5cLKB8eaApvC3HLxmJbhXxPvPkqA ULg+wMWE06VgyKatVkO9SJgs9y2lEIvRlKUmUUVI9AuxKKOMYR8Jyc9gHZa73EAs0SBY0k J0hEiLuGpE1Kjno2ns1sdT7/EFy5wpgv2eeSG0+JIhLpZ+qdJGkkt8MLm04sVKIKWq658T SS1qe8G0jVRhUAg+FwITPYYp5aRUbNXvw0MOXJ6Oah4ighymDltMLcQaPa/+AndasQ5SYt 9MYlDZijE1V4oRdKyKNWrYbx1Jgpt+5sPJeLdjqoNPTiP5Oie7M0pJvsqzW0FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649748; a=rsa-sha256; cv=none; b=BqqPq+40uScs13/94TQr43xl7/VKcdUjoRcdymXd0N6fCsxkkDDaBlddHY7GulFl9Dfcf+ UR2BPue4iPwGEUt3OLgUuLrV6BK3+ieC6gXh946EKQNzuV/YfQhtqbkZGzKRk6Jolg9DYy ROkrlirZgpzgR01qQL1rBvwofwr/+cJbf14hJ6oIacQH4EUwbOlXkFJpRP1okeH5fjyMvy RQjiE6twuSK4wBJGWPyuZ3gRXGD4Rxad8BqMPvEb/l23V0D5In1FEJjBXQVAsFC6PIWlGf y5AHqmveZILaJF17nQd822Iq2PSf1vJFaVJOmDeXdqV5G6QKei1s0Nhc7UuBJA== 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 4XhK9v6dSLzwCv; Sun, 3 Nov 2024 16:02:27 +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 4A3G2Rtv016734; Sun, 3 Nov 2024 16:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2RAT016731; Sun, 3 Nov 2024 16:02:27 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:27 GMT Message-Id: <202411031602.4A3G2RAT016731@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: c54bdf84d5fb - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: c54bdf84d5fb0b2c1923179fd30812ee68aaf423 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c54bdf84d5fb0b2c1923179fd30812ee68aaf423 commit c54bdf84d5fb0b2c1923179fd30812ee68aaf423 Author: Andrew Turner AuthorDate: 2024-10-29 10:19:45 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:28 +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 Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47282 (cherry picked from commit c85855a72db9f9d7b4326b676241e1dffabf0fae) --- 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); }