]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/vt-d: Use INVALID response code instead of FAILURE
authorLu Baolu <baolu.lu@linux.intel.com>
Tue, 26 Jan 2021 08:07:30 +0000 (16:07 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 29 Jan 2021 08:25:24 +0000 (09:25 +0100)
commitecbafb891767c8e4e37c86a853f458cd3e94c49b
tree3e95c98bffb52b3989ea6d3393bf7089072926c8
parent0b8ed29d3f6617f930086764a4004ab22effceca
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 <ashok.raj@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20210126080730.2232859-3-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/svm.c