[PATCH 1/2] iommu/vt-d: Rename fault IRQ variable
From: Jacob Pan
Date: Wed Apr 03 2024 - 19:41:31 EST
Originally, DMAR fault IRQ was the only source of interrupts for VT-d
itself, thus simply named 'irq'. Newer interrupt sources were added later
for page requests and perfmon with proper names, i.e. pr_irq and perf_irq.
Rename the fault IRQ to reflect its usage. This avoids confusion when
programming MSI messages for the three possible sources.
Signed-off-by: Jacob Pan <jacob.jun.pan@xxxxxxxxxxxxxxx>
---
drivers/iommu/intel/dmar.c | 16 ++++++++--------
drivers/iommu/intel/iommu.h | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index 36d7427b1202..ab325af93f71 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -1175,15 +1175,15 @@ static void free_iommu(struct intel_iommu *iommu)
free_iommu_pmu(iommu);
- if (iommu->irq) {
+ if (iommu->fault_irq) {
if (iommu->pr_irq) {
free_irq(iommu->pr_irq, iommu);
dmar_free_hwirq(iommu->pr_irq);
iommu->pr_irq = 0;
}
- free_irq(iommu->irq, iommu);
- dmar_free_hwirq(iommu->irq);
- iommu->irq = 0;
+ free_irq(iommu->fault_irq, iommu);
+ dmar_free_hwirq(iommu->fault_irq);
+ iommu->fault_irq = 0;
}
if (iommu->qi) {
@@ -1918,7 +1918,7 @@ static const char *dmar_get_fault_reason(u8 fault_reason, int *fault_type)
static inline int dmar_msi_reg(struct intel_iommu *iommu, int irq)
{
- if (iommu->irq == irq)
+ if (iommu->fault_irq == irq)
return DMAR_FECTL_REG;
else if (iommu->pr_irq == irq)
return DMAR_PECTL_REG;
@@ -2105,12 +2105,12 @@ int dmar_set_interrupt(struct intel_iommu *iommu)
/*
* Check if the fault interrupt is already initialized.
*/
- if (iommu->irq)
+ if (iommu->fault_irq)
return 0;
irq = dmar_alloc_hwirq(iommu->seq_id, iommu->node, iommu);
if (irq > 0) {
- iommu->irq = irq;
+ iommu->fault_irq = irq;
} else {
pr_err("No free IRQ vectors\n");
return -EINVAL;
@@ -2143,7 +2143,7 @@ int __init enable_drhd_fault_handling(void)
/*
* Clear any previous faults.
*/
- dmar_fault(iommu->irq, iommu);
+ dmar_fault(iommu->fault_irq, iommu);
fault_status = readl(iommu->reg + DMAR_FSTS_REG);
writel(fault_status, iommu->reg + DMAR_FSTS_REG);
}
diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h
index 404d2476a877..deebd4817d27 100644
--- a/drivers/iommu/intel/iommu.h
+++ b/drivers/iommu/intel/iommu.h
@@ -699,7 +699,7 @@ struct intel_iommu {
int seq_id; /* sequence id of the iommu */
int agaw; /* agaw of this iommu */
int msagaw; /* max sagaw of this iommu */
- unsigned int irq, pr_irq, perf_irq;
+ unsigned int fault_irq, pr_irq, perf_irq;
u16 segment; /* PCI segment# */
unsigned char name[13]; /* Device Name */
--
2.25.1