Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2562354lqp; Mon, 25 Mar 2024 02:41:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUa6YppBADSEjg2sHpD41BCo2DCqnKb7P8ScVrvoHhkWPxUdeDfGzk8EF3ojO0Sm7S/GtwVxZH3qOcGUblALVpHXg0sWCHqFMQqL8yoXw== X-Google-Smtp-Source: AGHT+IGqlo6O4TSOQR32KYEUilHjzIptGgnS7TfpOYr8mpeS5opYRKo3hMzZvlTekqynW+rf9z2k X-Received: by 2002:a17:906:28cc:b0:a46:ed72:6bba with SMTP id p12-20020a17090628cc00b00a46ed726bbamr4453425ejd.18.1711359663299; Mon, 25 Mar 2024 02:41:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711359663; cv=pass; d=google.com; s=arc-20160816; b=Icqp5U1T0kemLqyKZ/FVBWdKwnlndZfTJbRhXN7/46q4iY4JBeFkzpvCrh+IcXRENU x7wIR1ZSk06TVNbjuw2uhcpq8O/MNlai7d42DN+caZ5buOcSNhM1GodPaxqNCDDj1zVN JxWZYM4+01gNXARrDyNuaPJZeyxV78i2TVlUFBR/1OHT8taaqUR56+vXW8/R2vwXmFp6 JTOKA7O+P8yhOZQp6eMyMSEBQQHjm30tfiOLNzEXE9VfPwOJ753wuxbx2tKcv4a/2gHz gu1/k+nSBc1yBidS/o/5fHcLV1zJFR3NYKtx93+cBofLTtFJt5tvAGvHXTLhsvXt/ikY 1MTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=e7pncGk5Fzl8w3sKBwow6e+wEkFn9MQq/flrDdIJfFw=; fh=ODDN+4N/f9c5xkOnWNsWSipUMxFdbcOS+wXsOgXkeeM=; b=JFbHkF4qvAZ42spPqOGERzZTjlmg7R0C7ccU+WULsT544CYRaBcaP0UZwkjiTxzY3M WBtp50sjZiybuweGIhk4rZIUtkBJ0KR9VcQdEmJM+7z2YOd5qDUffR9xvu1LZPtuBoTz xCJULr+znfGsNfpo6Ar9ZormrwTS0QPXJ72UpRj7li2WuRw6vRjVB50rjH8jcI56bklF XujItKMEfdlSzlerKu/8ZoXVQxgcEMd0DBZASVbkcjGcMNoXNH1gkLugRYSdGMnbpCdg EXDt13n4JxQSHTkzV6GTgRS8HJ3iQwfMh8GtHBJNDslxduvb6e9eYh4jp7SJuVg6LAIC oNpg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lDIjGFUd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115889-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115889-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g4-20020a170906538400b00a47103b1f7esi2390300ejo.212.2024.03.25.02.41.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115889-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lDIjGFUd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115889-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115889-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id ECD571F37C7F for ; Mon, 25 Mar 2024 09:41:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 867F238486C; Mon, 25 Mar 2024 03:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lDIjGFUd" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 097E2537E3; Sun, 24 Mar 2024 23:14:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322082; cv=none; b=WJHPnghhXLRmpg20WADnlizgZpBZGUdVY3oGNB1rd3sMRyrgk6pEAwk2NgrY/pvOgOzvgYEf/h5o/o+Z8vDBn6RRQQkHFTSl3x5GdleSc/o8eqg23zyH44BOfHlhQ8zq+3rF5WHc5MqzTWwqYrF1T5j1hNWJYOcoX0mYM3JsCm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322082; c=relaxed/simple; bh=aDh5HbFT7bo3nQeJPz1AEYsn+qGFxyzMrs2YCCh4lL4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U7As6KDMynOm1SnIzroKcwszChkO0leYVHBIjZ35ZJH7LFXMSkFb8K/pPp/11RSAKc0SNpcF62L+iS/4BR5dOSGzynyzDhfkYNTTSZrKRTq4Bzu4ql27IRXBRmAN/bj6+OxSkzpdMvVsS/kzRqUu+hTKjTsuWHACEXGXnDQ+WWc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lDIjGFUd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2ED96C433F1; Sun, 24 Mar 2024 23:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322081; bh=aDh5HbFT7bo3nQeJPz1AEYsn+qGFxyzMrs2YCCh4lL4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lDIjGFUdTZJewyZU2GzSY8EacJT4sjEmREvVlouEPIKIMnp5+7yznOW/AGPeLS4RN rmrv6B55SVtb/L9i7ptKuqvVStTktVfZbPQA1hZyw0n4BLHyZnOsilrgzRC2lCupvY XdBzdYu4No4RCravfNxlv5tvaLCB3VTv8PILl3oSuPbVU4K72VBIDWYa8FdJliTqt5 AjGrIkJDV6VT2J1hO4kjTWWujSaUI7JljJVWqG2voQQekhX/Xm1O2kALTRXYtk3qzZ lMwtO1PHwAkOWF8a4ybK+kZL4txUzMgYCLWH/P9HLqIJGuVJgr0RWBfSPriletV46/ VxPtBSEadSFEA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mario Limonciello , Vasant Hegde , Joerg Roedel , Sasha Levin Subject: [PATCH 6.1 155/451] iommu/amd: Mark interrupt as managed Date: Sun, 24 Mar 2024 19:07:11 -0400 Message-ID: <20240324231207.1351418-156-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Mario Limonciello [ Upstream commit 0feda94c868d396fac3b3cb14089d2d989a07c72 ] On many systems that have an AMD IOMMU the following sequence of warnings is observed during bootup. ``` pci 0000:00:00.2 can't derive routing for PCI INT A pci 0000:00:00.2: PCI INT A: not connected ``` This series of events happens because of the IOMMU initialization sequence order and the lack of _PRT entries for the IOMMU. During initialization the IOMMU driver first enables the PCI device using pci_enable_device(). This will call acpi_pci_irq_enable() which will check if the interrupt is declared in a PCI routing table (_PRT) entry. According to the PCI spec [1] these routing entries are only required under PCI root bridges: The _PRT object is required under all PCI root bridges The IOMMU is directly connected to the root complex, so there is no parent bridge to look for a _PRT entry. The first warning is emitted since no entry could be found in the hierarchy. The second warning is then emitted because the interrupt hasn't yet been configured to any value. The pin was configured in pci_read_irq() but the byte in PCI_INTERRUPT_LINE return 0xff which means "Unknown". After that sequence of events pci_enable_msi() is called and this will allocate an interrupt. That is both of these warnings are totally harmless because the IOMMU uses MSI for interrupts. To avoid even trying to probe for a _PRT entry mark the IOMMU as IRQ managed. This avoids both warnings. Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/06_Device_Configuration/Device_Configuration.html?highlight=_prt#prt-pci-routing-table [1] Signed-off-by: Mario Limonciello Fixes: cffe0a2b5a34 ("x86, irq: Keep balance of IOAPIC pin reference count") Reviewed-by: Vasant Hegde Link: https://lore.kernel.org/r/20240122233400.1802-1-mario.limonciello@amd.com Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/amd/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index f6e64c9858021..cc94ac6662339 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -2047,6 +2047,9 @@ static int __init iommu_init_pci(struct amd_iommu *iommu) /* Prevent binding other PCI device drivers to IOMMU devices */ iommu->dev->match_driver = false; + /* ACPI _PRT won't have an IRQ for IOMMU */ + iommu->dev->irq_managed = 1; + pci_read_config_dword(iommu->dev, cap_ptr + MMIO_CAP_HDR_OFFSET, &iommu->cap); -- 2.43.0