From nobody Fri Jul 14 17:32:20 2023 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 4R2dpD5357z2tpdY; Fri, 14 Jul 2023 17:32:20 +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 4R2dpD4GKyz43kb; Fri, 14 Jul 2023 17:32:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689355940; 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=qSZFj+r7GdahLvMIXUY+I0aEC+ooTgD1+0Ix1IKyZjE=; b=BnL5m3/kBTACacatbCXuXH7iJuZRTQQpdgYuxdnUb9Oh3Vh3YE+7XhbgSfPiN3H9UEgTCJ l6RGKLLgKfxjGA5YWm2R4mjst9ACB4Lk0pm8gcZC1tf8lrsecAkXM7cXq7CL/wahVNGkAD i2EoFnVcl/1Y92mZ37G6LvjApOj4eWUeJ+jiZIBag/vMGodzZPBbXTB/DjwmUC0rSBK72p 912y+cR47ha6W99ogv6OLnwkSfpxdDUpagLp5eT6fZuyqsgbJCWwiOGcqL2WRpUC4NhE1j VjI2vdKAQtYWwr8LPIpgGSSb98alyU37YAg4QuLyOdnmZB1yCafM7NZbOihlrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689355940; 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=qSZFj+r7GdahLvMIXUY+I0aEC+ooTgD1+0Ix1IKyZjE=; b=fi3BIKUEBXy0nc2xMKqD7iphbegxqCkt0RUyrnwojL0Vw6Tpb+qi5Jq00lwXGQB9X+26kD UIIyCheKIzXzlOnuxFneMpzQvHU2QcEcqNDfg5z3WlbAWE9UGcVrKuW390k9PrbnzEfkjI GbDgyfUJXusCGKgcNzt+dI5THcf8IqKDmfahqYPmhV6+qyO6S5eRklwKQLzvuoV+dUe0K8 CHizgKRgEOzlv0nLAADslaOxs4Jdarz+pkDtKYPsMkoYfS7fxkf1Y9gxkRKQLJZupQPD/t yFmTqFVvupyjfiNlslfDHM6qXgXkHjcv0oXYV3M5jz5HVFTPHgSSNI6vflNwiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689355940; a=rsa-sha256; cv=none; b=hyP1Lj8N5vNaYg/W1Aj864FqvB8wvyzvgM9gTI/hBhB1jUrVnE7PYQTavh8HlyVV2HBbY0 7r3EC58nxkHT1I4wuLs3cvuXcgoEAW26ceY0rXKKRtOqqZvZ/UeXN2Wl02+XPBc/pZDxvn due2c+agnw4YCVrM2TaetwmLRKa8IHGShfaU1wYbMXDJQ+EO+ZxX3PmONb2rXy5Ae2I+ny jVFhhjSIub+M7ABVi1ZbpMLSrabVuYu2k7oJwpw2gJ1+/eQROgfRBDMx7Tcc9e9Z+gzha4 qKgnNonmjh9Gu2pDOLdFX6qcBuaHvB/HK7+qMYacyHkdaBtbjWknSheDhWgTjw== 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 4R2dpD3KwFzRZ8; Fri, 14 Jul 2023 17:32:20 +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 36EHWKQM008917; Fri, 14 Jul 2023 17:32:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36EHWK0Y008916; Fri, 14 Jul 2023 17:32:20 GMT (envelope-from git) Date: Fri, 14 Jul 2023 17:32:20 GMT Message-Id: <202307141732.36EHWK0Y008916@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: 6582301f83c6 - main - PCI DEN0115: Reliably check for a memory resource during probe. 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 6582301f83c6ccaede7352fc6e6d3e7b46161713 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6582301f83c6ccaede7352fc6e6d3e7b46161713 commit 6582301f83c6ccaede7352fc6e6d3e7b46161713 Author: John Baldwin AuthorDate: 2023-07-14 17:27:40 +0000 Commit: John Baldwin CommitDate: 2023-07-14 17:27:40 +0000 PCI DEN0115: Reliably check for a memory resource during probe. rid was stack garbage, so the bus_alloc_resource_any() call could fail and fall through to the SMCCC version check even if a bridge had a memory resource. Debugging help: jrtc27 Reviewed by: jrtc27 Fixes: c9a05c072270 Add a PCI driver that follows the Arm DEN0115 spec Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D41025 --- sys/dev/pci/pci_host_generic_den0115.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci_host_generic_den0115.c b/sys/dev/pci/pci_host_generic_den0115.c index d620a755a1ca..cfef34824965 100644 --- a/sys/dev/pci/pci_host_generic_den0115.c +++ b/sys/dev/pci/pci_host_generic_den0115.c @@ -71,10 +71,11 @@ pci_host_acpi_smccc_probe(device_t dev) return (ENXIO); /* - * Check we have memory resources. We may have a non-memory + * Check if we have memory resources. We may have a non-memory * mapped device, e.g. using the Arm PCI Configuration Space * Access Firmware Interface (DEN0115). */ + rid = 0; res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0); if (res != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, rid, res);