Xe PCI Error Handling¶
Xe driver registers PCI callbacks which are called by PCI core in case of bus errors or resets.
Currently both Function Level Reset (FLR) and bus error handling callbacks are supported. Both wipe the VRAM and resets the state of all the hardware units. Therefore, the contents of all exec queues and BOs in VRAM are lost, and the hardware needs a full re-initialization. The way Xe driver handles it, is pretty much similar to system suspend/resume flow with a few notable exceptions.
Prepare phase:
Temporarily wedge the device to prevent userspace access
Kill exec queues which signals the fences and frees in-flight jobs
Stop the scheduler and all submissions to GuC
The fact that FLR is needed is because hardware could be in corrupted state and access unreliable, so skip memory eviction due to untrustworthy VRAM contents
Remove all memory mappings since VRAM contents will be lost
Re-initialization phase:
Recreate kernel BOs due to skipped memory eviction in prepare phase
Restore kernel queues which were killed in prepare phase
Reload all uC firmwares
Bring up all hardware units
Unwedge the device to allow userspace access
Since VRAM contents are lost, the user is expected to recreate user memory and reload context.
TODO: Reuse FLR callbacks for bus error handling.
Current implementation is only limited to re-initializing GT. This needs to be extended for a lot of components listed below.
Proper re-initialization of GSC and PXP for integrated platforms
SR-IOV cases which need PF and VF synchronization
Re-initialization of all child devices registered by Xe
MM corner cases
Display