History

iommu/exynos: Fix suspend/resume with IDENTITY domain

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.

Marek Szyprowski committed 1 year ago

Commit 99deffc1 parent d9d3ced1 file · +2 −2Browse files

Unified · Split

drivers/iommu/exynos-iommu.c+2−2
@@ -832,7 +832,7 @@ static int __maybe_unused exynos_sysmmu_suspend(struct device *dev) · 831 unmodified lines
832 struct exynos_iommu_owner *owner = dev_iommu_priv_get(master);832 struct exynos_iommu_owner *owner = dev_iommu_priv_get(master);
833 833
834 mutex_lock(&owner->rpm_lock);834 mutex_lock(&owner->rpm_lock);
835 if (&data->domain->domain != &exynos_identity_domain) {835 if (data->domain) {
836 dev_dbg(data->sysmmu, "saving state\n");836 dev_dbg(data->sysmmu, "saving state\n");
837 __sysmmu_disable(data);837 __sysmmu_disable(data);
838 }838 }
@@ -850,7 +850,7 @@ static int __maybe_unused exynos_sysmmu_resume(struct device *dev) · 11 unmodified lines
850 struct exynos_iommu_owner *owner = dev_iommu_priv_get(master);850 struct exynos_iommu_owner *owner = dev_iommu_priv_get(master);
851 851
852 mutex_lock(&owner->rpm_lock);852 mutex_lock(&owner->rpm_lock);
853 if (&data->domain->domain != &exynos_identity_domain) {853 if (data->domain) {
854 dev_dbg(data->sysmmu, "restoring state\n");854 dev_dbg(data->sysmmu, "restoring state\n");
855 __sysmmu_enable(data);855 __sysmmu_enable(data);
856 }856 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t