From nobody Wed Feb 18 16:05:10 2026 X-Original-To: dev-commits-src-main@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 4fGLvB41VBz6SQFd for ; Wed, 18 Feb 2026 16:05:10 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fGLvB3XqCz3DX1 for ; Wed, 18 Feb 2026 16:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771430710; 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=WLBur0/0e14QZmllaaaEm8Am0sK3W2u4q/EGZJ/5IBs=; b=q4rotQs+9Nip8GnOtcfIfjxNoDeIy5AmyuRgxQNIN5d/H6rzJr0bJrHZb6+gM4evDVxEU2 C04G5d4/DOBda1awEpgFqopefCLPznupVpD5RAp6y7HTOSV2kEebaPjkQAJ8tpKprpuc5H SWYpwSb6CFEtA0UUm1VWWnbJM6CgViwsTVDu9tl1j/DodlkbfwiSn/mD+x3rJH3D7fWUnj R4WojE6oJ9h+cfRRHm0clvbjRLh/sK4/PLsV2J1aHs0dxiKb6N8JR8x0aCOGx1N6QRBYC5 2rhOr3wYhxRf07p8Jm5VxDdH1Req+Ncd1Eds8jGqZov7O2oGQi7eQpA7sXZCbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771430710; a=rsa-sha256; cv=none; b=ZHyMYJKJ3JsL1R60OeMMwNcoefvHqeNyeTTawdE6aqTg5QqSYwjb/KNB8JakPVgrDzkDDl QtBd02Z9l493z7RKHn5Y3x8YDJMEcxtcq1AliHM5j24G1iMMrYAuadcLd+NoEZalM6qL5z UDA31dZewdEdQnuiSF2aoSbJCIRLJsXvKyx0WvpKxvhqNbRwXxz4m5DnGdxHq2I5I0sTdE hIkJAqaCPtpO/TRr0KsS/pVDdNfXR72m8DCfg+++P5SxlAd/Fz1rmiE3S+XsfOhp8Q9lsq ppsXP1sPA4YlYwfoFC4ENH9k0gs+waPSP5Vtvl2Xb7g/skw3xXBUs84a4qmH6w== 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=1771430710; 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=WLBur0/0e14QZmllaaaEm8Am0sK3W2u4q/EGZJ/5IBs=; b=RnAvIaODiE9TfZV49e9FAcOad5mfu27hxrJNzYMOHZw4g3qzGL+bzF1gHjDxLeLbrrSIKN WkLTCbzPmFeHQ+ndwcE0tPi6o0i+88CUzBDQBqb8M3eX5uIuKq0zlci/4n4z5MiHxjrdOm AmdYrB97YPtyq98hcr584MHKYg8HexL+/W3L84s8dyN21iv7AW/L9+qKykbXKkx/fNDNE9 hfQcEGd6bwoxgWm2r5UsK3I9udpkE/mbSoJl3s9fQG+gitCVyUowJy903UR2cZLA6cjhDz JbGdQJ4OL1vtz+RKfVkRInOEpOIABslU/TquUToXJT/jhwUOixxLiTKERoFNvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fGLvB2lhfz12dx for ; Wed, 18 Feb 2026 16:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31e5c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 18 Feb 2026 16:05:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 349808d8bd19 - main - pcib: Assume a window where both the base and limit are 0 is uninitialized List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 349808d8bd197165390a286bccdaa29a1d77c7ab Auto-Submitted: auto-generated Date: Wed, 18 Feb 2026 16:05:10 +0000 Message-Id: <6995e336.31e5c.551f1ab6@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=349808d8bd197165390a286bccdaa29a1d77c7ab commit 349808d8bd197165390a286bccdaa29a1d77c7ab Author: John Baldwin AuthorDate: 2026-02-18 16:04:54 +0000 Commit: John Baldwin CommitDate: 2026-02-18 16:04:54 +0000 pcib: Assume a window where both the base and limit are 0 is uninitialized Since the low bits of a window's limit are hardwired to 1, this configuration looks like a minimally sized window at address 0. However, PCI resources are not generally at address 0 (see the __PCI_BAR_ZERO_VALID macro that was only defined on sparc64), and some PCI-PCI bridges report these register values after a reset. The result today is a lot of spam in dmesg as the minimally-sized windows fail to allocate. By ignoring these windows and treating them as closed the end result is the same, but there is less spam during boot. Reported by: jrtc27 Differential Revision: https://reviews.freebsd.org/D43922 --- sys/dev/pci/pci_pci.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 788af7339418..5cdb1de71c3f 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -437,6 +437,24 @@ pcib_alloc_window(struct pcib_softc *sc, struct pcib_window *w, int type, if (!pcib_is_window_open(w)) return; + /* + * Assume that a window where both the base and limit read as + * zero is not really open, or at least not assigned a valid + * range by the firmware. This can happen if a bridge device + * is never initialized by firmware, or if a platform driver + * resets the bridge. + * + * If devices behind this bridge have firmware-assigned + * resources in this range then the window will be reallocated + * on-demand. + */ + if (w->base == 0 && w->limit == ((pci_addr_t)1 << w->step) - 1) { + w->base = max_address; + w->limit = 0; + pcib_write_windows(sc, w->mask); + return; + } + if (w->base > max_address || w->limit > max_address) { device_printf(sc->dev, "initial %s window has too many bits, ignoring\n", w->name);