Thread (77 messages) 77 messages, 5 authors, 2025-06-26

Re: [PATCH v6 24/25] iommu/tegra241-cmdqv: Add user-space use support

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2025-06-16 16:04:03
Also in: linux-doc, linux-iommu, linux-kselftest, linux-patches, linux-tegra, lkml

On Sat, Jun 14, 2025 at 12:14:49AM -0700, Nicolin Chen wrote:
quoted hunk ↗ jump to hunk
@@ -671,7 +752,13 @@ static void tegra241_cmdqv_remove_vintf(struct tegra241_cmdqv *cmdqv, u16 idx)
 
 	dev_dbg(cmdqv->dev, "VINTF%u: deallocated\n", vintf->idx);
 	tegra241_cmdqv_deinit_vintf(cmdqv, idx);
-	kfree(vintf);
+	if (!vintf->hyp_own) {
+		mutex_destroy(&vintf->lvcmdq_mutex);
+		ida_destroy(&vintf->sids);
+	}
+	/* Guest-owned VINTF is free-ed with viommu by iommufd core */
+	if (vintf->hyp_own)
+		kfree(vintf);
else ?


Otherwise looks OK to me

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help