[PATCH] drm/xe/guc: Explicitly initialize g2h_fence.cancel

Matthew Brost matthew.brost at intel.com
Wed Jul 23 17:16:44 UTC 2025


On Wed, Jul 23, 2025 at 06:57:17PM +0200, Michal Wajdeczko wrote:
> The struct g2h_fence must be explicitly initializated using the
> g2h_fence_init() function to avoid trash values in its members,
> but we missed to update this helper function with the new member.
> 
> Fixes: 94de94d24ea8 ("drm/xe/guc: Cancel ongoing H2G requests when stopping CT")
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Matthew Brost <matthew.brost at intel.com>
> Cc: Lukasz Laguna <lukasz.laguna at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_guc_ct.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
> index b6acccfcd351..ebe74a6b27ee 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ct.c
> +++ b/drivers/gpu/drm/xe/xe_guc_ct.c
> @@ -98,6 +98,7 @@ static void g2h_fence_init(struct g2h_fence *g2h_fence, u32 *response_buffer)
>  	g2h_fence->response_buffer = response_buffer;
>  	g2h_fence->response_data = 0;
>  	g2h_fence->response_len = 0;
> +	g2h_fence->cancel = false;

Should we just memset the g2h fence to zero, then set non-zero fields?
Seems safer and I don't think this is critical path so can take a slight
perf hit.

Matt

>  	g2h_fence->fail = false;
>  	g2h_fence->retry = false;
>  	g2h_fence->done = false;
> -- 
> 2.47.1
> 


More information about the Intel-xe mailing list