Skip to contentSkip to conversation

drm/panfrost: fix GENERIC_ATOMIC64 dependency

PATCH In review Arnd Bergmann 3 participants 3 messages Jan 17, 2023 – Jan 18, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/panfrost: fix GENERIC_ATOMIC64 dependency

From: Arnd Bergmann <[email protected]>

On ARMv5 and earlier, a randconfig build can still run into

WARNING: unmet direct dependencies detected for IOMMU_IO_PGTABLE_LPAE
Depends on [n]: IOMMU_SUPPORT [=y] && (ARM [=y] || ARM64 || COMPILE_TEST [=y]) && !GENERIC_ATOMIC64 [=y] Selected by [y]:
- DRM_PANFROST [=y] && HAS_IOMEM [=y] && DRM [=y] && (ARM [=y] || ARM64 || COMPILE_TEST [=y] && !GENERIC_ATOMIC64 [=y]) && MMU [=y]

Rework the dependencies to always require a working cmpxchg64.

Fixes db594ba3fcf9 ("drm/panfrost: depend on !GENERIC_ATOMIC64 when using COMPILE_TEST")
---
 drivers/gpu/drm/panfrost/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/panfrost/Kconfig +2 -1
index 079600328be1..e6403a9d66ad 100644
@@ -3,7 +3,8 @@
 config DRM_PANFROST
 	tristate "Panfrost (DRM support for ARM Mali Midgard/Bifrost GPUs)"
 	depends on DRM
-	depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
+	depends on ARM || ARM64 || COMPILE_TEST
+	depends on !GENERIC_ATOMIC64    # for IOMMU_IO_PGTABLE_LPAE
 	depends on MMU
 	select DRM_SCHED
 	select IOMMU_SUPPORT
Signature · 1 line
2.39.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

On ARMv5 and earlier, a randconfig build can still run into

Quoted 8 lines

WARNING: unmet direct dependencies detected for IOMMU_IO_PGTABLE_LPAE
Depends on [n]: IOMMU_SUPPORT [=y] && (ARM [=y] || ARM64 || COMPILE_TEST [=y]) && !GENERIC_ATOMIC64 [=y] Selected by [y]:
- DRM_PANFROST [=y] && HAS_IOMEM [=y] && DRM [=y] && (ARM [=y] || ARM64 || COMPILE_TEST [=y] && !GENERIC_ATOMIC64 [=y]) && MMU [=y]

Rework the dependencies to always require a working cmpxchg64.

Fixes db594ba3fcf9 ("drm/panfrost: depend on !GENERIC_ATOMIC64 when using COMPILE_TEST")

Looking at db594ba3fcf9 - it states:

Quoted 3 lines

Since panfrost has a 'select' on IOMMU_IO_PGTABLE_LPAE we must depend on the same set of flags. Otherwise IOMMU_IO_PGTABLE_LPAE will be forced on even though it cannot build (no support for cmpxchg64).

And at the time the dependencies on IOMMU_IO_PGTABLE_LPAE were exactly these.

However d286a58bc8f4 ("iommu: Tidy up io-pgtable dependencies") (currently in the iommu tree) changed the depends to split the !GENERIC_ATOMIC64 out. So we could argue that really that's the commit that should be blamed in the fixes line.

However there's no harm in this being backported further than it strictly needs to be, and it's clearly better having the !GENERIC_ATOMIC64 split out. So I'll merge this to drm-misc-fixes.

Thanks!

Steve

Quoted 19 lines
---
 drivers/gpu/drm/panfrost/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/panfrost/Kconfig +2 -1
index 079600328be1..e6403a9d66ad 100644
@@ -3,7 +3,8 @@
 config DRM_PANFROST
 	tristate "Panfrost (DRM support for ARM Mali Midgard/Bifrost GPUs)"
 	depends on DRM
-	depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
+	depends on ARM || ARM64 || COMPILE_TEST
+	depends on !GENERIC_ATOMIC64    # for IOMMU_IO_PGTABLE_LPAE
 	depends on MMU
 	select DRM_SCHED
 	select IOMMU_SUPPORT
#2 lore raw
Quoted 20 lines · Steven Price
Quoted 4 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

On ARMv5 and earlier, a randconfig build can still run into

Quoted 8 lines

WARNING: unmet direct dependencies detected for IOMMU_IO_PGTABLE_LPAE
Depends on [n]: IOMMU_SUPPORT [=y] && (ARM [=y] || ARM64 || COMPILE_TEST [=y]) && !GENERIC_ATOMIC64 [=y] Selected by [y]:
- DRM_PANFROST [=y] && HAS_IOMEM [=y] && DRM [=y] && (ARM [=y] || ARM64 || COMPILE_TEST [=y] && !GENERIC_ATOMIC64 [=y]) && MMU [=y]

Rework the dependencies to always require a working cmpxchg64.

Fixes db594ba3fcf9 ("drm/panfrost: depend on !GENERIC_ATOMIC64 when using COMPILE_TEST")

Looking at db594ba3fcf9 - it states:

Quoted 3 lines

Since panfrost has a 'select' on IOMMU_IO_PGTABLE_LPAE we must depend on the same set of flags. Otherwise IOMMU_IO_PGTABLE_LPAE will be forced on even though it cannot build (no support for cmpxchg64).

Quoted 7 lines

And at the time the dependencies on IOMMU_IO_PGTABLE_LPAE were exactly these.

However d286a58bc8f4 ("iommu: Tidy up io-pgtable dependencies") (currently in the iommu tree) changed the depends to split the !GENERIC_ATOMIC64 out. So we could argue that really that's the commit that should be blamed in the fixes line.

Oh bum... indeed this is entirely my fault for forgetting about our one "foreign" io-pgtable user in that commit, sorry about that.

Quoted 3 lines

However there's no harm in this being backported further than it strictly needs to be, and it's clearly better having the !GENERIC_ATOMIC64 split out. So I'll merge this to drm-misc-fixes.

Thanks both!

Robin.

Quoted 27 lines

Thanks!

Steve

Quoted 19 lines
---
  drivers/gpu/drm/panfrost/Kconfig | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/panfrost/Kconfig +2 -1
index 079600328be1..e6403a9d66ad 100644
@@ -3,7 +3,8 @@
  config DRM_PANFROST
  	tristate "Panfrost (DRM support for ARM Mali Midgard/Bifrost GPUs)"
  	depends on DRM
-	depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
+	depends on ARM || ARM64 || COMPILE_TEST
+	depends on !GENERIC_ATOMIC64    # for IOMMU_IO_PGTABLE_LPAE
  	depends on MMU
  	select DRM_SCHED
  	select IOMMU_SUPPORT