[PATCH] iommu/intel: Fix build failure with intel-gtt and !intel-iommu

From: Joerg Roedel
Date: Fri Nov 11 2011 - 08:42:53 EST


With v3.2-rc1 the following build error occurs when Intel
IOMMU is off and Intel-GTT is on:

ERROR: "intel_iommu_gfx_mapped" [drivers/char/agp/intel-gtt.ko] undefined!

This patch fixes that.

Signed-off-by: Joerg Roedel <joerg.roedel@xxxxxxx>
---
drivers/char/agp/intel-gtt.c | 2 +-
include/linux/intel-iommu.h | 6 ++++++
2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 66cd0b8..bfe5133 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -22,6 +22,7 @@
#include <linux/pagemap.h>
#include <linux/agp_backend.h>
#include <linux/delay.h>
+#include <linux/intel-iommu.h>
#include <asm/smp.h>
#include "agp.h"
#include "intel-agp.h"
@@ -1186,7 +1187,6 @@ static void gen6_cleanup(void)
/* Certain Gen5 chipsets require require idling the GPU before
* unmapping anything from the GTT when VT-d is enabled.
*/
-extern int intel_iommu_gfx_mapped;
static inline int needs_idle_maps(void)
{
const unsigned short gpu_devid = intel_private.pcidev->device;
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index e6ca56d..651cc08 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -363,4 +363,10 @@ extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);

extern int dmar_ir_support(void);

+#ifdef CONFIG_INTEL_IOMMU
+extern int intel_iommu_gfx_mapped;
+#else
+#define intel_iommu_gfx_mapped 1
+#endif /* CONFIG_INTEL_IOMMU */
+
#endif
--
1.7.5.4


--
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/