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

Jason Gunthorpe jgg at nvidia.com
Mon Jul 19 13:01:31 UTC 2021


On Mon, Jul 19, 2021 at 02:58:58PM +0200, Cornelia Huck wrote:
> > -	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


More information about the dri-devel mailing list