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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 19, 2021 at 10:01:31AM -0300, Jason Gunthorpe wrote:
> 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?

Oh, nevermind, I see it now. Yes, that needs fixing, thanks

Jason
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux