@@ -1584,11 +1584,8 @@ static u32 __cs_pending_mi_force_wakes(struct intel_engine_cs *engine)
15841584 };
15851585 u32 val ;
15861586
1587- if (!_reg [engine -> id ].reg ) {
1588- drm_err (& engine -> i915 -> drm ,
1589- "MSG IDLE undefined for engine id %u\n" , engine -> id );
1587+ if (!_reg [engine -> id ].reg )
15901588 return 0 ;
1591- }
15921589
15931590 val = intel_uncore_read (engine -> uncore , _reg [engine -> id ]);
15941591
@@ -2114,17 +2111,6 @@ static void print_request_ring(struct drm_printer *m, struct i915_request *rq)
21142111 }
21152112}
21162113
2117- static unsigned long list_count (struct list_head * list )
2118- {
2119- struct list_head * pos ;
2120- unsigned long count = 0 ;
2121-
2122- list_for_each (pos , list )
2123- count ++ ;
2124-
2125- return count ;
2126- }
2127-
21282114static unsigned long read_ul (void * p , size_t x )
21292115{
21302116 return * (unsigned long * )(p + x );
@@ -2216,11 +2202,11 @@ void intel_engine_dump_active_requests(struct list_head *requests,
22162202 }
22172203}
22182204
2219- static void engine_dump_active_requests (struct intel_engine_cs * engine , struct drm_printer * m )
2205+ static void engine_dump_active_requests (struct intel_engine_cs * engine ,
2206+ struct drm_printer * m )
22202207{
2208+ struct intel_context * hung_ce = NULL ;
22212209 struct i915_request * hung_rq = NULL ;
2222- struct intel_context * ce ;
2223- bool guc ;
22242210
22252211 /*
22262212 * No need for an engine->irq_seqno_barrier() before the seqno reads.
@@ -2229,27 +2215,22 @@ static void engine_dump_active_requests(struct intel_engine_cs *engine, struct d
22292215 * But the intention here is just to report an instantaneous snapshot
22302216 * so that's fine.
22312217 */
2232- lockdep_assert_held ( & engine -> sched_engine -> lock );
2218+ intel_engine_get_hung_entity ( engine , & hung_ce , & hung_rq );
22332219
22342220 drm_printf (m , "\tRequests:\n" );
22352221
2236- guc = intel_uc_uses_guc_submission (& engine -> gt -> uc );
2237- if (guc ) {
2238- ce = intel_engine_get_hung_context (engine );
2239- if (ce )
2240- hung_rq = intel_context_find_active_request (ce );
2241- } else {
2242- hung_rq = intel_engine_execlist_find_hung_request (engine );
2243- }
2244-
22452222 if (hung_rq )
22462223 engine_dump_request (hung_rq , m , "\t\thung" );
2224+ else if (hung_ce )
2225+ drm_printf (m , "\t\tGot hung ce but no hung rq!\n" );
22472226
2248- if (guc )
2227+ if (intel_uc_uses_guc_submission ( & engine -> gt -> uc ) )
22492228 intel_guc_dump_active_requests (engine , hung_rq , m );
22502229 else
2251- intel_engine_dump_active_requests (& engine -> sched_engine -> requests ,
2252- hung_rq , m );
2230+ intel_execlists_dump_active_requests (engine , hung_rq , m );
2231+
2232+ if (hung_rq )
2233+ i915_request_put (hung_rq );
22532234}
22542235
22552236void intel_engine_dump (struct intel_engine_cs * engine ,
@@ -2259,7 +2240,6 @@ void intel_engine_dump(struct intel_engine_cs *engine,
22592240 struct i915_gpu_error * const error = & engine -> i915 -> gpu_error ;
22602241 struct i915_request * rq ;
22612242 intel_wakeref_t wakeref ;
2262- unsigned long flags ;
22632243 ktime_t dummy ;
22642244
22652245 if (header ) {
@@ -2296,13 +2276,8 @@ void intel_engine_dump(struct intel_engine_cs *engine,
22962276 i915_reset_count (error ));
22972277 print_properties (engine , m );
22982278
2299- spin_lock_irqsave (& engine -> sched_engine -> lock , flags );
23002279 engine_dump_active_requests (engine , m );
23012280
2302- drm_printf (m , "\tOn hold?: %lu\n" ,
2303- list_count (& engine -> sched_engine -> hold ));
2304- spin_unlock_irqrestore (& engine -> sched_engine -> lock , flags );
2305-
23062281 drm_printf (m , "\tMMIO base: 0x%08x\n" , engine -> mmio_base );
23072282 wakeref = intel_runtime_pm_get_if_in_use (engine -> uncore -> rpm );
23082283 if (wakeref ) {
@@ -2348,8 +2323,7 @@ intel_engine_create_virtual(struct intel_engine_cs **siblings,
23482323 return siblings [0 ]-> cops -> create_virtual (siblings , count , flags );
23492324}
23502325
2351- struct i915_request *
2352- intel_engine_execlist_find_hung_request (struct intel_engine_cs * engine )
2326+ static struct i915_request * engine_execlist_find_hung_request (struct intel_engine_cs * engine )
23532327{
23542328 struct i915_request * request , * active = NULL ;
23552329
@@ -2401,6 +2375,33 @@ intel_engine_execlist_find_hung_request(struct intel_engine_cs *engine)
24012375 return active ;
24022376}
24032377
2378+ void intel_engine_get_hung_entity (struct intel_engine_cs * engine ,
2379+ struct intel_context * * ce , struct i915_request * * rq )
2380+ {
2381+ unsigned long flags ;
2382+
2383+ * ce = intel_engine_get_hung_context (engine );
2384+ if (* ce ) {
2385+ intel_engine_clear_hung_context (engine );
2386+
2387+ * rq = intel_context_get_active_request (* ce );
2388+ return ;
2389+ }
2390+
2391+ /*
2392+ * Getting here with GuC enabled means it is a forced error capture
2393+ * with no actual hang. So, no need to attempt the execlist search.
2394+ */
2395+ if (intel_uc_uses_guc_submission (& engine -> gt -> uc ))
2396+ return ;
2397+
2398+ spin_lock_irqsave (& engine -> sched_engine -> lock , flags );
2399+ * rq = engine_execlist_find_hung_request (engine );
2400+ if (* rq )
2401+ * rq = i915_request_get_rcu (* rq );
2402+ spin_unlock_irqrestore (& engine -> sched_engine -> lock , flags );
2403+ }
2404+
24042405void xehp_enable_ccs_engines (struct intel_engine_cs * engine )
24052406{
24062407 /*
0 commit comments