linux/drivers/s390
Tony Krowiak 8c0795d2a0 s390/vfio-ap: clean up mdev resources when remove callback invoked
The mdev remove callback for the vfio_ap device driver bails out with
-EBUSY if the mdev is in use by a KVM guest (i.e., the KVM pointer in the
struct ap_matrix_mdev is not NULL). The intended purpose was
to prevent the mdev from being removed while in use. There are two
problems with this scenario:

1. Returning a non-zero return code from the remove callback does not
   prevent the removal of the mdev.

2. The KVM pointer in the struct ap_matrix_mdev will always be NULL because
   the remove callback will not get invoked until the mdev fd is closed.
   When the mdev fd is closed, the mdev release callback is invoked and
   clears the KVM pointer from the struct ap_matrix_mdev.

Let's go ahead and remove the check for KVM in the remove callback and
allow the cleanup of mdev resources to proceed.

Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20210609224634.575156-2-akrowiak@linux.ibm.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2021-06-21 11:19:18 +02:00
..
block s390/dasd: add missing discipline function 2021-05-25 12:54:00 -06:00
char s390 updates for 5.13 merge window 2021-04-27 17:54:15 -07:00
cio vfio-ccw: Serialize FSM IDLE state with I/O completion 2021-05-12 12:59:50 +02:00
crypto s390/vfio-ap: clean up mdev resources when remove callback invoked 2021-06-21 11:19:18 +02:00
net Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
scsi SCSI misc on 20210428 2021-04-28 17:22:10 -07:00
virtio virtio/s390: implement virtio-ccw revision 2 correctly 2021-02-24 00:31:23 +01:00
Makefile s390: remove pointless drivers-y in drivers/s390/Makefile 2019-09-16 13:21:51 +02:00