[Intel-gfx] [PATCH dii-client v6 2/5] drm/i915: Define and use GuC and CTB TLB invalidation routines

Michal Wajdeczko michal.wajdeczko at intel.com
Wed Oct 4 22:48:13 UTC 2023



On 05.10.2023 00:07, Jonathan Cavitt wrote:
> From: Prathap Kumar Valsan <prathap.kumar.valsan at intel.com>
> 

snip

> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> index 6e22af31513a5..1ee4d4a988398 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> @@ -1115,6 +1115,11 @@ static int ct_process_request(struct intel_guc_ct *ct, struct ct_incoming_msg *r
>  	case INTEL_GUC_ACTION_NOTIFY_EXCEPTION:
>  		ret = intel_guc_crash_process_msg(guc, action);
>  		break;
> +	case INTEL_GUC_ACTION_TLB_INVALIDATION_DONE:
> +		ret = intel_guc_tlb_invalidation_done(ct_to_guc(ct), hxg, request->size);
> +		if (unlikely(ret))
> +			ct_free_msg(request);

why this request message is released here ?

for other actions this is done in unified way either later in this
function (for success case) or in the caller (error case)

so this will cause double free for (unlikely) error case, no ?

> +		break;
>  	default:
>  		ret = -EOPNOTSUPP;
>  		break;
> @@ -1186,6 +1191,7 @@ static int ct_handle_event(struct intel_guc_ct *ct, struct ct_incoming_msg *requ
>  	switch (action) {
>  	case INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_DONE:
>  	case INTEL_GUC_ACTION_DEREGISTER_CONTEXT_DONE:
> +	case INTEL_GUC_ACTION_TLB_INVALIDATION_DONE:
>  		g2h_release_space(ct, request->size);
>  	}
>  


More information about the Intel-gfx mailing list