Skip to content

Commit 3aa7c62

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Use INVALID response code instead of FAILURE
The VT-d IOMMU response RESPONSE_FAILURE for a page request in below cases: - When it gets a Page_Request with no PASID; - When it gets a Page_Request with PASID that is not in use for this device. This is allowed by the spec, but IOMMU driver doesn't support such cases today. When the device receives RESPONSE_FAILURE, it sends the device state machine to HALT state. Now if we try to unload the driver, it hangs since the device doesn't send any outbound transactions to host when the driver is trying to clear things up. The only possible responses would be for invalidation requests. Let's use RESPONSE_INVALID instead for now, so that the device state machine doesn't enter HALT state. Suggested-by: Ashok Raj <[email protected]> Signed-off-by: Lu Baolu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 28a7718 commit 3aa7c62

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/iommu/intel/svm.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -911,10 +911,8 @@ static irqreturn_t prq_event_thread(int irq, void *d)
911911
u64 address;
912912

913913
handled = 1;
914-
915914
req = &iommu->prq[head / sizeof(*req)];
916-
917-
result = QI_RESP_FAILURE;
915+
result = QI_RESP_INVALID;
918916
address = (u64)req->addr << VTD_PAGE_SHIFT;
919917
if (!req->pasid_present) {
920918
pr_err("%s: Page request without PASID: %08llx %08llx\n",
@@ -952,7 +950,6 @@ static irqreturn_t prq_event_thread(int irq, void *d)
952950
rcu_read_unlock();
953951
}
954952

955-
result = QI_RESP_INVALID;
956953
/* Since we're using init_mm.pgd directly, we should never take
957954
* any faults on kernel addresses. */
958955
if (!svm->mm)

0 commit comments

Comments
 (0)