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

Jason Gunthorpe jgg at nvidia.com
Mon Jun 16 09:03:59 PDT 2025


On Sat, Jun 14, 2025 at 12:14:49AM -0700, Nicolin Chen wrote:
> @@ -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 at nvidia.com>

Jason



More information about the linux-arm-kernel mailing list