diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/intel-iommu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 1fd8bb765702..66c0fd21894b 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -49,7 +49,7 @@ | |||
49 | 49 | ||
50 | #define DEFAULT_DOMAIN_ADDRESS_WIDTH 48 | 50 | #define DEFAULT_DOMAIN_ADDRESS_WIDTH 48 |
51 | 51 | ||
52 | #define DMAR_OPERATION_TIMEOUT (HZ*60) /* 1m */ | 52 | #define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000) /* 10sec */ |
53 | 53 | ||
54 | #define DOMAIN_MAX_ADDR(gaw) ((((u64)1) << gaw) - 1) | 54 | #define DOMAIN_MAX_ADDR(gaw) ((((u64)1) << gaw) - 1) |
55 | 55 | ||
@@ -490,12 +490,12 @@ static int iommu_alloc_root_entry(struct intel_iommu *iommu) | |||
490 | 490 | ||
491 | #define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \ | 491 | #define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \ |
492 | {\ | 492 | {\ |
493 | unsigned long start_time = jiffies;\ | 493 | cycles_t start_time = get_cycles();\ |
494 | while (1) {\ | 494 | while (1) {\ |
495 | sts = op (iommu->reg + offset);\ | 495 | sts = op (iommu->reg + offset);\ |
496 | if (cond)\ | 496 | if (cond)\ |
497 | break;\ | 497 | break;\ |
498 | if (time_after(jiffies, start_time + DMAR_OPERATION_TIMEOUT))\ | 498 | if (DMAR_OPERATION_TIMEOUT < (get_cycles() - start_time))\ |
499 | panic("DMAR hardware is malfunctioning\n");\ | 499 | panic("DMAR hardware is malfunctioning\n");\ |
500 | cpu_relax();\ | 500 | cpu_relax();\ |
501 | }\ | 501 | }\ |