[PATCH 7.2.y] iommu/arm-smmu-v3: Disable implementations during devm teardown
Shameer Kolothum Thodi
skolothumtho at nvidia.com
Fri Sep 11 05:49:05 PDT 2026
> -----Original Message-----
> From: Wentao Guan <guanwentao at uniontech.com>
> Sent: 10 September 2026 07:54
> To: sashal at kernel.org; Jason Gunthorpe <jgg at nvidia.com>
> Cc: will at kernel.org; linux-arm-kernel at lists.infradead.org;
> iommu at lists.linux.dev; stable at vger.kernel.org; linux-kernel at vger.kernel.org;
> Nicolin Chen <nicolinc at nvidia.com>; Shameer Kolothum Thodi
> <skolothumtho at nvidia.com>; Wentao Guan <guanwentao at uniontech.com>
> Subject: [PATCH 7.2.y] iommu/arm-smmu-v3: Disable implementations during
> devm teardown
>
> External email: Use caution opening links or attachments
>
>
> The Tegra241 CMDQV teardown fix moved VINTF hardware deinitialization
> into the implementation device_disable() callback. However, its stable
> backport preceded the conversion to devm teardown and could only invoke
> the callback from the shutdown path.
>
> Now that arm_smmu_disable_action() manages normal teardown, invoke the
> implementation callback there while the command queue is still alive.
> This prevents the subsequent implementation remove action from releasing
> resources while the CMDQV hardware remains active.
>
> After ("iommu/arm-smmu-v3: Manage teardown with devm") merged in
> stable,
> now keep the shutdown path consistent with mainline, where disabling
> the base SMMU is sufficient.
>
> It is a fix for stable tree commit to aligned with mainline, so no
> upstream commit id here.
>
> Fixes: 5994617e09ee ("iommu/tegra241-cmdqv: Fix CMD_SYNC use-after-free
> on teardown")
> Signed-off-by: Wentao Guan <guanwentao at uniontech.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> index c993e101fab3a..ea908afb0da9d 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> @@ -4789,6 +4789,8 @@ static void arm_smmu_disable_action(void *data)
> {
> struct arm_smmu_device *smmu = data;
>
> + if (smmu->impl_ops && smmu->impl_ops->device_disable)
> + smmu->impl_ops->device_disable(smmu);
> arm_smmu_device_disable(smmu);
> }
>
> @@ -5621,8 +5623,6 @@ static void arm_smmu_device_shutdown(struct
> platform_device *pdev)
> {
> struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
>
> - if (smmu->impl_ops && smmu->impl_ops->device_disable)
> - smmu->impl_ops->device_disable(smmu);
> arm_smmu_device_disable(smmu);
> }
LGTM;
Reviewed-by: Shameer Kolothum <skolothumtho at nvidia.com>
Thanks,
Shameer
More information about the linux-arm-kernel
mailing list