Skip to content

Commit fe89277

Browse files
Guanghui Fengjoergroedel
authored andcommitted
iommu/vt-d: Fix intel iommu iotlb sync hardlockup and retry
During the qi_check_fault process after an IOMMU ITE event, requests at odd-numbered positions in the queue are set to QI_ABORT, only satisfying single-request submissions. However, qi_submit_sync now supports multiple simultaneous submissions, and can't guarantee that the wait_desc will be at an odd-numbered position. Therefore, if an item times out, IOMMU can't re-initiate the request, resulting in an infinite polling wait. This modifies the process by setting the status of all requests already fetched by IOMMU and recorded as QI_IN_USE status (including wait_desc requests) to QI_ABORT, thus enabling multiple requests to be resubmitted. Fixes: 8a1d824 ("iommu/vt-d: Multiple descriptors per qi_submit_sync()") Cc: stable@vger.kernel.org Signed-off-by: Guanghui Feng <guanghuifeng@linux.alibaba.com> Tested-by: Shuai Xue <xueshuai@linux.alibaba.com> Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com> Reviewed-by: Samiullah Khawaja <skhawaja@google.com> Link: https://lore.kernel.org/r/20260306101516.3885775-1-guanghuifeng@linux.alibaba.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Fixes: 8a1d824 ("iommu/vt-d: Multiple descriptors per qi_submit_sync()") Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
1 parent f338e77 commit fe89277

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/iommu/intel/dmar.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,6 @@ static int qi_check_fault(struct intel_iommu *iommu, int index, int wait_index)
13141314
if (fault & DMA_FSTS_ITE) {
13151315
head = readl(iommu->reg + DMAR_IQH_REG);
13161316
head = ((head >> shift) - 1 + QI_LENGTH) % QI_LENGTH;
1317-
head |= 1;
13181317
tail = readl(iommu->reg + DMAR_IQT_REG);
13191318
tail = ((tail >> shift) - 1 + QI_LENGTH) % QI_LENGTH;
13201319

@@ -1331,7 +1330,7 @@ static int qi_check_fault(struct intel_iommu *iommu, int index, int wait_index)
13311330
do {
13321331
if (qi->desc_status[head] == QI_IN_USE)
13331332
qi->desc_status[head] = QI_ABORT;
1334-
head = (head - 2 + QI_LENGTH) % QI_LENGTH;
1333+
head = (head - 1 + QI_LENGTH) % QI_LENGTH;
13351334
} while (head != tail);
13361335

13371336
/*

0 commit comments

Comments
 (0)