Thread (37 messages) flat view 37 messages, 7 authors, 2021-07-20

Re: [PATCH 03/13] vfio: Provide better generic support for open/release vfio_device_ops

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2021-07-19 13:01:38
Also in: dri-devel, intel-gfx, kvm, linux-s390

On Mon, Jul 19, 2021 at 02:58:58PM +0200, Cornelia Huck wrote:
quoted
-	ret = device->ops->open(device);
-	if (ret) {
-		module_put(device->dev->driver->owner);
-		vfio_device_put(device);
-		return ret;
+	mutex_lock(&device->dev_set->lock);
+	device->open_count++;
+	if (device->open_count == 1 && device->ops->open_device) {
+		ret = device->ops->open_device(device);
+		if (ret)
+			goto err_undo_count;
Won't that fail for mdev devices, until the patches later in this series
have been applied? (i.e. bad for bisect)
What are you seeing? At this point all devices will have a NULL
open_device and skip this logic?

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help