The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Vasant Hegde <vasant.hegde@amd.com>
To: Easwar Hariharan <eahariha@linux.microsoft.com>,
	Joerg Roedel <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Jerry Snitselaar <jsnitsel@redhat.com>,
	"open list:AMD IOMMU (AMD-VI)" <iommu@lists.linux.dev>,
	open list <linux-kernel@vger.kernel.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Subject: Re: [PATCH] iommu/amd: Enable PASID and ATS capabilities in the correct order
Date: Sat, 5 Jul 2025 10:01:40 +0530	[thread overview]
Message-ID: <64454198-4406-4933-bbcc-426132aea2ff@amd.com> (raw)
In-Reply-To: <20250703155433.6221-1-eahariha@linux.microsoft.com>



On 7/3/2025 9:24 PM, Easwar Hariharan wrote:
> Per the PCIe spec, behavior of the PASID capability is undefined if the
> value of the PASID Enable bit changes while the Enable bit of the
> function's ATS control register is Set. Unfortunately,
> pdev_enable_caps() does exactly that by ordering enabling ATS for the
> device before enabling PASID.
> > Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> Cc: Vasant Hegde <vasant.hegde@amd.com>
> Cc: Jason Gunthorpe <jgg@nvidia.com>
> Cc: Jerry Snitselaar <jsnitsel@redhat.com>
> Fixes: eda8c2860ab679 ("iommu/amd: Enable device ATS/PASID/PRI capabilities independently")
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>

Patch looks good.

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


-Vasant



> ---
>  drivers/iommu/amd/iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index 3117d99cf83d..8b8d3e843743 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -634,8 +634,8 @@ static inline void pdev_disable_cap_pasid(struct pci_dev *pdev)
>  
>  static void pdev_enable_caps(struct pci_dev *pdev)
>  {
> -	pdev_enable_cap_ats(pdev);
>  	pdev_enable_cap_pasid(pdev);
> +	pdev_enable_cap_ats(pdev);
>  	pdev_enable_cap_pri(pdev);
>  }
>  


      parent reply	other threads:[~2025-07-05  4:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 15:54 [PATCH] iommu/amd: Enable PASID and ATS capabilities in the correct order Easwar Hariharan
2025-07-04 12:51 ` Jason Gunthorpe
2025-07-05  4:31 ` Vasant Hegde [this message]

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=64454198-4406-4933-bbcc-426132aea2ff@amd.com \
    --to=vasant.hegde@amd.com \
    --cc=eahariha@linux.microsoft.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=jsnitsel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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