Skip to contentSkip to conversation

drm/i915/selftests: fix check for intel IOMMU

PATCH In review Arnd Bergmann 4 participants 4 messages Oct 5, 2017 – Oct 6, 2017

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

PATCH 1/1 drm/i915/selftests: fix check for intel IOMMU

An earlier bugfix tried to work around this build failure:

drivers/gpu/drm/i915/selftests/mock_gem_device.c: In function 'mock_gem_device':
drivers/gpu/drm/i915/selftests/mock_gem_device.c:151:20: error: 'struct dev_archdata' has no member named 'iommu'

Checking for CONFIG_IOMMU_API is not sufficient as a compile-time test since that may be enabled in configurations that have neither INTEL_IOMMU not AMD_IOMMU enabled. This changes the check to INTEL_IOMMU instead, as this is the only case we actually care about.

Fixes f46f156ea770 ("drm/i915/selftests: Only touch archdata.iommu when it exists")
---
 drivers/gpu/drm/i915/selftests/mock_gem_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/selftests/mock_gem_device.c +1 -1
index 2388424a14da..3b7877884dd1 100644
@@ -146,7 +146,7 @@ struct drm_i915_private *mock_gem_device(void)
 	dev_set_name(&pdev->dev, "mock");
 	dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
 
-#if IS_ENABLED(CONFIG_IOMMU_API)
+#if IS_ENABLED(CONFIG_IOMMU_API) && defined(CONFIG_INTEL_IOMMU)
 	/* hack to disable iommu for the fake device; force identity mapping */
 	pdev->dev.archdata.iommu = (void *)-1;
 #endif
Signature · 1 line
2.9.0
Reviewed-by on v1 1/1
#1 lore raw

Quoting Arnd Bergmann (2017-10-05 13:07:22)

Quoted 5 lines

An earlier bugfix tried to work around this build failure:

drivers/gpu/drm/i915/selftests/mock_gem_device.c: In function 'mock_gem_device':
drivers/gpu/drm/i915/selftests/mock_gem_device.c:151:20: error: 'struct dev_archdata' has no member named 'iommu'

Quoted 7 lines

Checking for CONFIG_IOMMU_API is not sufficient as a compile-time test since that may be enabled in configurations that have neither INTEL_IOMMU not AMD_IOMMU enabled. This changes the check to INTEL_IOMMU instead, as this is the only case we actually care about.

Fixes f46f156ea770 ("drm/i915/selftests: Only touch archdata.iommu when it exists")

I'll take your wisdom. I was lost trying to nail down exactly what config options we needed to check and settled for something that appeared good enough (for the small selection of configs I tested).

-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 11 lines · Chris Wilson

Quoting Arnd Bergmann (2017-10-05 13:07:22)

Quoted 10 lines

An earlier bugfix tried to work around this build failure:

drivers/gpu/drm/i915/selftests/mock_gem_device.c: In function 'mock_gem_device':
drivers/gpu/drm/i915/selftests/mock_gem_device.c:151:20: error: 'struct dev_archdata' has no member named 'iommu'

Checking for CONFIG_IOMMU_API is not sufficient as a compile-time test since that may be enabled in configurations that have neither INTEL_IOMMU not AMD_IOMMU enabled. This changes the check to INTEL_IOMMU instead, as this is the only case we actually care about.

Quoted 8 lines
Quoted 2 lines
Fixes f46f156ea770 ("drm/i915/selftests: Only touch archdata.iommu when it exists")

I'll take your wisdom. I was lost trying to nail down exactly what config options we needed to check and settled for something that appeared good enough (for the small selection of configs I tested).

Pushed, thanks.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

✗ Fi.CI.BAT: failure for drm/i915/selftests: fix check for intel IOMMU

In reply to Arnd Bergmann
== Series Details ==

== Series Details ==

Series: drm/i915/selftests: fix check for intel IOMMU
URL : https://patchwork.freedesktop.org/series/31426/
State : failure

== Summary ==

Series 31426 revision 1 was fully merged or fully failed: no git log

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx