From: David Vrabel <david.vrabel@citrix.com>
To: <konrad@kernel.org>, <xen-devel@lists.xenproject.org>,
<boris.ostrovsky@oracle.com>, <linux-kernel@vger.kernel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH v3 2/7] xen/pciback: Don't deadlock when unbinding.
Date: Wed, 9 Jul 2014 13:21:12 +0100 [thread overview]
Message-ID: <53BD33B8.9020901@citrix.com> (raw)
In-Reply-To: <1404845909-13563-3-git-send-email-konrad@kernel.org>
On 08/07/14 19:58, konrad@kernel.org wrote:
> --- a/drivers/xen/xen-pciback/pci_stub.c
> +++ b/drivers/xen/xen-pciback/pci_stub.c
> @@ -277,10 +277,15 @@ void pcistub_put_pci_dev(struct pci_dev *dev)
> * (so it's ready for the next domain)
> */
>
> - /* This is OK - we are running from workqueue context
> - * and want to inhibit the user from fiddling with 'reset'
> + /* We might be holding the PCI lock (see comment at the top of the
> + * function) - as such try lock and if we can't then don't worry -
> + * as either:
> + * - we are 'unbind' in which case 'pcistub_device_release' gets
> + * called which does the locked version of this.
> + * - the toolstack has the smarts to do it and has done the
> + * reset on SysFS before assigning this device to another guest.
> */
> - pci_reset_function(dev);
> + pci_try_reset_function(dev);
Why not use __pci_reset_function_locked() and ensure all callers of
pcistub_put_pci_dev() are holding the device lock?
> pci_restore_state(dev);
If we didn't reset the device there is no need to restore its state.
David
next prev parent reply other threads:[~2014-07-09 12:21 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 18:58 [PATCH] Xen PCIbackend support for slot and bus reset (v3) konrad
2014-07-08 18:58 ` [PATCH v3 1/7] xen-pciback: Document the various parameters and attributes in SysFS konrad
2014-07-08 18:18 ` [Xen-devel] " Andrew Cooper
2014-07-09 12:17 ` David Vrabel
2014-07-09 13:59 ` Konrad Rzeszutek Wilk
2014-07-09 14:05 ` Andrew Cooper
2014-07-09 14:13 ` Konrad Rzeszutek Wilk
2014-07-09 14:22 ` Andrew Cooper
2014-07-09 14:25 ` Konrad Rzeszutek Wilk
2014-07-09 14:45 ` David Vrabel
2014-07-09 14:47 ` Konrad Rzeszutek Wilk
2014-07-09 14:57 ` David Vrabel
2014-07-09 15:11 ` Konrad Rzeszutek Wilk
2014-07-08 18:58 ` [PATCH v3 2/7] xen/pciback: Don't deadlock when unbinding konrad
2014-07-09 12:21 ` David Vrabel [this message]
2014-07-09 14:01 ` Konrad Rzeszutek Wilk
2014-07-08 18:58 ` [PATCH v3 3/7] xen/pciback: Move the FLR code to a function konrad
2014-07-08 18:58 ` [PATCH v3 4/7] xen/pciback: Implement PCI reset slot or bus with 'do_flr' SysFS attribute konrad
2014-07-08 18:02 ` David Vrabel
2014-07-08 18:46 ` Konrad Rzeszutek Wilk
2014-07-08 19:28 ` Konrad Rzeszutek Wilk
2014-07-09 12:32 ` David Vrabel
2014-07-09 14:11 ` [Xen-devel] " David Vrabel
2014-07-09 14:12 ` Konrad Rzeszutek Wilk
2014-07-09 14:26 ` David Vrabel
2014-07-09 15:07 ` Konrad Rzeszutek Wilk
2014-07-08 18:17 ` [Xen-devel] " Andrew Cooper
2014-07-08 18:58 ` [PATCH v3 5/7] xen/pciback: Include the domain id if removing the device whilst still in use konrad
2014-07-09 12:34 ` David Vrabel
2014-07-08 18:58 ` [PATCH v3 6/7] xen/pciback: Print out the domain owning the device konrad
2014-07-09 13:04 ` David Vrabel
2014-07-08 18:58 ` [PATCH v3 7/7] xen/pciback: Remove tons of dereferences konrad
2014-07-08 19:15 ` [Xen-devel] [PATCH] Xen PCIbackend support for slot and bus reset (v3) Sander Eikelenboom
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=53BD33B8.9020901@citrix.com \
--to=david.vrabel@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=konrad@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xenproject.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