linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] iommu: Fix build failure without INTEL_IOMMU
@ 2015-06-04  8:07 Daniel J Blueman
  2015-06-04  8:12 ` Jiang Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel J Blueman @ 2015-06-04  8:07 UTC (permalink / raw)
  To: Jiang Liu
  Cc: Daniel J Blueman, Thomas Gleixner, Fenghua Yu, Steffen Persvold, LKML

Fix Intel IOMMU build failure in linux-next when CONFIG_INTEL_IOMMU is not enabled.

Signed-off-by: Daniel J Blueman <daniel@numascale.com>
---
 drivers/iommu/intel_irq_remapping.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index 24f7a35..ec337e7 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -146,8 +146,10 @@ static int modify_irte(struct irq_2_iommu *irq_iommu,
 	set_64bit(&irte->low, irte_modified->low);
 	set_64bit(&irte->high, irte_modified->high);
 
+#ifdef CONFIG_INTEL_IOMMU
 	if (iommu->pre_enabled_ir)
 		__iommu_update_old_irte(iommu, index);
+#endif
 
 	__iommu_flush_cache(iommu, irte, sizeof(*irte));
 
@@ -210,8 +212,10 @@ static int clear_entries(struct irq_2_iommu *irq_iommu)
 	bitmap_release_region(iommu->ir_table->bitmap, index,
 			      irq_iommu->irte_mask);
 
+#ifdef CONFIG_INTEL_IOMMU
 	if (iommu->pre_enabled_ir)
 		__iommu_update_old_irte(iommu, -1);
+#endif
 
 	return qi_flush_iec(iommu, index, irq_iommu->irte_mask);
 }
@@ -650,6 +654,7 @@ static int __init intel_enable_irq_remapping(void)
 	 * Setup Interrupt-remapping for all the DRHD's now.
 	 */
 	for_each_iommu(iommu, drhd) {
+#ifdef CONFIG_INTEL_IOMMU
 		if (iommu->pre_enabled_ir) {
 			unsigned long long q;
 
@@ -660,6 +665,7 @@ static int __init intel_enable_irq_remapping(void)
 				INTR_REMAP_TABLE_ENTRIES*sizeof(struct irte));
 			__iommu_load_old_irte(iommu);
 		} else
+#endif
 			iommu_set_irq_remapping(iommu, eim);
 
 		setup = true;
@@ -1374,6 +1380,7 @@ static int __iommu_update_old_irte(struct intel_iommu *iommu, int index)
 
 static void iommu_check_pre_ir_status(struct intel_iommu *iommu)
 {
+#ifdef CONFIG_INTEL_IOMMU
 	u32 sts;
 
 	sts = readl(iommu->reg + DMAR_GSTS_REG);
@@ -1381,4 +1388,5 @@ static void iommu_check_pre_ir_status(struct intel_iommu *iommu)
 		pr_info("IR is enabled prior to OS.\n");
 		iommu->pre_enabled_ir = 1;
 	}
+#endif
 }
-- 
2.1.4


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

* Re: [PATCH -next] iommu: Fix build failure without INTEL_IOMMU
  2015-06-04  8:07 [PATCH -next] iommu: Fix build failure without INTEL_IOMMU Daniel J Blueman
@ 2015-06-04  8:12 ` Jiang Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Jiang Liu @ 2015-06-04  8:12 UTC (permalink / raw)
  To: Daniel J Blueman; +Cc: Thomas Gleixner, Fenghua Yu, Steffen Persvold, LKML

Hi Daniel,
	Seems there's already a patch to fix this issue posted by Joerg
http://www.spinics.net/lists/kernel/msg2004510.html
Thanks!
Gerry

On 2015/6/4 16:07, Daniel J Blueman wrote:
> Fix Intel IOMMU build failure in linux-next when CONFIG_INTEL_IOMMU is not enabled.
> 
> Signed-off-by: Daniel J Blueman <daniel@numascale.com>
> ---
>  drivers/iommu/intel_irq_remapping.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
> index 24f7a35..ec337e7 100644
> --- a/drivers/iommu/intel_irq_remapping.c
> +++ b/drivers/iommu/intel_irq_remapping.c
> @@ -146,8 +146,10 @@ static int modify_irte(struct irq_2_iommu *irq_iommu,
>  	set_64bit(&irte->low, irte_modified->low);
>  	set_64bit(&irte->high, irte_modified->high);
>  
> +#ifdef CONFIG_INTEL_IOMMU
>  	if (iommu->pre_enabled_ir)
>  		__iommu_update_old_irte(iommu, index);
> +#endif
>  
>  	__iommu_flush_cache(iommu, irte, sizeof(*irte));
>  
> @@ -210,8 +212,10 @@ static int clear_entries(struct irq_2_iommu *irq_iommu)
>  	bitmap_release_region(iommu->ir_table->bitmap, index,
>  			      irq_iommu->irte_mask);
>  
> +#ifdef CONFIG_INTEL_IOMMU
>  	if (iommu->pre_enabled_ir)
>  		__iommu_update_old_irte(iommu, -1);
> +#endif
>  
>  	return qi_flush_iec(iommu, index, irq_iommu->irte_mask);
>  }
> @@ -650,6 +654,7 @@ static int __init intel_enable_irq_remapping(void)
>  	 * Setup Interrupt-remapping for all the DRHD's now.
>  	 */
>  	for_each_iommu(iommu, drhd) {
> +#ifdef CONFIG_INTEL_IOMMU
>  		if (iommu->pre_enabled_ir) {
>  			unsigned long long q;
>  
> @@ -660,6 +665,7 @@ static int __init intel_enable_irq_remapping(void)
>  				INTR_REMAP_TABLE_ENTRIES*sizeof(struct irte));
>  			__iommu_load_old_irte(iommu);
>  		} else
> +#endif
>  			iommu_set_irq_remapping(iommu, eim);
>  
>  		setup = true;
> @@ -1374,6 +1380,7 @@ static int __iommu_update_old_irte(struct intel_iommu *iommu, int index)
>  
>  static void iommu_check_pre_ir_status(struct intel_iommu *iommu)
>  {
> +#ifdef CONFIG_INTEL_IOMMU
>  	u32 sts;
>  
>  	sts = readl(iommu->reg + DMAR_GSTS_REG);
> @@ -1381,4 +1388,5 @@ static void iommu_check_pre_ir_status(struct intel_iommu *iommu)
>  		pr_info("IR is enabled prior to OS.\n");
>  		iommu->pre_enabled_ir = 1;
>  	}
> +#endif
>  }
> 

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

end of thread, other threads:[~2015-06-04  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-04  8:07 [PATCH -next] iommu: Fix build failure without INTEL_IOMMU Daniel J Blueman
2015-06-04  8:12 ` Jiang Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).