@@ -380,6 +380,18 @@ int xe_pxp_init(struct xe_device *xe)
380380 return 0 ;
381381 }
382382
383+ /*
384+ * On PTL, older GSC FWs have a bug that can cause them to crash during
385+ * PXP invalidation events, which leads to a complete loss of power
386+ * management on the media GT. Therefore, we can't use PXP on FWs that
387+ * have this bug, which was fixed in PTL GSC build 1396.
388+ */
389+ if (xe -> info .platform == XE_PANTHERLAKE &&
390+ gt -> uc .gsc .fw .versions .found [XE_UC_FW_VER_RELEASE ].build < 1396 ) {
391+ drm_info (& xe -> drm , "PXP requires PTL GSC build 1396 or newer\n" );
392+ return 0 ;
393+ }
394+
383395 pxp = drmm_kzalloc (& xe -> drm , sizeof (struct xe_pxp ), GFP_KERNEL );
384396 if (!pxp ) {
385397 err = - ENOMEM ;
@@ -512,7 +524,7 @@ static int __exec_queue_add(struct xe_pxp *pxp, struct xe_exec_queue *q)
512524static int pxp_start (struct xe_pxp * pxp , u8 type )
513525{
514526 int ret = 0 ;
515- bool restart = false ;
527+ bool restart ;
516528
517529 if (!xe_pxp_is_enabled (pxp ))
518530 return - ENODEV ;
@@ -541,6 +553,8 @@ static int pxp_start(struct xe_pxp *pxp, u8 type)
541553 msecs_to_jiffies (PXP_ACTIVATION_TIMEOUT_MS )))
542554 return - ETIMEDOUT ;
543555
556+ restart = false;
557+
544558 mutex_lock (& pxp -> mutex );
545559
546560 /* If PXP is not already active, turn it on */
@@ -583,6 +597,7 @@ static int pxp_start(struct xe_pxp *pxp, u8 type)
583597 drm_err (& pxp -> xe -> drm , "PXP termination failed before start\n" );
584598 mutex_lock (& pxp -> mutex );
585599 pxp -> status = XE_PXP_ERROR ;
600+ complete_all (& pxp -> termination );
586601
587602 goto out_unlock ;
588603 }
@@ -870,11 +885,6 @@ int xe_pxp_pm_suspend(struct xe_pxp *pxp)
870885 pxp -> key_instance ++ ;
871886 needs_queue_inval = true;
872887 break ;
873- default :
874- drm_err (& pxp -> xe -> drm , "unexpected state during PXP suspend: %u" ,
875- pxp -> status );
876- ret = - EIO ;
877- goto out ;
878888 }
879889
880890 /*
@@ -899,7 +909,6 @@ int xe_pxp_pm_suspend(struct xe_pxp *pxp)
899909
900910 pxp -> last_suspend_key_instance = pxp -> key_instance ;
901911
902- out :
903912 return ret ;
904913}
905914
0 commit comments