From nobody Mon Oct 06 17:57:03 2025 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 4cgRmb5gtdz6BGqm; Mon, 06 Oct 2025 17:57:03 +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" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cgRmb4v68z40WW; Mon, 06 Oct 2025 17:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759773423; 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=cZ9R+CYWX65ZDF1QV3ousg5RjlFZpCRybdIecVQmTWE=; b=XUj3EwypMu3xH4lGEsJXpVO46H+rpQWklEfWR0zdoCmPmOQiBYyiebjlSxEGzSwfpmwUG4 9IcYPfb3c6HgUxpdusB8l4cv28o7MFlaPlWWDfc9H9+Yb4Kv6+meP/cNFSng8+iNilB6It G+FTKZ3ReAMibsM3FrN0SLHTiAU+h5xmE8tK278JTltJ6f9yKtxqeUV1fkxd7gmkCYtEv+ p5i4Rm0dkqfyOz50yR1u7ZjyfebTIsY6U/FQ19pJnYFj5J71qIkq/PmYDlVPvs5oJtuu1R edILLsEkWSRGNnmPqZVxBok3UhWuYIptc4FQHKscJHxzOPKeLw0K35O7aG5fdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759773423; 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=cZ9R+CYWX65ZDF1QV3ousg5RjlFZpCRybdIecVQmTWE=; b=sfNF9mNctw/KYT/6Tsr6YyaGNlECHfh2PDGjGzf9QeyGOiTeeTNMlfNKdG7FnVdsM3QJCa Qj2PXZxyMkCwUu2vI6+w5VRbCfuRXFh8bfq+ef0gqJ0FbZPXl9RukO/RNIIv6zvlKBMkxI lnhoTRVOyhUT5po1r6H16IrWOFxyF9DMKB0ms3s/NuiIqYgNMmyIhn9JuSv8hTyenm8wh9 OZCfVUEMN/IbddckSF9QoIXR89PXReuiUVMxhZZ5NBc8aHFyx6OpgfKnqG2CIy8wtv2Mzt aQpD/NuI8ML4n7hF9lzTAl4C2aemBV/wCHJZ0n8JAzyf3lL5kIKryoPLitoD5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759773423; a=rsa-sha256; cv=none; b=MMc5xl0Pp+kjmiNr+RkY4DHTT6FtltGsGn5c4UoGoEJyZKmDfqfE7U3CQMEF9aMwb5j0AF 1Q3eJj++SFkwZLJtN5cGITXIrGzsaylNOMVcVU/ujkKgZf6wEWCqWvtz/sjMHSlqFGXbtm GDyzfTxatCJuuSeeGBjpX6QlhI71G/65jsevkmoAbc5qHhXhjAIX2JAwZ+9lxRtVUEM25O IqdcaaOpJ9vwWBuohEIaGHTgmopvzamPvDsdCalDL7L6PrMOLg0i6mX5FCAQBpKs+4vnL/ thBGiEAZ9mKkD+uQU6nU7nwVYAN8yLhU3m7LXMiWzQXaMUA1eI1WV9f5Z6mTfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cgRmb4KP5z17y1; Mon, 06 Oct 2025 17:57:03 +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 596Hv35m029049; Mon, 6 Oct 2025 17:57:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 596Hv3Hj029046; Mon, 6 Oct 2025 17:57:03 GMT (envelope-from git) Date: Mon, 6 Oct 2025 17:57:03 GMT Message-Id: <202510061757.596Hv3Hj029046@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: b658158e9396 - main - ahci: Don't fail attach if the MSI-X BARs cannot be allocated 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: b658158e9396848d3963e9555d356d0f4ca6900a Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b658158e9396848d3963e9555d356d0f4ca6900a commit b658158e9396848d3963e9555d356d0f4ca6900a Author: John Baldwin AuthorDate: 2025-10-06 17:56:47 +0000 Commit: John Baldwin CommitDate: 2025-10-06 17:56:47 +0000 ahci: Don't fail attach if the MSI-X BARs cannot be allocated If the MSI-X table and/or PBA live in separate BAR(s) and those BAR(s) cannot be allocated, fall back to using MSI or INTx instead of failing attach. PR: 289748 Reported by: Vitalij Satanivskij Reviewed by: avg, imp Differential Revision: https://reviews.freebsd.org/D52889 --- sys/dev/ahci/ahci_pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/ahci/ahci_pci.c b/sys/dev/ahci/ahci_pci.c index 80547d178cd6..2b4cb37275a6 100644 --- a/sys/dev/ahci/ahci_pci.c +++ b/sys/dev/ahci/ahci_pci.c @@ -576,8 +576,8 @@ ahci_pci_attach(device_t dev) ctlr->r_msix_table = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &ctlr->r_msix_tab_rid, RF_ACTIVE); if (ctlr->r_msix_table == NULL) { - ahci_free_mem(dev); - return (ENXIO); + msix_count = 0; + goto no_msix; } } @@ -592,12 +592,12 @@ ahci_pci_attach(device_t dev) ctlr->r_msix_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &ctlr->r_msix_pba_rid, RF_ACTIVE); if (ctlr->r_msix_pba == NULL) { - ahci_free_mem(dev); - return (ENXIO); + msix_count = 0; } } } +no_msix: pci_enable_busmaster(dev); /* Reset controller */ if ((error = ahci_pci_ctlr_reset(dev)) != 0) {