From nobody Fri Feb 16 00:05:21 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 4TbXJ22MNqz513Dr; Fri, 16 Feb 2024 00:05:22 +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 4TbXJ21S1gz4pMP; Fri, 16 Feb 2024 00:05:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708041922; 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=8iUH40Mkc5viit4oCsSJ2VPRBikhqS2Ji5sociC5QiE=; b=dE463NmmrE4ifiD8k384aqiQ7s63imwRVztB6I3U/UJOdWAJ7uq2JW2oDgbycrtWIRbP+Y NMVPjm5yUfw2yUqOT6Syd0j8TBqgViXuwasGlWiExJAbfZ09HQN3/p/USX2uB0cw1GpWYx lMIwgu9JiI0KLGvW4XjS1Ea59xy/nzkcYnwwr40Po5Vf5E0u+88C3SRcflkgmWVJAwbOmp JAzzS3LcCrE9TN8cEFM27WBqK7CKp5UC3/g2vy/GqY9Utf64V3n8V/ThFrx8GbpH34eBjY iBuU8JE8p2d48Y14b6LGPYJKv5vrCbAN79dD71iM3ejsJKxf9BaVdRpr4BVlUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708041922; 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=8iUH40Mkc5viit4oCsSJ2VPRBikhqS2Ji5sociC5QiE=; b=UrhUmuBrwh0/wW2emQ66vbqJSyAR/cN6f1bKIIs3U6zjhp4CkRLsYmOlIYrBxmupfhidsH qvZd5U2Rm2ZWMST9NlwiMRI2c1yvkk/kWkUvPTFEgPav7mA8JZ/Q/mRG4WkmqEtzw17ctj 3OlV6nHemwoBubo7G78wAYOfAGsCGjXNOqmY6/iDSrAF4jbroM/1BVtxF2C9qdj8ud0cat juR3OIP5jZM/fLRJRA/7sdY5Jqzu5gPErhuwzLGoGda3huP4RKAHoWq8AudocaFDziu+64 b60MR990tUVjU+f7cPffDHWZqvQQ8mJ3tbcoHt4ysxkhVPddgC+pvu7lEWjCTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708041922; a=rsa-sha256; cv=none; b=yj07h6Fj7nr6gqeeSn4to7j4q7u2oNeZ+KZGwjowjl1CUpr0ipBjNbY4eJyNtLL1GMoloo EJoGa3saNFO9cCtL9vESFCVW/j9DhZCPyxoGq38B9VrOIaqdK2dvRs+eyB7Y50tZ3rheFN XDWoKt0/74knUsvwo/9sD8zkxbU4eOmYs/+79Czh0XaHdcVvbRQnEiCs6vqZRebK8KvQ1h qz0S4IHscrtRWF61pj1B3ck9IDoRUENCZUlpdtTLyVkQhOtVVKiUpYiOrhszab4jHUlUcw BQEGHyAlRF3TiN0+aau+cfMEItLe7GRgNEj7PVFy6MHJVRBekfdcBIqKJI5hpw== 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 4TbXJ20Pwpz12tj; Fri, 16 Feb 2024 00:05:22 +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 41G05L12023000; Fri, 16 Feb 2024 00:05:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41G05LHJ022997; Fri, 16 Feb 2024 00:05:21 GMT (envelope-from git) Date: Fri, 16 Feb 2024 00:05:21 GMT Message-Id: <202402160005.41G05LHJ022997@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: 4505c8924202 - main - simplebus: Map SYS_RES_IOPORT to SYS_RES_MEMORY later in alloc_resource 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: 4505c89242025f840023cdf092fdab845586f42d Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4505c89242025f840023cdf092fdab845586f42d commit 4505c89242025f840023cdf092fdab845586f42d Author: John Baldwin AuthorDate: 2024-02-16 00:04:50 +0000 Commit: John Baldwin CommitDate: 2024-02-16 00:04:50 +0000 simplebus: Map SYS_RES_IOPORT to SYS_RES_MEMORY later in alloc_resource Specifically, the set/get_resource methods do not currently remap resource types, so remap the type in alloc_resource only after looking for a matching resource list entry. Fixes: 3cf553288b96 simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY --- sys/dev/fdt/simplebus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index bf6fceb48a9c..71ba8a0a1f7a 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -447,9 +447,6 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, sc = device_get_softc(bus); - if (type == SYS_RES_IOPORT) - type = SYS_RES_MEMORY; - /* * Request for the default allocation with a given rid: use resource * list stored in the local device info. @@ -470,6 +467,9 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, count = rle->count; } + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + if (type == SYS_RES_MEMORY) { /* Remap through ranges property */ for (j = 0; j < sc->nranges; j++) {