From nobody Tue Oct 29 10:34:44 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 4Xd6846Nw1z5bHcB; Tue, 29 Oct 2024 10:34:44 +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 4Xd6844S93z4sLG; Tue, 29 Oct 2024 10:34:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730198084; 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=vRXQBz/PbDoxW1JcC+oby9d81E+psQS5yJDGybgh+bs=; b=J3zmkHHcQcd4u4cKYLJekuyesR0iIXUFGoxN5l3uiJ22HnrumwMM0UvT+49IaHECGX5I9x wbPpDhVUe8ggewSGG/1sandTJvj9lv8xsi67LoolY24NYkxiJr2+NtrrWPkAMO4Lev63rg hvPrdajp/pbgVisRtWxFJZ9kKF2oPBDl+a4lSuFeAdAhIfEeKzDlfPch/8h01VhAsHVJWd RKqS2qs49dMvMH880z6hJvksdokDyveBSjIn6yXqb4BorZCG+2CVhBq9NmAe3+A72k/n+J W1E5jHqFNRNi23cCgWg9btX+s43RWCvklv2ACRkCOIyzCL8S2+vrfrc/LWgMWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730198084; 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=vRXQBz/PbDoxW1JcC+oby9d81E+psQS5yJDGybgh+bs=; b=S5E+6hB/r08VXLAdBjqX0WiZ+8ATAmpO8o6lYDSZnvinxbEBwirfYqSr4HjZPYJTyo7xIe /vv/PtPT1o5WnKRt4rrG8IMIN5clXK5pBh6yO+5EcvD/lQ4Kwdm6a/2POHoJPcm4RfaBUj 0oxTud53RFg1NcODQPjLzwiEFf2YokPEqTg6ufd9cOqcPLKzSp0U98j4G4c2AoARUNYL9X +k+FBJXtDQ+nX1fL4zxfsekfEVgdYPzsNdZdeN1J3thcR30IQCxjuKhQs/WFbn/7QeAaZr cRa0EGyMhPnD5L0KUmeQprWRVbCyWMRDAbsVFOZfLVHZ/mbtb/blDKA3SqHiFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730198084; a=rsa-sha256; cv=none; b=SM7+YCkuchse2BtKwxdvuDZAAe5QtR4USFF5sEjEHk8xBiEdI0BF64/N554mO8SDezgHM+ CjYTRsHT2lvrnD8T1GidPTCwF1I/KiEZOlURYdmNxI9P+4smbjy4LRWqDzKihx5K7L2XRu ExTGVFu/JnH2tlvN5mcXYekmJ7uEsA9MK2udwJQ0hXlRaSqX7pImOHRynnnWlEmb8caSrN vITfx494flVigSBAmmYd+7XLOeTBzpjhJriD6KfflseHsMB0tpK29+1wRWwNJofnarzeW4 b9O+fn2PCzAED9zOPzDN3rxl0aSI2BJrv/wPrIkBejyqm9rOIlfLMvtF12My5Q== 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 4Xd68443XwzKFr; Tue, 29 Oct 2024 10:34:44 +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 49TAYiPA001757; Tue, 29 Oct 2024 10:34:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TAYiEf001754; Tue, 29 Oct 2024 10:34:44 GMT (envelope-from git) Date: Tue, 29 Oct 2024 10:34:44 GMT Message-Id: <202410291034.49TAYiEf001754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 60344d7e09d5 - main - arm64: Use the common activate function in nexus 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 60344d7e09d51bb7d64a7997e0d9e03de2ca1e86 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=60344d7e09d51bb7d64a7997e0d9e03de2ca1e86 commit 60344d7e09d51bb7d64a7997e0d9e03de2ca1e86 Author: Andrew Turner AuthorDate: 2024-10-29 10:19:56 +0000 Commit: Andrew Turner CommitDate: 2024-10-29 10:31:37 +0000 arm64: Use the common activate function in nexus For non-memory and non-ioport spaces use the common bus_generic_rman_activate_resource function in the arm64 nexus. We can't currently use it for memory types as it doesn't support non-posted memory. Reviewed by: jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47283 --- sys/arm64/arm64/nexus.c | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 3e9399384855..d780c9950e63 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -106,7 +106,6 @@ static bus_print_child_t nexus_print_child; static bus_activate_resource_t nexus_activate_resource; static bus_alloc_resource_t nexus_alloc_resource; -static bus_deactivate_resource_t nexus_deactivate_resource; static bus_get_resource_list_t nexus_get_reslist; static bus_get_rman_t nexus_get_rman; static bus_map_resource_t nexus_map_resource; @@ -133,7 +132,7 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_adjust_resource, bus_generic_rman_adjust_resource), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_rman_deactivate_resource), DEVMETHOD(bus_delete_resource, bus_generic_rl_delete_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), @@ -331,15 +330,15 @@ nexus_activate_resource_flags(device_t bus, device_t child, struct resource *r, struct resource_map map; int err, use_np; - if ((err = rman_activate_resource(r)) != 0) - return (err); - /* * If this is a memory resource, map it into the kernel. */ switch (rman_get_type(r)) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: + if ((err = rman_activate_resource(r)) != 0) + return (err); + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { resource_init_map_request(&args); use_np = (flags & BUS_SPACE_MAP_NONPOSTED) != 0 || @@ -359,12 +358,8 @@ nexus_activate_resource_flags(device_t bus, device_t child, struct resource *r, rman_set_mapping(r, &map); } break; - case SYS_RES_IRQ: - err = intr_activate_irq(child, r); - if (err != 0) { - rman_deactivate_resource(r); - return (err); - } + default: + return (bus_generic_rman_activate_resource(bus, child, r)); } return (0); } @@ -383,26 +378,6 @@ nexus_get_reslist(device_t dev, device_t child) return (&ndev->nx_resources); } -static int -nexus_deactivate_resource(device_t bus, device_t child, struct resource *r) -{ - int error; - - switch (rman_get_type(r)) { - case SYS_RES_MEMORY: - case SYS_RES_IOPORT: - return (bus_generic_rman_deactivate_resource(bus, child, r)); - case SYS_RES_IRQ: - error = rman_deactivate_resource(r); - if (error) - return (error); - intr_deactivate_irq(child, r); - return (0); - default: - return (EINVAL); - } -} - static int nexus_map_resource(device_t bus, device_t child, struct resource *r, struct resource_map_request *argsp, struct resource_map *map)