iommu/exynos: Fix suspend/resume with IDENTITY domain
[ Upstream commit 99deffc409b69000ac4877486e69ec6516becd53 ]
Commit bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper probe
path") changed the sequence of probing the SYSMMU controller devices and
calls to arm_iommu_attach_device(), what results in resuming SYSMMU
controller earlier, when it is still set to IDENTITY mapping. Such change
revealed the bug in IDENTITY handling in the exynos-iommu driver. When
SYSMMU controller is set to IDENTITY mapping, data->domain is NULL, so
adjust checks in suspend & resume callbacks to handle this case
correctly.
Fixes: b3d14960e6 ("iommu/exynos: Implement an IDENTITY domain")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20250401202731.2810474-1-m.szyprowski@samsung.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7640c2abb6
commit
5efd53900a
@@ -832,7 +832,7 @@ static int __maybe_unused exynos_sysmmu_suspend(struct device *dev)
|
|||||||
struct exynos_iommu_owner *owner = dev_iommu_priv_get(master);
|
struct exynos_iommu_owner *owner = dev_iommu_priv_get(master);
|
||||||
|
|
||||||
mutex_lock(&owner->rpm_lock);
|
mutex_lock(&owner->rpm_lock);
|
||||||
if (&data->domain->domain != &exynos_identity_domain) {
|
if (data->domain) {
|
||||||
dev_dbg(data->sysmmu, "saving state\n");
|
dev_dbg(data->sysmmu, "saving state\n");
|
||||||
__sysmmu_disable(data);
|
__sysmmu_disable(data);
|
||||||
}
|
}
|
||||||
@@ -850,7 +850,7 @@ static int __maybe_unused exynos_sysmmu_resume(struct device *dev)
|
|||||||
struct exynos_iommu_owner *owner = dev_iommu_priv_get(master);
|
struct exynos_iommu_owner *owner = dev_iommu_priv_get(master);
|
||||||
|
|
||||||
mutex_lock(&owner->rpm_lock);
|
mutex_lock(&owner->rpm_lock);
|
||||||
if (&data->domain->domain != &exynos_identity_domain) {
|
if (data->domain) {
|
||||||
dev_dbg(data->sysmmu, "restoring state\n");
|
dev_dbg(data->sysmmu, "restoring state\n");
|
||||||
__sysmmu_enable(data);
|
__sysmmu_enable(data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user