From nobody Thu Feb 27 14:16:58 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 4Z3YLf392nz5qFrN; Thu, 27 Feb 2025 14:16:58 +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 4Z3YLf2cBtz3xMD; Thu, 27 Feb 2025 14:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665818; 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=YXUr+Ky+kqeJ7TxEFAwfjnixXTFHw6Km/rXZebiv+tg=; b=DUMk59ag0fua3rRUNhf/47QavqZxAgozqnXidbBscY1y3/SJF0aRcYL+SxWwhkmd62pVQa cDfOfsoCGwIZ+daIVDS+GeOYvalOc53zIC+T1iA1qj4nLfvXJzurg+MtvTg3FRqPyyNfqq qoU3ajW3oW4SKZbaIxedHdCZ2cdl4ZEFFa29Br6OPA3mo+eTKZqPSIi6ue2CuLK5RjASaN tt9y6UPj6XK1mmeQe8fG0TqjaUpXZJa9HRvZ2Ew9goIxe4/PbwT9yZjsLxkQXIxS7wmi7N uQvu0fJbgHm2dPuCjYA1Zl5LbCUPzJdlRvl+aDydrlB/dXSil3IDNEI4L9eYog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665818; a=rsa-sha256; cv=none; b=FklNnLtUeGbMWA0AEqyrhSN1Z0pw8ej23lRfgct2V68E1/DJsyKlrybwBoqCPtoxd2MYVt kiRw8bq9vf7I3/TSBd6Gcsk3uCpGcv5sFerKj7i3dhZAwvKnV3fH7fBzgzSXO6pTnfwdba 54+mFkDzPliVvp936mMt5/P9Q2A2RmbebTQxwWbu/6kaEczzgTsbBR78Yk5aQJoCictK5U Y7XViSWoBCV23t50Gbhp4wakqGDVCbteVbYE+UxMFopNkK3U3VerpE1UnFZ3EBBHU2zwqz 5UOdgTjkcaw71bJyOzYPWxBnuUKscWsg8c6Cpye5kmFPi2V14yMwK/s+wPX6kQ== 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=1740665818; 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=YXUr+Ky+kqeJ7TxEFAwfjnixXTFHw6Km/rXZebiv+tg=; b=H4a6HMPG73i7VxPiTpGcwpDiZ+Oorjw2v71ODLtpHsQPlNN/6ror29HV+iET0hrPxhCKPl L8JOi+cg38D6OJ5wMPa5btEPpaUUIoru46q9Vr1hTgpSyr+TIDWueg4GHy3Dd40YGQWIr8 7iS9aaac+jm3H6GLrsZTlOMa36reGh36lNrqG5ch2WcNnr7b5Fukml4+S1x7mQ0UJ4uY2+ +eLNZNHbveLOJPszd79t1vQSxDZ/ZGarOIbR6/9R/hGdQJGt7HAPjVkeNSWnDxqQnzmDi8 ohYXRlMrtPZP+MemasYHWzhvj485amJ8XK28b6VnukaGwU+sWS/RFbBgUu3E7Q== 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 4Z3YLf20Cdzmdw; Thu, 27 Feb 2025 14:16:58 +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 51REGwDL016492; Thu, 27 Feb 2025 14:16:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGwsO016489; Thu, 27 Feb 2025 14:16:58 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:58 GMT Message-Id: <202502271416.51REGwsO016489@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: 8765268c119f - stable/14 - 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: 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: 8765268c119f3fe4d0a4a9e65ce3be0efd283133 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8765268c119f3fe4d0a4a9e65ce3be0efd283133 commit 8765268c119f3fe4d0a4a9e65ce3be0efd283133 Author: John Baldwin AuthorDate: 2024-02-16 00:04:50 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +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 (cherry picked from commit 4505c89242025f840023cdf092fdab845586f42d) --- 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 273e77abd642..854494eb4899 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -448,9 +448,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. @@ -471,6 +468,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++) {