[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <42d12308-4777-47a7-a1ae-50dfada050cf@huawei.com>
Date: Fri, 14 Oct 2022 10:20:07 +0100
From: John Garry <john.garry@...wei.com>
To: Longfang Liu <liulongfang@...wei.com>,
<alex.williamson@...hat.com>, <jgg@...dia.com>,
<shameerali.kolothum.thodi@...wei.com>
CC: <cohuck@...hat.com>, <linux-kernel@...r.kernel.org>,
<linuxarm@...neuler.org>
Subject: Re: [Linuxarm] [PATCH 1/2] hisi_acc_vfio_pci: Add debugfs to
migration driver
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
Powered by blists - more mailing lists