[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB5276C404F6183D97A503354D8CDB9@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Tue, 7 Feb 2023 07:54:06 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: "Liu, Yi L" <yi.l.liu@...el.com>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"jgg@...dia.com" <jgg@...dia.com>
CC: "cohuck@...hat.com" <cohuck@...hat.com>,
"eric.auger@...hat.com" <eric.auger@...hat.com>,
"nicolinc@...dia.com" <nicolinc@...dia.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"mjrosato@...ux.ibm.com" <mjrosato@...ux.ibm.com>,
"chao.p.peng@...ux.intel.com" <chao.p.peng@...ux.intel.com>,
"yi.y.sun@...ux.intel.com" <yi.y.sun@...ux.intel.com>,
"peterx@...hat.com" <peterx@...hat.com>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"shameerali.kolothum.thodi@...wei.com"
<shameerali.kolothum.thodi@...wei.com>,
"lulu@...hat.com" <lulu@...hat.com>,
"suravee.suthikulpanit@....com" <suravee.suthikulpanit@....com>,
"intel-gvt-dev@...ts.freedesktop.org"
<intel-gvt-dev@...ts.freedesktop.org>,
"intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
"Martins, Joao" <joao.m.martins@...cle.com>
Subject: RE: [PATCH v2 12/14] vfio: Add cdev for vfio_device
> From: Liu, Yi L <yi.l.liu@...el.com>
> Sent: Monday, February 6, 2023 5:06 PM
> +
> +static struct vfio {
> + dev_t device_devt;
> +} vfio;
the structure is meaningless.
> +int vfio_device_fops_open(struct inode *inode, struct file *filep)
> +{
> + struct vfio_device *device = container_of(inode->i_cdev,
> + struct vfio_device, cdev);
> + struct vfio_device_file *df;
> + int ret;
> +
> + if (!vfio_device_try_get_registration(device))
> + return -ENODEV;
> +
> + /*
> + * device access is blocked until .open_device() is called
> + * in BIND_IOMMUFD.
> + */
this comment is more related to the whole function instead of the
following allocation code. Move it to be the function comment.
> @@ -51,6 +52,7 @@ struct vfio_device {
> /* Members below here are private, not for driver use */
> unsigned int index;
> struct device device; /* device.kref covers object life circle */
> + struct cdev cdev;
only if CDEV is configured.
Powered by blists - more mailing lists