[Intel-gfx] [PATCH 33/34] vfio/mdev: Use the driver core to create the 'remove' file

Kirti Wankhede kwankhede at nvidia.com
Tue Apr 12 20:52:21 UTC 2022



On 4/11/2022 7:44 PM, Christoph Hellwig wrote:
> From: Jason Gunthorpe <jgg at nvidia.com>
> 
> The device creator is supposed to use the dev.groups value to add sysfs
> files before device_add is called, not call sysfs_create_files() after
> device_add() returns. This creates a race with uevent delivery where the
> extra attribute will not be visible.
> 
> This was being done because the groups had been co-opted by the mdev
> driver, now that prior patches have moved the driver's groups to the
> struct device_driver the dev.group is properly free for use here.
> 
> Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> ---
>   drivers/vfio/mdev/mdev_core.c    |  1 +
>   drivers/vfio/mdev/mdev_private.h |  2 ++
>   drivers/vfio/mdev/mdev_sysfs.c   | 19 ++++++++++---------
>   3 files changed, 13 insertions(+), 9 deletions(-)
> 

Reviewed-by: Kirti Wankhede <kwankhede at nvidia.com>


More information about the Intel-gfx mailing list