linux-brain/drivers/vfio
Parav Pandit f736690af3 vfio/mdev: Fix aborting mdev child device removal if one fails
[ Upstream commit 6093e348a5 ]

device_for_each_child() stops executing callback function for remaining
child devices, if callback hits an error.
Each child mdev device is independent of each other.
While unregistering parent device, mdev core must remove all child mdev
devices.
Therefore, mdev_device_remove_cb() always returns success so that
device_for_each_child doesn't abort if one child removal hits error.

While at it, improve remove and unregister functions for below simplicity.

There isn't need to pass forced flag pointer during mdev parent
removal which invokes mdev_device_remove(). So simplify the flow.

mdev_device_remove() is called from two paths.
1. mdev_unregister_driver()
     mdev_device_remove_cb()
       mdev_device_remove()
2. remove_store()
     mdev_device_remove()

Fixes: 7b96953bc6 ("vfio: Mediated device Core driver")
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:46:33 +01:00
..
mdev vfio/mdev: Fix aborting mdev child device removal if one fails 2020-01-27 14:46:33 +01:00
pci vfio_pci: Enable memory accesses before calling pci_map_rom 2020-01-27 14:46:19 +01:00
platform vfio: platform: Fix reset module leak in error path 2018-08-03 07:50:22 +02:00
Kconfig vfio: Fix build break when SPAPR_TCE_IOMMU=n 2017-02-08 13:13:25 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vfio_iommu_spapr_tce.c vfio/spapr_tce: Get rid of possible infinite loop 2019-12-05 15:37:42 +01:00
vfio_iommu_type1.c vfio/type1: Limit DMA mappings per container 2019-05-02 09:40:30 +02:00
vfio_spapr_eeh.c drivers/vfio: Support EEH error injection 2015-05-12 20:33:35 +10:00
vfio.c vfio: Fix WARNING "do not call blocking ops when !TASK_RUNNING" 2019-06-15 11:54:54 +02:00
virqfd.c sched/wait: Rename wait_queue_t => wait_queue_entry_t 2017-06-20 12:18:27 +02:00