File tree Expand file tree Collapse file tree
src/common/unix/nvidia-push/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -347,6 +347,7 @@ static NvBool nvWriteGpEntry(
347347
348348 NvU32 nextGpPut ;
349349 NvU32 * gpPointer ;
350+ NvU64 baseTime , currentTime ;
350351 const NvU32 entriesNeeded = NV_PUSH_NUM_GPFIFO_ENTRIES_PER_KICKOFF ;
351352 NvPushDevicePtr pDevice = push_buffer -> pDevice ;
352353
@@ -359,11 +360,21 @@ static NvBool nvWriteGpEntry(
359360 nvAssert ((nextGpPut % 2 ) == 0 );
360361
361362 // Wait for a free entry in the buffer
362- while (nextGpPut == ReadGpGetOffset (push_buffer )) {
363+ for (baseTime = currentTime = nvPushImportGetMilliSeconds (pDevice );
364+ nextGpPut == ReadGpGetOffset (push_buffer );
365+ currentTime = nvPushImportGetMilliSeconds (pDevice )) {
366+
363367 if (nvPushCheckChannelError (push_buffer )) {
364368 nvAssert (!"A channel error occurred in nvWriteGpEntry()" );
365369 return FALSE;
366370 }
371+
372+ if (currentTime > (baseTime + NV_PUSH_NOTIFIER_SHORT_TIMEOUT ) &&
373+ !push_buffer -> noTimeout ) {
374+ nvPushImportLogError (pDevice ,
375+ "Timed out waiting for a free GPFIFO entry." );
376+ return FALSE;
377+ }
367378 }
368379 gpPointer [0 ] = gpEntry0 ;
369380 gpPointer [1 ] = gpEntry1 ;
You can’t perform that action at this time.
0 commit comments