mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vasant Hegde <vasant.hegde@amd.com>
To: Mario Limonciello <mario.limonciello@amd.com>,
	joro@8bytes.org, suravee.suthikulpanit@amd.com
Cc: will@kernel.org, robin.murphy@arm.com, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu/amd: Mark interrupt as managed
Date: Mon, 12 Feb 2024 16:54:31 +0530	[thread overview]
Message-ID: <d698b3a0-c4a9-1ff1-dbf0-f795b5d4f29c@amd.com> (raw)
In-Reply-To: <20240122233400.1802-1-mario.limonciello@amd.com>



On 1/23/2024 5:04 AM, Mario Limonciello wrote:
> 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 <mario.limonciello@amd.com>

Patch looks good to me.

Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>

-Vasant

> ---
>  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 c83bd0c2a1c9..40979b0f5250 100644
> --- a/drivers/iommu/amd/init.c
> +++ b/drivers/iommu/amd/init.c
> @@ -2068,6 +2068,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);
>  
> 
> base-commit: 75f74f85a42eb294b657f847c33e1bb7921dbec9

  parent reply	other threads:[~2024-02-12 11:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 23:34 Mario Limonciello
2024-02-05 16:31 ` Mario Limonciello
2024-02-09  8:24   ` Joerg Roedel
2024-02-09 15:48     ` Mario Limonciello
2024-02-09 15:56       ` Joerg Roedel
2024-02-12 11:24 ` Vasant Hegde [this message]
2024-02-16 14:17 ` Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d698b3a0-c4a9-1ff1-dbf0-f795b5d4f29c@amd.com \
    --to=vasant.hegde@amd.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®