RE: [PATCH 7.2.y] iommu/arm-smmu-v3: Disable implementations during devm teardown

From: Shameer Kolothum Thodi

Date: Fri Sep 11 2026 - 08:56:34 EST




> -----Original Message-----
> From: Wentao Guan <guanwentao@xxxxxxxxxxxxx>
> Sent: 10 September 2026 07:54
> To: sashal@xxxxxxxxxx; Jason Gunthorpe <jgg@xxxxxxxxxx>
> Cc: will@xxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx;
> iommu@xxxxxxxxxxxxxxx; stable@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> Nicolin Chen <nicolinc@xxxxxxxxxx>; Shameer Kolothum Thodi
> <skolothumtho@xxxxxxxxxx>; Wentao Guan <guanwentao@xxxxxxxxxxxxx>
> 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@xxxxxxxxxxxxx>
> ---
> 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@xxxxxxxxxx>

Thanks,
Shameer