hv: vtd: fix potential dead loop if qi request timeout
Fix potential dead loop if qi request timeout. Tracked-On: #4680 Signed-off-by: Binbin Wu <binbin.wu@intel.com>
This commit is contained in:
parent
764d7c1332
commit
65ec6f3f3b
|
@ -547,7 +547,7 @@ static void dmar_issue_qi_request(struct dmar_drhd_rt *dmar_unit, struct dmar_en
|
||||||
{
|
{
|
||||||
struct dmar_entry *invalidate_desc_ptr;
|
struct dmar_entry *invalidate_desc_ptr;
|
||||||
uint32_t qi_status = 0U;
|
uint32_t qi_status = 0U;
|
||||||
__unused uint64_t start;
|
uint64_t start;
|
||||||
|
|
||||||
invalidate_desc_ptr = (struct dmar_entry *)(dmar_unit->qi_queue + dmar_unit->qi_tail);
|
invalidate_desc_ptr = (struct dmar_entry *)(dmar_unit->qi_queue + dmar_unit->qi_tail);
|
||||||
|
|
||||||
|
@ -565,12 +565,10 @@ static void dmar_issue_qi_request(struct dmar_drhd_rt *dmar_unit, struct dmar_en
|
||||||
iommu_write32(dmar_unit, DMAR_IQT_REG, dmar_unit->qi_tail);
|
iommu_write32(dmar_unit, DMAR_IQT_REG, dmar_unit->qi_tail);
|
||||||
|
|
||||||
start = rdtsc();
|
start = rdtsc();
|
||||||
while (qi_status == DMAR_INV_STATUS_INCOMPLETE) {
|
while (qi_status != DMAR_INV_STATUS_COMPLETED) {
|
||||||
if (qi_status == DMAR_INV_STATUS_COMPLETED) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if ((rdtsc() - start) > CYCLES_PER_MS) {
|
if ((rdtsc() - start) > CYCLES_PER_MS) {
|
||||||
pr_err("DMAR OP Timeout! @ %s", __func__);
|
pr_err("DMAR OP Timeout! @ %s", __func__);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
asm_pause();
|
asm_pause();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue