[PATCH] drm/xe/gsc: Check for possible err in forcewake GT

Daniele Ceraolo Spurio daniele.ceraolospurio at intel.com
Tue Mar 12 16:04:05 UTC 2024



On 3/12/2024 7:24 AM, Tejas Upadhyay wrote:
> GT Forcewake can fail, check for success before
> moving forward
>
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_gsc.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gsc.c b/drivers/gpu/drm/xe/xe_gsc.c
> index d9aa815a5bc2..a5ee1b39f4a7 100644
> --- a/drivers/gpu/drm/xe/xe_gsc.c
> +++ b/drivers/gpu/drm/xe/xe_gsc.c
> @@ -287,7 +287,11 @@ static void gsc_work(struct work_struct *work)
>   	spin_unlock_irq(&gsc->lock);
>   
>   	xe_pm_runtime_get(xe);
> -	xe_force_wake_get(gt_to_fw(gt), XE_FW_GSC);
> +	ret = xe_force_wake_get(gt_to_fw(gt), XE_FW_GSC);
> +	if (ret) {
> +		xe_pm_runtime_put(xe);
> +		return;

It's not safe to just abort here, it'll leave the SW in an unknown 
state. I have a patch semi-ready (will complete it and send it later 
today) to print an error an keep going. If the GT happens to actually be 
awake then the next steps will work, if it's not then they'll fail and 
we'll move the SW state to the expected values.

Daniele


> +	}
>   
>   	if (actions & GSC_ACTION_FW_LOAD) {
>   		ret = gsc_upload_and_init(gsc);



More information about the Intel-xe mailing list