mirror of
https://github.com/UniXNU/NativeAdreno.git
synced 2026-11-19 14:04:21 +03:00
fix(recovery): a GPU access fault no longer fails other address spaces
An address space's check of the SMMU returned the fault status while the GPU's own faulting access was still latched, and the address space that happened to map, unmap or attach next was taken out of use: seven processes in one run, the render server among them. The status says nothing about that address space's tables, so the operation now goes on and the fault is counted. The hang check ends the fault, and also clears the SMMU's global fault status where it is set. A stalled job's command buffers are searched for the IB2 address the thread stopped in, to tell an address the job's commands named from one they did not.
This commit is contained in:
@@ -193,11 +193,20 @@ IOReturn NativeAdrenoGpuContext::clearFault(uint32_t fsr,uint32_t far[3])
|
||||
if(io->write32(io->cookie,(size_t)offset+0x58,fsr) || io->barrier(io->cookie))return kIOReturnIOError;
|
||||
return kIOReturnSuccess;
|
||||
}
|
||||
extern "C" {extern volatile uint32_t native_adreno_global_fault[4];}
|
||||
IOReturn NativeAdrenoGpuContext::endFault(uint32_t out[4])
|
||||
{
|
||||
if(!out || !ready_)return kIOReturnBadArgument;
|
||||
out[0]=out[1]=out[2]=out[3]=0;
|
||||
const ArmSmmu4KIo *io=smmu_.ioHandle();
|
||||
{ /* The global fault status the GPU's faulting access left (sGFSR, write one to clear): cleared with the context's, or every
|
||||
* later look at the SMMU reads it. Its last value is kept. */
|
||||
uint32_t global=0;
|
||||
if(!io->read32(io->cookie,0x48,&global) && global) {
|
||||
native_adreno_global_fault[2]=native_adreno_global_fault[2]+1;native_adreno_global_fault[3]=global;
|
||||
(void)io->write32(io->cookie,0x48,global);
|
||||
}
|
||||
}
|
||||
const uint64_t offset=smmu_.stateHandle()->context_offset;
|
||||
if(!offset)return kIOReturnNotReady;
|
||||
if(io->read32(io->cookie,(size_t)offset+0x58,&out[0]))return kIOReturnIOError;
|
||||
|
||||
Reference in New Issue
Block a user