From: Bjorn Helgaas <bhelgaas@google.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
Joerg Roedel <jroedel@suse.de>,
David Woodhouse <dwmw2@infradead.org>,
iommu <iommu@lists.linux-foundation.org>,
Gregor Dick <gdick@solarflare.com>
Subject: Re: [PATCH v2 00/11] PCI: Fix ATS deadlock
Date: Mon, 10 Aug 2015 12:33:22 -0500 [thread overview]
Message-ID: <20150810173322.GD32452@google.com> (raw)
In-Reply-To: <CAE9FiQXcj7Y+tqXPoFmYAuw-cTdpg1rzVzbkuGd-hA9O=QveXw@mail.gmail.com>
On Thu, Aug 06, 2015 at 06:06:34PM -0700, Yinghai Lu wrote:
> On Thu, Aug 6, 2015 at 9:03 AM, Yinghai Lu <yinghai@kernel.org> wrote:
> > On Wed, Jul 29, 2015 at 9:07 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> >>>
> >>> Bjorn Helgaas (11):
> >>> iommu/vt-d: Cache PCI ATS state and Invalidate Queue Depth
> >>> PCI: Allocate ATS struct during enumeration
> >>> PCI: Embed ATS info directly into struct pci_dev
> >>> PCI: Reduce size of ATS structure elements
> >>> PCI: Rationalize pci_ats_queue_depth() error checking
> >>> PCI: Inline the ATS setup code into pci_ats_init()
> >>> PCI: Use pci_physfn() rather than looking up physfn by hand
> >>> PCI: Clean up ATS error handling
> >>> PCI: Move ATS declarations to linux/pci.h so they're all together
> >>> PCI: Stop caching ATS Invalidate Queue Depth
> >>> PCI: Remove pci_ats_enabled()
> >>
> >> I applied these to a pci/iommu branch for v4.3. Let me know if you see any
> >> issues.
> >
> > looks like this branch causes hang on system with qlogic/emulex cards.
> >
> > exclude the branch, will make kernel work again.
>
> first patch has problem:
>
> 7b98d2d02887f8d422e05323241a5fa36b2a371e is the first bad commit
> commit 7b98d2d02887f8d422e05323241a5fa36b2a371e
> Author: Bjorn Helgaas <bhelgaas@google.com>
> Date: Mon Jul 20 09:10:36 2015 -0500
>
> iommu/vt-d: Cache PCI ATS state and Invalidate Queue Depth
>
> We check the ATS state (enabled/disabled) and fetch the PCI ATS Invalidate
> Queue Depth in performance-sensitive paths. It's easy to cache these,
> which removes dependencies on PCI.
>
> Remember the ATS enabled state. When enabling, read the queue depth once
> and cache it in the device_domain_info struct. This is similar to what
> amd_iommu.c does.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Huh, I don't see anything obvious there. Where does it hang? Boot?
Driver attach? Can you give me any hints, or maybe try the attached patch?
Is there anything funny about those particular devices? Maybe some
"lspci -vv" output?
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 6603448..988d9b5 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -1406,10 +1406,13 @@ static void iommu_enable_dev_iotlb(struct device_domain_info *info)
info->ats.enabled = 1;
info->ats.qdep = pci_ats_queue_depth(pdev);
+ dev_info(info->dev, "enabled ATS, qdep %d\n", info->ats.qdep);
}
static void iommu_disable_dev_iotlb(struct device_domain_info *info)
{
+ dev_info(info->dev, "disabling ATS, current %d\n", info->ats.enabled):
+
if (!info->ats.enabled)
return;
@@ -1426,6 +1429,13 @@ static void iommu_flush_dev_iotlb(struct dmar_domain *domain,
spin_lock_irqsave(&device_domain_lock, flags);
list_for_each_entry(info, &domain->devices, link) {
+ struct pci_dev *pdev;
+ if (!info->dev || !dev_is_pci(info->dev))
+ continue;
+
+ dev_info(info->dev, "flush; cached ena %d qdep %d, current ena %d qdep %d\n",
+ info->ats.enabled, info->ats.qdep,
+ pci_ats_enabled(pdev), pci_ats_queue_depth(pdev));
if (!info->ats.enabled)
continue;
next prev parent reply other threads:[~2015-08-10 17:33 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 0:13 [PATCH v2 00/11] PCI: Fix ATS deadlock Bjorn Helgaas
2015-07-21 0:13 ` [PATCH v2 01/11] iommu/vt-d: Cache PCI ATS state and Invalidate Queue Depth Bjorn Helgaas
2015-07-27 13:08 ` Joerg Roedel
2015-07-27 22:54 ` Bjorn Helgaas
2015-07-28 7:14 ` Joerg Roedel
2015-07-21 0:14 ` [PATCH v2 02/11] PCI: Allocate ATS struct during enumeration Bjorn Helgaas
2015-07-27 12:40 ` Joerg Roedel
2015-07-21 0:14 ` [PATCH v2 03/11] PCI: Embed ATS info directly into struct pci_dev Bjorn Helgaas
2015-07-27 12:45 ` Joerg Roedel
2015-07-21 0:14 ` [PATCH v2 04/11] PCI: Reduce size of ATS structure elements Bjorn Helgaas
2015-07-21 0:14 ` [PATCH v2 05/11] PCI: Rationalize pci_ats_queue_depth() error checking Bjorn Helgaas
2015-07-21 0:14 ` [PATCH v2 06/11] PCI: Inline the ATS setup code into pci_ats_init() Bjorn Helgaas
2015-07-21 0:14 ` [PATCH v2 07/11] PCI: Use pci_physfn() rather than looking up physfn by hand Bjorn Helgaas
2015-07-21 0:14 ` [PATCH v2 08/11] PCI: Clean up ATS error handling Bjorn Helgaas
2015-07-27 12:56 ` Joerg Roedel
2015-07-21 0:15 ` [PATCH v2 09/11] PCI: Move ATS declarations to linux/pci.h so they're all together Bjorn Helgaas
2015-07-21 0:15 ` [PATCH v2 10/11] PCI: Stop caching ATS Invalidate Queue Depth Bjorn Helgaas
2015-07-27 12:57 ` Joerg Roedel
2015-07-27 14:00 ` Don Dutile
2015-07-27 22:27 ` Bjorn Helgaas
2015-07-27 23:13 ` Don Dutile
2015-07-21 0:15 ` [PATCH v2 11/11] PCI: Remove pci_ats_enabled() Bjorn Helgaas
2015-07-27 12:58 ` Joerg Roedel
2015-07-28 15:16 ` [PATCH v2 00/11] PCI: Fix ATS deadlock Joerg Roedel
2015-07-29 16:07 ` Bjorn Helgaas
2015-08-06 16:03 ` Yinghai Lu
2015-08-07 1:06 ` Yinghai Lu
2015-08-10 17:33 ` Bjorn Helgaas [this message]
2015-08-10 22:54 ` Yinghai Lu
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=20150810173322.GD32452@google.com \
--to=bhelgaas@google.com \
--cc=dwmw2@infradead.org \
--cc=gdick@solarflare.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jroedel@suse.de \
--cc=linux-pci@vger.kernel.org \
--cc=yinghai@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;
as well as URLs for NNTP newsgroup(s).