diff mbox series

[1/2] drm/xe: Add missing runtime reference to wedged upon gt_reset

Message ID 20240830183507.298351-1-rodrigo.vivi@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/xe: Add missing runtime reference to wedged upon gt_reset | expand

Commit Message

Rodrigo Vivi Aug. 30, 2024, 6:35 p.m. UTC
Fixes this missed case:

xe 0000:00:02.0: [drm] Missing outer runtime PM protection
WARNING: CPU: 99 PID: 1455 at drivers/gpu/drm/xe/xe_pm.c:564 xe_pm_runtime_get_noresume+0x48/0x60 [xe]
Call Trace:
<TASK>
? show_regs+0x67/0x70
? __warn+0x94/0x1b0
? xe_pm_runtime_get_noresume+0x48/0x60 [xe]
? report_bug+0x1b7/0x1d0
? handle_bug+0x46/0x80
? exc_invalid_op+0x19/0x70
? asm_exc_invalid_op+0x1b/0x20
? xe_pm_runtime_get_noresume+0x48/0x60 [xe]
xe_device_declare_wedged+0x91/0x280 [xe]
gt_reset_worker+0xa2/0x250 [xe]

v2: Also move get and get the right Fixes tag (Himal, Brost)

Fixes: fb74b205cdd2 ("drm/xe: Introduce a simple wedged state")
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_gt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Cavitt, Jonathan Aug. 30, 2024, 7:20 p.m. UTC | #1
-----Original Message-----
From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Rodrigo Vivi
Sent: Friday, August 30, 2024 11:35 AM
To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
Cc: Vivi, Rodrigo <rodrigo.vivi@intel.com>; Ghimiray, Himal Prasad <himal.prasad.ghimiray@intel.com>; Brost, Matthew <matthew.brost@intel.com>
Subject: [PATCH 1/2] drm/xe: Add missing runtime reference to wedged upon gt_reset
> 
> Fixes this missed case:
> 
> xe 0000:00:02.0: [drm] Missing outer runtime PM protection
> WARNING: CPU: 99 PID: 1455 at drivers/gpu/drm/xe/xe_pm.c:564 xe_pm_runtime_get_noresume+0x48/0x60 [xe]
> Call Trace:
> <TASK>
> ? show_regs+0x67/0x70
> ? __warn+0x94/0x1b0
> ? xe_pm_runtime_get_noresume+0x48/0x60 [xe]
> ? report_bug+0x1b7/0x1d0
> ? handle_bug+0x46/0x80
> ? exc_invalid_op+0x19/0x70
> ? asm_exc_invalid_op+0x1b/0x20
> ? xe_pm_runtime_get_noresume+0x48/0x60 [xe]
> xe_device_declare_wedged+0x91/0x280 [xe]
> gt_reset_worker+0xa2/0x250 [xe]
> 
> v2: Also move get and get the right Fixes tag (Himal, Brost)
> 
> Fixes: fb74b205cdd2 ("drm/xe: Introduce a simple wedged state")
> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

LGTM.
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
-Jonathan Cavitt

> ---
>  drivers/gpu/drm/xe/xe_gt.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index f82b3e8ac5c8..dd96dec95b19 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -754,12 +754,13 @@ static int gt_reset(struct xe_gt *gt)
>  
>  	xe_gt_info(gt, "reset started\n");
>  
> +	xe_pm_runtime_get(gt_to_xe(gt));
> +
>  	if (xe_fault_inject_gt_reset()) {
>  		err = -ECANCELED;
>  		goto err_fail;
>  	}
>  
> -	xe_pm_runtime_get(gt_to_xe(gt));
>  	xe_gt_sanitize(gt);
>  
>  	err = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
> @@ -794,11 +795,11 @@ static int gt_reset(struct xe_gt *gt)
>  	XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
>  err_msg:
>  	XE_WARN_ON(xe_uc_start(&gt->uc));
> -	xe_pm_runtime_put(gt_to_xe(gt));
>  err_fail:
>  	xe_gt_err(gt, "reset failed (%pe)\n", ERR_PTR(err));
>  
>  	xe_device_declare_wedged(gt_to_xe(gt));
> +	xe_pm_runtime_put(gt_to_xe(gt));
>  
>  	return err;
>  }
> -- 
> 2.46.0
> 
>
Ghimiray, Himal Prasad Aug. 31, 2024, 4:02 p.m. UTC | #2
On 31-08-2024 00:05, Rodrigo Vivi wrote:
> Fixes this missed case:
> 
> xe 0000:00:02.0: [drm] Missing outer runtime PM protection
> WARNING: CPU: 99 PID: 1455 at drivers/gpu/drm/xe/xe_pm.c:564 xe_pm_runtime_get_noresume+0x48/0x60 [xe]
> Call Trace:
> <TASK>
> ? show_regs+0x67/0x70
> ? __warn+0x94/0x1b0
> ? xe_pm_runtime_get_noresume+0x48/0x60 [xe]
> ? report_bug+0x1b7/0x1d0
> ? handle_bug+0x46/0x80
> ? exc_invalid_op+0x19/0x70
> ? asm_exc_invalid_op+0x1b/0x20
> ? xe_pm_runtime_get_noresume+0x48/0x60 [xe]
> xe_device_declare_wedged+0x91/0x280 [xe]
> gt_reset_worker+0xa2/0x250 [xe]
> 
> v2: Also move get and get the right Fixes tag (Himal, Brost)
> 
> Fixes: fb74b205cdd2 ("drm/xe: Introduce a simple wedged state")
> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>

LGTM
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>

> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_gt.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index f82b3e8ac5c8..dd96dec95b19 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -754,12 +754,13 @@ static int gt_reset(struct xe_gt *gt)
>   
>   	xe_gt_info(gt, "reset started\n");
>   
> +	xe_pm_runtime_get(gt_to_xe(gt));
> +
>   	if (xe_fault_inject_gt_reset()) {
>   		err = -ECANCELED;
>   		goto err_fail;
>   	}
>   
> -	xe_pm_runtime_get(gt_to_xe(gt));
>   	xe_gt_sanitize(gt);
>   
>   	err = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
> @@ -794,11 +795,11 @@ static int gt_reset(struct xe_gt *gt)
>   	XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
>   err_msg:
>   	XE_WARN_ON(xe_uc_start(&gt->uc));
> -	xe_pm_runtime_put(gt_to_xe(gt));
>   err_fail:
>   	xe_gt_err(gt, "reset failed (%pe)\n", ERR_PTR(err));
>   
>   	xe_device_declare_wedged(gt_to_xe(gt));
> +	xe_pm_runtime_put(gt_to_xe(gt));
>   
>   	return err;
>   }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index f82b3e8ac5c8..dd96dec95b19 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -754,12 +754,13 @@  static int gt_reset(struct xe_gt *gt)
 
 	xe_gt_info(gt, "reset started\n");
 
+	xe_pm_runtime_get(gt_to_xe(gt));
+
 	if (xe_fault_inject_gt_reset()) {
 		err = -ECANCELED;
 		goto err_fail;
 	}
 
-	xe_pm_runtime_get(gt_to_xe(gt));
 	xe_gt_sanitize(gt);
 
 	err = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
@@ -794,11 +795,11 @@  static int gt_reset(struct xe_gt *gt)
 	XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
 err_msg:
 	XE_WARN_ON(xe_uc_start(&gt->uc));
-	xe_pm_runtime_put(gt_to_xe(gt));
 err_fail:
 	xe_gt_err(gt, "reset failed (%pe)\n", ERR_PTR(err));
 
 	xe_device_declare_wedged(gt_to_xe(gt));
+	xe_pm_runtime_put(gt_to_xe(gt));
 
 	return err;
 }