Skip to content

Commit bd5cdad

Browse files
Li, Zhen-Huajoergroedel
authored andcommitted
iommu/vt-d: dmar_fault should only clear PPF/PFO field.
When there is a dmar irq, dmar_fault is called and all of the fields in FSTS are cleared. But ICE/IQE/ITE should not be cleared here, they need to be processed and cleared in function qi_check_fault. [Minor cleanup by Joerg Roedel] Signed-off-by: Li, Zhen-Hua <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 8bb9660 commit bd5cdad

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/iommu/dmar.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ irqreturn_t dmar_fault(int irq, void *dev_id)
12041204

12051205
/* TBD: ignore advanced fault log currently */
12061206
if (!(fault_status & DMA_FSTS_PPF))
1207-
goto clear_rest;
1207+
goto unlock_exit;
12081208

12091209
fault_index = dma_fsts_fault_record_index(fault_status);
12101210
reg = cap_fault_reg_offset(iommu->cap);
@@ -1245,11 +1245,10 @@ irqreturn_t dmar_fault(int irq, void *dev_id)
12451245
fault_index = 0;
12461246
raw_spin_lock_irqsave(&iommu->register_lock, flag);
12471247
}
1248-
clear_rest:
1249-
/* clear all the other faults */
1250-
fault_status = readl(iommu->reg + DMAR_FSTS_REG);
1251-
writel(fault_status, iommu->reg + DMAR_FSTS_REG);
12521248

1249+
writel(DMA_FSTS_PFO | DMA_FSTS_PPF, iommu->reg + DMAR_FSTS_REG);
1250+
1251+
unlock_exit:
12531252
raw_spin_unlock_irqrestore(&iommu->register_lock, flag);
12541253
return IRQ_HANDLED;
12551254
}
@@ -1297,6 +1296,7 @@ int __init enable_drhd_fault_handling(void)
12971296
for_each_drhd_unit(drhd) {
12981297
int ret;
12991298
struct intel_iommu *iommu = drhd->iommu;
1299+
u32 fault_status;
13001300
ret = dmar_set_interrupt(iommu);
13011301

13021302
if (ret) {
@@ -1309,6 +1309,8 @@ int __init enable_drhd_fault_handling(void)
13091309
* Clear any previous faults.
13101310
*/
13111311
dmar_fault(iommu->irq, iommu);
1312+
fault_status = readl(iommu->reg + DMAR_FSTS_REG);
1313+
writel(fault_status, iommu->reg + DMAR_FSTS_REG);
13121314
}
13131315

13141316
return 0;

0 commit comments

Comments
 (0)