All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/exynos: Fix suspend/resume with IDENTITY domain
       [not found] <CGME20250401202808eucas1p2d2db882c5b7e39bca39e0cf8d7696ca5@eucas1p2.samsung.com>
@ 2025-04-01 20:27 ` Marek Szyprowski
  2025-04-11 10:38   ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Szyprowski @ 2025-04-01 20:27 UTC (permalink / raw)
  To: iommu, linux-arm-kernel, linux-samsung-soc
  Cc: Marek Szyprowski, Joerg Roedel, Will Deacon, Robin Murphy,
	Krzysztof Kozlowski, Alim Akhtar, Jason Gunthorpe,
	Jerry Snitselaar

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: b3d14960e629 ("iommu/exynos: Implement an IDENTITY domain")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
This fixes random issues observed on various ARM 32bit Exynos SoC based
boards, like Odroid-XU3.

Best regards
Marek Szyprowski, PhD
Samsung R&D Institute Poland
---
 drivers/iommu/exynos-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 69e23e017d9e..317266aca6e2 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -832,7 +832,7 @@ static int __maybe_unused exynos_sysmmu_suspend(struct device *dev)
 		struct exynos_iommu_owner *owner = dev_iommu_priv_get(master);
 
 		mutex_lock(&owner->rpm_lock);
-		if (&data->domain->domain != &exynos_identity_domain) {
+		if (data->domain) {
 			dev_dbg(data->sysmmu, "saving state\n");
 			__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);
 
 		mutex_lock(&owner->rpm_lock);
-		if (&data->domain->domain != &exynos_identity_domain) {
+		if (data->domain) {
 			dev_dbg(data->sysmmu, "restoring state\n");
 			__sysmmu_enable(data);
 		}
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iommu/exynos: Fix suspend/resume with IDENTITY domain
  2025-04-01 20:27 ` [PATCH] iommu/exynos: Fix suspend/resume with IDENTITY domain Marek Szyprowski
@ 2025-04-11 10:38   ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2025-04-11 10:38 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: iommu, linux-arm-kernel, linux-samsung-soc, Will Deacon,
	Robin Murphy, Krzysztof Kozlowski, Alim Akhtar, Jason Gunthorpe,
	Jerry Snitselaar

On Tue, Apr 01, 2025 at 10:27:31PM +0200, Marek Szyprowski wrote:
> Fixes: b3d14960e629 ("iommu/exynos: Implement an IDENTITY domain")
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> This fixes random issues observed on various ARM 32bit Exynos SoC based
> boards, like Odroid-XU3.

Applied, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-11 11:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20250401202808eucas1p2d2db882c5b7e39bca39e0cf8d7696ca5@eucas1p2.samsung.com>
2025-04-01 20:27 ` [PATCH] iommu/exynos: Fix suspend/resume with IDENTITY domain Marek Szyprowski
2025-04-11 10:38   ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.