All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Ren, Yongjie" <yongjie.ren@intel.com>
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Tobias Geiger <tobias.geiger@vido.info>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Regression in kernel 3.5 as Dom0 regarding PCI Passthrough?!
Date: Wed, 5 Sep 2012 14:54:12 -0400	[thread overview]
Message-ID: <20120905185412.GA27077@phenom.dumpdata.com> (raw)
In-Reply-To: <1B4B44D9196EFF41AE41FDA404FC0A101881CE@SHSMSX101.ccr.corp.intel.com>

> > > > And its due to a patch I added in v3.4
> > > > (cd9db80e5257682a7f7ab245a2459648b3c8d268)
> > > > - which did not work properly in v3.4, but with v3.5 got it working
> > > > (977f857ca566a1e68045fcbb7cfc9c4acb077cf0) which causes v3.5 to
> > now
> > > > work
> > > > anymore.
> > > >
> > > > Anyhow, for right now jsut revert
> > > > cd9db80e5257682a7f7ab245a2459648b3c8d268
> > > > and it should work for you.
> > > >
> Confirmed, after reverting that commit, VT-d will work fine.
> Will you fix this and push it to upstream Linux, Konrad?
> 
> > > Also, our team reported a VT-d bug 2 months ago.
> > > http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1824
> >

Can either one of you please test this patch, please:


diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index 097e536..425bd0b 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -4,6 +4,8 @@
  * Ryan Wilson <hap9@epoch.ncsc.mil>
  * Chris Bookholt <hap10@epoch.ncsc.mil>
  */
+#define DEBUG 1
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/rwsem.h>
@@ -97,13 +99,15 @@ static void pcistub_device_release(struct kref *kref)
 	/* Call the reset function which does not take lock as this
 	 * is called from "unbind" which takes a device_lock mutex.
 	 */
+	dev_dbg(&psdev->dev->dev, "FLR locked..\n");
 	__pci_reset_function_locked(psdev->dev);
 	if (pci_load_and_free_saved_state(psdev->dev,
 					  &dev_data->pci_saved_state)) {
 		dev_dbg(&psdev->dev->dev, "Could not reload PCI state\n");
-	} else
+	} else {
+		dev_dbg(&psdev->dev->dev, "Reloading PCI state..\n");
 		pci_restore_state(psdev->dev);
-
+	}
 	/* Disable the device */
 	xen_pcibk_reset_device(psdev->dev);
 
@@ -353,16 +357,16 @@ static int __devinit pcistub_init_device(struct pci_dev *dev)
 	if (err)
 		goto config_release;
 
-	dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n");
-	__pci_reset_function_locked(dev);
-
 	/* We need the device active to save the state. */
 	dev_dbg(&dev->dev, "save state of device\n");
 	pci_save_state(dev);
 	dev_data->pci_saved_state = pci_store_saved_state(dev);
 	if (!dev_data->pci_saved_state)
 		dev_err(&dev->dev, "Could not store PCI conf saved state!\n");
-
+	else {
+		dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n");
+		__pci_reset_function_locked(dev);
+	}
 	/* Now disable the device (this also ensures some private device
 	 * data is setup before we export)
 	 */

  parent reply	other threads:[~2012-09-05 18:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28  8:25 Regression in kernel 3.5 as Dom0 regarding PCI Passthrough?! Ren, Yongjie
2012-08-28 13:19 ` Konrad Rzeszutek Wilk
2012-09-05 18:54 ` Konrad Rzeszutek Wilk [this message]
2012-09-06 11:28   ` Tobias Geiger
2012-09-06 13:05     ` Konrad Rzeszutek Wilk
2012-09-06 13:24       ` Tobias Geiger
2012-09-07  2:08     ` Ren, Yongjie
2012-09-07 10:37       ` Tobias Geiger
2012-09-06 11:32   ` Tobias Geiger
2012-09-06 11:46   ` Tobias Geiger
  -- strict thread matches above, loose matches on Subject: below --
2012-08-21  2:41 Ren, Yongjie
2012-08-21 14:23 ` Konrad Rzeszutek Wilk
2012-07-25 12:30 Tobias Geiger
2012-07-25 13:43 ` Konrad Rzeszutek Wilk
2012-07-25 14:20   ` Tobias Geiger
2012-07-25 14:32     ` Tobias Geiger
2012-07-25 17:59   ` Tobias Geiger
2012-07-25 18:09     ` Konrad Rzeszutek Wilk
2012-08-06 16:16   ` Konrad Rzeszutek Wilk
2012-08-20 23:30     ` Konrad Rzeszutek Wilk

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=20120905185412.GA27077@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=konrad@kernel.org \
    --cc=tobias.geiger@vido.info \
    --cc=xen-devel@lists.xen.org \
    --cc=yongjie.ren@intel.com \
    /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 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.