summaryrefslogtreecommitdiff
path: root/drivers/virtio/virtio_pci_common.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-24 16:24:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-24 16:24:21 +0300
commit637d0957516eef3e861ca5889912c3234a9b593f (patch)
tree8df51837d2ec9cba39e333acd94de5f685466d5e /drivers/virtio/virtio_pci_common.c
parentb2159182dd498fdb0f49e371ccc94efbc12d1f8e (diff)
parente22ce8eb631bdc47a4a4ea7ecf4e4ba499db4f93 (diff)
downloadlinux-637d0957516eef3e861ca5889912c3234a9b593f.tar.xz
Merge 5.14-rc7 into char-misc-next
We need the char/misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/virtio/virtio_pci_common.c')
-rw-r--r--drivers/virtio/virtio_pci_common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
index 222d630c41fc..b35bb2d57f62 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -576,6 +576,13 @@ static void virtio_pci_remove(struct pci_dev *pci_dev)
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
struct device *dev = get_device(&vp_dev->vdev.dev);
+ /*
+ * Device is marked broken on surprise removal so that virtio upper
+ * layers can abort any ongoing operation.
+ */
+ if (!pci_device_is_present(pci_dev))
+ virtio_break_device(&vp_dev->vdev);
+
pci_disable_sriov(pci_dev);
unregister_virtio_device(&vp_dev->vdev);