From nobody Fri Apr 24 17:56:00 2026 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 4g2LH539H1z6ZxNb for ; Fri, 24 Apr 2026 17:56:01 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g2LH42g26z3pgr for ; Fri, 24 Apr 2026 17:56:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777053360; 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=okw/hjZSC5Rse77wgy0cZgjoFeAPFAYGxQUzN2MHnZ8=; b=mTcGtaxFLn0NqawI7deVgWSrMOAKuCoDqBahcUq0R+0g7uHK7x5czExkcF/++cMmMQ+e0L iYtl6EXJpA+DC9xMQzWF1UdJa/oM7U2hYUr7WRptpNoOnBumpKh9OmKsfJITxBldY6KSuU 2n6pjEXw9nnhwpT7erKKSNYos8+YVY4zcP4jQt4WdUtrMdLSB9f/M008kwuXGGYbsvORQR dXV4kPABsYw1vEaYX5e6wLk1EfPErYd/uXnB6oO2W3UPSrtiqhUubtP/yDYP6YCuZK6bPZ RavB42NJMsBMOcIKJhvKl/Lf4RIgmmdD3gusxYDTpDUAMg8h5M5Li2CXWULtrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777053360; a=rsa-sha256; cv=none; b=lEN+1vuKEgkiI3BudIc4ZhooRzGhNIGU453kA8DBMVre8eqf5YeetzCb8TgvjY0YmT3l67 rhA/8jO9/N9FklI8hXZDr13kKkjISSozQq95BMF6ZsBaJH5YnWGVoy7qCHBz4y/91V/pCz pJDKeChgUgHfLUiEd1IO8MKlKHU1NmOTdLJQeX1MvJFLuzXlbxad3mWeNeuifB+8tC3E7n Qj0VIGD1YB/+wehPAxs5zniiH0A60fjv3pfrgVnKN7JrVi+nZ+TQunDNYpiTH8IVt1edvv qim7WZYJjaET9JFPir+I5S0tNU8WXOTIJZc+b/dM0kxI8ugu/F8LMe1JBqfTAA== 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=1777053360; 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=okw/hjZSC5Rse77wgy0cZgjoFeAPFAYGxQUzN2MHnZ8=; b=NwpjsIgBsrp1YU44rMF2Fmf2lgS+/DvBRlT9ZUB75lqcSSfZXttqLUP1HwTjiIUWseQpTv hC1QbLTt5pTcJ1UYzPYoNu975KEUKQ/WpTDuXRFaybFoiSZE8X/yCDStjb6MK62YsLM8ml pL4DeTPaKMPNlFxgz7vmcZfn4Z00XxMGQgUIbUTF6ie/kU9JGX/0l3tj7nRvXO1kv2goEu /w6CUDEsllU0ARbA2P3mdqu+PF1iFVUNFF/C2lq8KYJqVHfmEzZakxnSl7OrUC39PeUMeS hSmxVt7e+uwu9fw35FxpbnKgnASzflPGEY2o09aQCF3xh+1QKa1/YqOSMHn+3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g2LH427Rxz1CQC for ; Fri, 24 Apr 2026 17:56:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c468 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 24 Apr 2026 17:56:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4f20ccd7500b - stable/15 - pcib: Assume a window where both the base and limit are 0 is uninitialized 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/15 X-Git-Reftype: branch X-Git-Commit: 4f20ccd7500b995259d82bae1cd8779c03216ade Auto-Submitted: auto-generated Date: Fri, 24 Apr 2026 17:56:00 +0000 Message-Id: <69ebaeb0.1c468.3bc1feaf@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4f20ccd7500b995259d82bae1cd8779c03216ade commit 4f20ccd7500b995259d82bae1cd8779c03216ade Author: John Baldwin AuthorDate: 2026-02-18 16:04:54 +0000 Commit: John Baldwin CommitDate: 2026-04-24 15:39:43 +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 (cherry picked from commit 349808d8bd197165390a286bccdaa29a1d77c7ab) --- 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 40ed5db4480e..3b4b15b25fa7 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);