@@ -1469,6 +1469,19 @@ static void __reset_guc_busyness_stats(struct intel_guc *guc)
14691469 spin_unlock_irqrestore (& guc -> timestamp .lock , flags );
14701470}
14711471
1472+ static void __update_guc_busyness_running_state (struct intel_guc * guc )
1473+ {
1474+ struct intel_gt * gt = guc_to_gt (guc );
1475+ struct intel_engine_cs * engine ;
1476+ enum intel_engine_id id ;
1477+ unsigned long flags ;
1478+
1479+ spin_lock_irqsave (& guc -> timestamp .lock , flags );
1480+ for_each_engine (engine , gt , id )
1481+ engine -> stats .guc .running = false;
1482+ spin_unlock_irqrestore (& guc -> timestamp .lock , flags );
1483+ }
1484+
14721485static void __update_guc_busyness_stats (struct intel_guc * guc )
14731486{
14741487 struct intel_gt * gt = guc_to_gt (guc );
@@ -1619,6 +1632,9 @@ void intel_guc_busyness_park(struct intel_gt *gt)
16191632 if (!guc_submission_initialized (guc ))
16201633 return ;
16211634
1635+ /* Assume no engines are running and set running state to false */
1636+ __update_guc_busyness_running_state (guc );
1637+
16221638 /*
16231639 * There is a race with suspend flow where the worker runs after suspend
16241640 * and causes an unclaimed register access warning. Cancel the worker
@@ -5519,12 +5535,20 @@ static inline void guc_log_context(struct drm_printer *p,
55195535{
55205536 drm_printf (p , "GuC lrc descriptor %u:\n" , ce -> guc_id .id );
55215537 drm_printf (p , "\tHW Context Desc: 0x%08x\n" , ce -> lrc .lrca );
5522- drm_printf (p , "\t\tLRC Head: Internal %u, Memory %u\n" ,
5523- ce -> ring -> head ,
5524- ce -> lrc_reg_state [CTX_RING_HEAD ]);
5525- drm_printf (p , "\t\tLRC Tail: Internal %u, Memory %u\n" ,
5526- ce -> ring -> tail ,
5527- ce -> lrc_reg_state [CTX_RING_TAIL ]);
5538+ if (intel_context_pin_if_active (ce )) {
5539+ drm_printf (p , "\t\tLRC Head: Internal %u, Memory %u\n" ,
5540+ ce -> ring -> head ,
5541+ ce -> lrc_reg_state [CTX_RING_HEAD ]);
5542+ drm_printf (p , "\t\tLRC Tail: Internal %u, Memory %u\n" ,
5543+ ce -> ring -> tail ,
5544+ ce -> lrc_reg_state [CTX_RING_TAIL ]);
5545+ intel_context_unpin (ce );
5546+ } else {
5547+ drm_printf (p , "\t\tLRC Head: Internal %u, Memory not pinned\n" ,
5548+ ce -> ring -> head );
5549+ drm_printf (p , "\t\tLRC Tail: Internal %u, Memory not pinned\n" ,
5550+ ce -> ring -> tail );
5551+ }
55285552 drm_printf (p , "\t\tContext Pin Count: %u\n" ,
55295553 atomic_read (& ce -> pin_count ));
55305554 drm_printf (p , "\t\tGuC ID Ref Count: %u\n" ,
0 commit comments