aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/intr_remapping.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2009-05-10 15:30:58 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-05-10 15:32:37 -0400
commitc416daa98a584596df21ee2c26fac6579ee58f57 (patch)
tree161a5aaf1e63a14ce8895046139c2ce695b89531 /drivers/pci/intr_remapping.c
parent462b60f6ccc685f7e8aa04ff430e6b4ffedf629f (diff)
intel-iommu: Tidy up iommu->gcmd handling
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci/intr_remapping.c')
-rw-r--r--drivers/pci/intr_remapping.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index f5e0ea724a6..16695961408 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -404,7 +404,7 @@ int free_irte(int irq)
404static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode) 404static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
405{ 405{
406 u64 addr; 406 u64 addr;
407 u32 cmd, sts; 407 u32 sts;
408 unsigned long flags; 408 unsigned long flags;
409 409
410 addr = virt_to_phys((void *)iommu->ir_table->base); 410 addr = virt_to_phys((void *)iommu->ir_table->base);
@@ -415,9 +415,8 @@ static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
415 (addr) | IR_X2APIC_MODE(mode) | INTR_REMAP_TABLE_REG_SIZE); 415 (addr) | IR_X2APIC_MODE(mode) | INTR_REMAP_TABLE_REG_SIZE);
416 416
417 /* Set interrupt-remapping table pointer */ 417 /* Set interrupt-remapping table pointer */
418 cmd = iommu->gcmd | DMA_GCMD_SIRTP;
419 iommu->gcmd |= DMA_GCMD_SIRTP; 418 iommu->gcmd |= DMA_GCMD_SIRTP;
420 writel(cmd, iommu->reg + DMAR_GCMD_REG); 419 writel(iommu->gcmd, iommu->reg + DMAR_GCMD_REG);
421 420
422 IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG, 421 IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG,
423 readl, (sts & DMA_GSTS_IRTPS), sts); 422 readl, (sts & DMA_GSTS_IRTPS), sts);
@@ -427,9 +426,8 @@ static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
427 spin_lock_irqsave(&iommu->register_lock, flags); 426 spin_lock_irqsave(&iommu->register_lock, flags);
428 427
429 /* enable comaptiblity format interrupt pass through */ 428 /* enable comaptiblity format interrupt pass through */
430 cmd = iommu->gcmd | DMA_GCMD_CFI;
431 iommu->gcmd |= DMA_GCMD_CFI; 429 iommu->gcmd |= DMA_GCMD_CFI;
432 writel(cmd, iommu->reg + DMAR_GCMD_REG); 430 writel(iommu->gcmd, iommu->reg + DMAR_GCMD_REG);
433 431
434 IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG, 432 IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG,
435 readl, (sts & DMA_GSTS_CFIS), sts); 433 readl, (sts & DMA_GSTS_CFIS), sts);
@@ -446,9 +444,8 @@ static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
446 spin_lock_irqsave(&iommu->register_lock, flags); 444 spin_lock_irqsave(&iommu->register_lock, flags);
447 445
448 /* Enable interrupt-remapping */ 446 /* Enable interrupt-remapping */
449 cmd = iommu->gcmd | DMA_GCMD_IRE;
450 iommu->gcmd |= DMA_GCMD_IRE; 447 iommu->gcmd |= DMA_GCMD_IRE;
451 writel(cmd, iommu->reg + DMAR_GCMD_REG); 448 writel(iommu->gcmd, iommu->reg + DMAR_GCMD_REG);
452 449
453 IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG, 450 IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG,
454 readl, (sts & DMA_GSTS_IRES), sts); 451 readl, (sts & DMA_GSTS_IRES), sts);