
Offering: HULK hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I6HRGK ---------------------------------------------------- Add CONFIG_ARM_SMMU_V3_PM to control the support for arm-smmu-v3 suspend and resume which was introduced in 4b009f708c37ce215483ac68c6a0b6b9f0d29c6d. Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> --- arch/arm64/configs/openeuler_defconfig | 1 + drivers/iommu/Kconfig | 7 +++++++ drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 9 ++++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index 3f1532646775..d5d28adedd5e 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -5930,6 +5930,7 @@ CONFIG_ARM_SMMU=y CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT=y CONFIG_ARM_SMMU_V3=y CONFIG_ARM_SMMU_V3_SVA=y +CONFIG_ARM_SMMU_V3_PM=y # CONFIG_AGENT_SMMU_ATOS is not set # CONFIG_QCOM_IOMMU is not set # CONFIG_VIRTIO_IOMMU is not set diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index d632d456ed3c..f04a2bde0018 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -336,6 +336,13 @@ config AGENT_SMMU_ATOS Say Y here if your system will be used in Ascend Advanced Accelerator with HCCS bus. Or want use the ATOS of SMMU. +config ARM_SMMU_V3_PM + bool "Add arm_smmu_v3 suspend and resume support" + depends on ARM_SMMU_V3 && PM_SLEEP + default n + help + Add support for suspend and resume support for arm smmu v3. + config S390_IOMMU def_bool y if S390 && PCI depends on S390 && PCI 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 3f6d25bf0587..be8cc53659f8 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -4349,7 +4349,7 @@ static void arm_smmu_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg) doorbell = (((u64)msg->address_hi) << 32) | msg->address_lo; doorbell &= MSI_CFG0_ADDR_MASK; -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_SMMU_V3_PM /* Saves the msg (base addr of msi irq) and restores it during resume */ desc->msg.address_lo = msg->address_lo; desc->msg.address_hi = msg->address_hi; @@ -4411,7 +4411,7 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu) devm_add_action(dev, arm_smmu_free_msis, dev); } -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_SMMU_V3_PM static void arm_smmu_resume_msis(struct arm_smmu_device *smmu) { struct msi_desc *desc; @@ -5313,8 +5313,7 @@ static void __iomem *arm_smmu_ioremap(struct device *dev, resource_size_t start, return devm_ioremap_resource(dev, &res); } -#ifdef CONFIG_PM_SLEEP - +#ifdef CONFIG_ARM_SMMU_V3_PM static int arm_smmu_ecmdq_disable(struct device *dev) { int i, j; @@ -5521,7 +5520,7 @@ static const struct of_device_id arm_smmu_of_match[] = { }; MODULE_DEVICE_TABLE(of, arm_smmu_of_match); -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_SMMU_V3_PM static const struct dev_pm_ops arm_smmu_pm_ops = { .suspend = arm_smmu_suspend, .resume = arm_smmu_resume, -- 2.17.1