All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Suthikulpanit, Suravee via iommu" <iommu@lists.linux-foundation.org>
To: Lennert Buytenhek <buytenh@wantstofly.org>,
	iommu@lists.linux-foundation.org, Joerg Roedel <joro@8bytes.org>
Subject: Re: [PATCH] iommu/amd: Fix printing of IOMMU events when rate limiting kicks in
Date: Thu, 22 Jul 2021 10:55:46 -0500	[thread overview]
Message-ID: <82d11674-cabb-6129-11a8-23ca3c989bae@amd.com> (raw)
In-Reply-To: <YPgk1dD1gPMhJXgY@wantstofly.org>

On 7/21/2021 8:44 AM, Lennert Buytenhek wrote:
> For the printing of RMP_HW_ERROR / RMP_PAGE_FAULT / IO_PAGE_FAULT
> events, the AMD IOMMU code uses such logic:
> 
> 	if (pdev)
> 		dev_data = dev_iommu_priv_get(&pdev->dev);
> 
> 	if (dev_data && __ratelimit(&dev_data->rs)) {
> 		pci_err(pdev, ...
> 	} else {
> 		printk_ratelimit() / pr_err{,_ratelimited}(...
> 	}
> 
> This means that if we receive an event for a PCI devid which actually
> does have a struct pci_dev and an attached struct iommu_dev_data, but
> rate limiting kicks in, we'll fall back to the non-PCI branch of the
> test, and print the event in a different format.
> 
> Fix this by changing the logic to:
> 
> 	if (dev_data) {
> 		if (__ratelimit(&dev_data->rs)) {
> 			pci_err(pdev, ...
> 		}
> 	} else {
> 		pr_err_ratelimited(...
> 	}
> 
> Suggested-by: Suravee Suthikulpanit<suravee.suthikulpanit@amd.com>
> Signed-off-by: Lennert Buytenhek<buytenh@wantstofly.org>

Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2021-07-22 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 13:44 Lennert Buytenhek
2021-07-22 15:55 ` Suthikulpanit, Suravee via iommu [this message]
2021-07-26 12:23 ` 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=82d11674-cabb-6129-11a8-23ca3c989bae@amd.com \
    --to=iommu@lists.linux-foundation.org \
    --cc=buytenh@wantstofly.org \
    --cc=joro@8bytes.org \
    --cc=suravee.suthikulpanit@amd.com \
    --subject='Re: [PATCH] iommu/amd: Fix printing of IOMMU events when rate limiting kicks in' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.