lkml.org 
[lkml]   [2022]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [Linuxarm] [PATCH 1/2] hisi_acc_vfio_pci: Add debugfs to migration driver
From
On 14/10/2022 03:57, Longfang Liu wrote:
> +static void hisi_acc_vf_debugfs_init(struct hisi_acc_vf_core_device *hisi_acc_vdev)
> +{
> + struct pci_dev *vf_pdev = hisi_acc_vdev->vf_dev;
> + struct device *dev = &vf_pdev->dev;
> + int ret;
> +
> + if (!atomic_read(&hisi_acc_root_ref))
> + hisi_acc_debugfs_root = debugfs_create_dir("hisi_vfio_acc", NULL);
> + atomic_inc(&hisi_acc_root_ref);
> +

This looks totally racy, such that I wonder why even bother using an
atomic for hisi_acc_root_ref. Indeed, why is hisi_acc_debugfs_root not
created in the driver module init?

Thanks,
John

\
 
 \ /
  Last update: 2022-10-14 11:21    [W:0.078 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site