From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
To: Brett Creeley <brett.creeley@amd.com>,
"jgg@ziepe.ca" <jgg@ziepe.ca>,
"yishaih@nvidia.com" <yishaih@nvidia.com>,
liulongfang <liulongfang@huawei.com>,
"kevin.tian@intel.com" <kevin.tian@intel.com>,
"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "shannon.nelson@amd.com" <shannon.nelson@amd.com>
Subject: RE: [PATCH vfio 2/2] hisi_acc_vfio_pci: Destroy the [state|reset]_mutex on release
Date: Fri, 24 Nov 2023 08:51:09 +0000 [thread overview]
Message-ID: <00df3a24ff594c409eb2ab92d20733f5@huawei.com> (raw)
In-Reply-To: <20231122193634.27250-3-brett.creeley@amd.com>
> -----Original Message-----
> From: Brett Creeley [mailto:brett.creeley@amd.com]
> Sent: 22 November 2023 19:37
> To: jgg@ziepe.ca; yishaih@nvidia.com; liulongfang
> <liulongfang@huawei.com>; Shameerali Kolothum Thodi
> <shameerali.kolothum.thodi@huawei.com>; kevin.tian@intel.com;
> alex.williamson@redhat.com; kvm@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Cc: shannon.nelson@amd.com; brett.creeley@amd.com
> Subject: [PATCH vfio 2/2] hisi_acc_vfio_pci: Destroy the [state|reset]_mutex
> on release
>
> The [state|reset]_mutex are initialized in vfio init, but
> never destroyed. This isn't required as mutex_destroy()
> doesn't do anything unless lock debugging is enabled.
> However, for completeness, fix it by implementing a
> driver specific release function.
>
> No fixes tag is added as it doesn't seem worthwhile
> for such a trivial and debug only change.
>
> Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Reviewed-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Thanks.
> ---
> drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> index 2c049b8de4b4..dc1e376e1b8a 100644
> --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> @@ -1358,10 +1358,20 @@ static int
> hisi_acc_vfio_pci_migrn_init_dev(struct vfio_device *core_vdev)
> return vfio_pci_core_init_dev(core_vdev);
> }
>
> +static void hisi_acc_vfio_pci_migrn_release_dev(struct vfio_device
> *core_vdev)
> +{
> + struct hisi_acc_vf_core_device *hisi_acc_vdev =
> container_of(core_vdev,
> + struct hisi_acc_vf_core_device, core_device.vdev);
> +
> + mutex_destroy(&hisi_acc_vdev->reset_mutex);
> + mutex_destroy(&hisi_acc_vdev->state_mutex);
> + vfio_pci_core_release_dev(core_vdev);
> +}
> +
> static const struct vfio_device_ops hisi_acc_vfio_pci_migrn_ops = {
> .name = "hisi-acc-vfio-pci-migration",
> .init = hisi_acc_vfio_pci_migrn_init_dev,
> - .release = vfio_pci_core_release_dev,
> + .release = hisi_acc_vfio_pci_migrn_release_dev,
> .open_device = hisi_acc_vfio_pci_open_device,
> .close_device = hisi_acc_vfio_pci_close_device,
> .ioctl = hisi_acc_vfio_pci_ioctl,
> --
> 2.17.1
prev parent reply other threads:[~2023-11-24 8:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 19:36 [PATCH vfio 0/2] hisi_acc_vfio_pci: locking updates Brett Creeley
2023-11-22 19:36 ` [PATCH vfio 1/2] hisi_acc_vfio_pci: Change reset_lock to mutex_lock Brett Creeley
2023-11-24 8:46 ` Shameerali Kolothum Thodi
2023-11-28 0:46 ` Jason Gunthorpe
2023-11-28 8:05 ` Tian, Kevin
2023-11-22 19:36 ` [PATCH vfio 2/2] hisi_acc_vfio_pci: Destroy the [state|reset]_mutex on release Brett Creeley
2023-11-24 8:51 ` Shameerali Kolothum Thodi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=00df3a24ff594c409eb2ab92d20733f5@huawei.com \
--to=shameerali.kolothum.thodi@huawei.com \
--cc=alex.williamson@redhat.com \
--cc=brett.creeley@amd.com \
--cc=jgg@ziepe.ca \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liulongfang@huawei.com \
--cc=shannon.nelson@amd.com \
--cc=yishaih@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox