[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140709140106.GE21837@laptop.dumpdata.com>
Date: Wed, 9 Jul 2014 10:01:06 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To: David Vrabel <david.vrabel@...rix.com>
Cc: konrad@...nel.org, xen-devel@...ts.xenproject.org,
boris.ostrovsky@...cle.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/7] xen/pciback: Don't deadlock when unbinding.
On Wed, Jul 09, 2014 at 01:21:12PM +0100, David Vrabel wrote:
> On 08/07/14 19:58, konrad@...nel.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?
That could also be done.
>
> > pci_restore_state(dev);
>
> If we didn't reset the device there is no need to restore its state.
<nods>
>
> David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists