From: Joerg Roedel <joro@8bytes.org>
To: "Zytaruk, Kelly" <Kelly.Zytaruk@amd.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"Marsan, Luugi" <Luugi.Marsan@amd.com>,
Alex Williamson <alex.williamson@redhat.com>
Subject: Re: BUGZILLA [112941] - Cannot reenable SRIOV after disabling SRIOV on AMD GPU
Date: Fri, 26 Feb 2016 16:55:58 +0100 [thread overview]
Message-ID: <20160226155558.GA32730@8bytes.org> (raw)
In-Reply-To: <CY1PR12MB02629490AFFE29BACB197EA6FEA50@CY1PR12MB0262.namprd12.prod.outlook.com>
Hi Kelly,
On Wed, Feb 24, 2016 at 06:29:56PM +0000, Zytaruk, Kelly wrote:
> I don't know if the asynchronous nature of the iommu attach/detach is
> by design or if it is broken somewhere up the tree and just not
> working in my case. Maybe one of the iommu owners could answer this.
Thanks a lot for your bug report and the detailed analysis of the
issue. I attached a possible fix for you to try out. Can you please test
it and report whether it changes anything?
Thanks,
Joerg
>From 027b6489833aef8ce5ec46cef3e0f9e6a61dbdcd Mon Sep 17 00:00:00 2001
From: Joerg Roedel <jroedel@suse.de>
Date: Fri, 26 Feb 2016 16:48:59 +0100
Subject: [PATCH] iommu/amd: Detach device from domain before removal
Detach the device that is about to be removed from its
domain (if it has one) to clear any related state like DTE
entry and device's ATS state.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 539b0de..60cc89f 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -114,6 +114,7 @@ struct kmem_cache *amd_iommu_irq_cache;
static void update_domain(struct protection_domain *domain);
static int protection_domain_init(struct protection_domain *domain);
+static void detach_device(struct device *dev);
/*
* For dynamic growth the aperture size is split into ranges of 128MB of
@@ -384,6 +385,9 @@ static void iommu_uninit_device(struct device *dev)
if (!dev_data)
return;
+ if (dev_data->domain)
+ detach_device(dev);
+
iommu_device_unlink(amd_iommu_rlookup_table[dev_data->devid]->iommu_dev,
dev);
--
1.8.4.5
next prev parent reply other threads:[~2016-02-26 15:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-23 15:52 BUGZILLA [112941] - Cannot reenable SRIOV after disabling SRIOV on AMD GPU Zytaruk, Kelly
2016-02-23 17:02 ` Bjorn Helgaas
2016-02-23 17:47 ` Zytaruk, Kelly
2016-02-24 18:29 ` Zytaruk, Kelly
2016-02-26 15:55 ` Joerg Roedel [this message]
2016-02-26 19:16 ` Zytaruk, Kelly
2016-02-29 16:36 ` 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=20160226155558.GA32730@8bytes.org \
--to=joro@8bytes.org \
--cc=Kelly.Zytaruk@amd.com \
--cc=Luugi.Marsan@amd.com \
--cc=alex.williamson@redhat.com \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.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).