From 5865348c39a2c734e1ab53ee720b7cda27d552aa Mon Sep 17 00:00:00 2001 From: Ashish Mhetre Date: Tue, 16 Sep 2025 14:42:33 +0000 Subject: [PATCH] DOWNSTREAM: iommu/arm-smmu-v3: Fix arm_smmu_impl_ops While backporting the upstream commit: 44a9231b800b454befac069d468e2f2b71827474 (iommu/arm-smmu-v3: Add struct arm_smmu_impl_ops) it didn't apply correctly causing cmdqv reset not getting invoked during resume. Fix it by moving the device reset in arm_smmu_device_reset as in upstream commit. Bug 5419379 Bug 5111712 Change-Id: Ifc873bccd0b43b4e6890ac5d6672b4ea3e71cc88 Signed-off-by: Ashish Mhetre Reviewed-on: https://git-master.nvidia.com/r/c/3rdparty/canonical/linux-noble/+/3452819 GVS: buildbot_gerritrpt Reviewed-by: svcacv Reviewed-by: Pritesh Raithatha --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 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 dbf12404145e..9b8d4a68daee 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -3452,6 +3452,14 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass) return ret; } + if (smmu->impl_ops && smmu->impl_ops->device_reset) { + ret = smmu->impl_ops->device_reset(smmu); + if (ret) { + dev_err(smmu->dev, "failed to reset impl\n"); + return ret; + } + } + return 0; } @@ -4035,14 +4043,6 @@ static int arm_smmu_device_probe(struct platform_device *pdev) goto err_free_sysfs; } - if (smmu->impl_ops && smmu->impl_ops->device_reset) { - ret = smmu->impl_ops->device_reset(smmu); - if (ret) { - dev_err(smmu->dev, "failed to reset impl\n"); - return ret; - } - } - return 0; err_free_sysfs: