aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2011-04-06 11:46:49 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2011-04-07 04:46:05 -0400
commit61985a040f17c03b09a2772508ee02729571365b (patch)
tree6376a0de799362ec581b631f4dfa420c7cb72159
parent815b33fdc279d34ab40a8bfe1866623a4cc5669b (diff)
x86/amd-iommu: Remove command buffer resetting logic
The logic to reset the command buffer caused more problems than it actually helped. The logic jumped in when the IOMMU hardware doesn't execute commands anymore but the reasons for this are usually not fixed by just resetting the command buffer. So the code can be removed to reduce complexity. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
-rw-r--r--arch/x86/include/asm/amd_iommu_types.h3
-rw-r--r--arch/x86/kernel/amd_iommu.c20
2 files changed, 1 insertions, 22 deletions
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h
index e3509fc303bf..878ae008eb04 100644
--- a/arch/x86/include/asm/amd_iommu_types.h
+++ b/arch/x86/include/asm/amd_iommu_types.h
@@ -409,9 +409,6 @@ struct amd_iommu {
409 /* if one, we need to send a completion wait command */ 409 /* if one, we need to send a completion wait command */
410 bool need_sync; 410 bool need_sync;
411 411
412 /* becomes true if a command buffer reset is running */
413 bool reset_in_progress;
414
415 /* default dma_ops domain for that IOMMU */ 412 /* default dma_ops domain for that IOMMU */
416 struct dma_ops_domain *default_dom; 413 struct dma_ops_domain *default_dom;
417 414
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 073c64b1994b..0147c5c87aa8 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -58,7 +58,6 @@ struct iommu_cmd {
58 u32 data[4]; 58 u32 data[4];
59}; 59};
60 60
61static void reset_iommu_command_buffer(struct amd_iommu *iommu);
62static void update_domain(struct protection_domain *domain); 61static void update_domain(struct protection_domain *domain);
63 62
64/**************************************************************************** 63/****************************************************************************
@@ -323,8 +322,6 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
323 break; 322 break;
324 case EVENT_TYPE_ILL_CMD: 323 case EVENT_TYPE_ILL_CMD:
325 printk("ILLEGAL_COMMAND_ERROR address=0x%016llx]\n", address); 324 printk("ILLEGAL_COMMAND_ERROR address=0x%016llx]\n", address);
326 iommu->reset_in_progress = true;
327 reset_iommu_command_buffer(iommu);
328 dump_command(address); 325 dump_command(address);
329 break; 326 break;
330 case EVENT_TYPE_CMD_HARD_ERR: 327 case EVENT_TYPE_CMD_HARD_ERR:
@@ -485,8 +482,7 @@ static int iommu_completion_wait(struct amd_iommu *iommu)
485 482
486 if (i == LOOP_TIMEOUT) { 483 if (i == LOOP_TIMEOUT) {
487 pr_alert("AMD-Vi: Completion-Wait loop timed out\n"); 484 pr_alert("AMD-Vi: Completion-Wait loop timed out\n");
488 iommu->reset_in_progress = true; 485 ret = -EIO;
489 reset_iommu_command_buffer(iommu);
490 } 486 }
491 487
492 return 0; 488 return 0;
@@ -628,20 +624,6 @@ void amd_iommu_flush_all_domains(void)
628 spin_unlock_irqrestore(&amd_iommu_pd_lock, flags); 624 spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
629} 625}
630 626
631static void reset_iommu_command_buffer(struct amd_iommu *iommu)
632{
633 pr_err("AMD-Vi: Resetting IOMMU command buffer\n");
634
635 if (iommu->reset_in_progress)
636 panic("AMD-Vi: ILLEGAL_COMMAND_ERROR while resetting command buffer\n");
637
638 amd_iommu_reset_cmd_buffer(iommu);
639 amd_iommu_flush_all_devices();
640 amd_iommu_flush_all_domains();
641
642 iommu->reset_in_progress = false;
643}
644
645/**************************************************************************** 627/****************************************************************************
646 * 628 *
647 * The functions below are used the create the page table mappings for 629 * The functions below are used the create the page table mappings for