[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221113034519-mutt-send-email-mst@kernel.org>
Date: Sun, 13 Nov 2022 03:46:06 -0500
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: Wei Gong <gongwei833x@...il.com>, linux-kernel@...r.kernel.org,
Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org
Subject: Re: [PATCH v2] pci: fix device presence detection for VFs
On Fri, Nov 11, 2022 at 05:42:19PM -0600, Bjorn Helgaas wrote:
> On Thu, Nov 10, 2022 at 03:15:55PM -0500, Michael S. Tsirkin wrote:
> > On Thu, Nov 10, 2022 at 01:35:47PM -0600, Bjorn Helgaas wrote:
> > ...
>
> > > Prior to this change pci_device_is_present(VF) returned "false"
> > > (because the VF Vendor ID is 0xffff); after the change it will return
> > > "true" (because it will look at the PF Vendor ID instead).
> > >
> > > Previously virtio_pci_remove() called virtio_break_device(). I guess
> > > that meant the virtio I/O operation will never be completed?
> > >
> > > But if we don't call virtio_break_device(), the virtio I/O operation
> > > *will* be completed?
> >
> > It's completed anyway - nothing special happened at the device
> > level - but driver does not detect it.
> >
> > Calling virtio_break_device will mark all queues as broken, as
> > a result attempts to check whether operation completed
> > will return false.
> >
> > This probably means we need to work on handling surprise removal
> > better in virtio blk - since it looks like actual suprise
> > removal will hang too. But that I think is a separate issue.
>
> Yeah, this situation doesn't seem like it's inherently special for
> virtio or VFs, so it's a little surprising to see
> pci_device_is_present() used there.
>
> Bjorn
Just making sure - pci_device_is_present *is* the suggested way
to distinguish between graceful and surprise removal, isn't it?
--
MST
Powered by blists - more mailing lists