From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F2A1606A31A for ; Tue, 1 Dec 2026 18:31:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NKrt8xHP Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C218B10E903; Tue, 1 Dec 2026 18:31:28 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 807E810E903 for ; Tue, 1 Dec 2026 18:31:22 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 4B857416DA; Tue, 1 Dec 2026 18:31:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03FAD1F00898; Tue, 1 Dec 2026 18:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796149882; bh=4rAOIE0jO1Kigr/sJxKUlMNxfRpCYTILCJgiB2q95YM=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=NKrt8xHPrFajTCKn7BEkEJb5gCPMsFyB6W2vy5lX7b9q9z/pMxYOBDMU4vH1IJPeT zrsPsQaHLHDPiBxfUXyRM55XTjAyK6QyiPtch3xQzErhBO7dWgTmlxRHmrK1vm08/U WnPsHsT/JIMCEAmlt0L3EIQuUTCCnxsxGKGJ+quwCNEviAIgrWb/qHGgkjdYe3WQff R7wazyKIx5SUZRsvHl+kgbfNAJLtPp+DDRNVJMvsxjsvwTOAR1QksE0hpIasRAP5BW /2a5jkTWbrtrGus77aJFj04Pj3KH8qKVadopEBa/GyAoKi8Cl6CQWe8RBGK9YseY8o ExmsQUZ1rpCzQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] drm/xe/guc: Restore TDR timeout when resubmitting jobs after GT reset To: "Himal Prasad Ghimiray" , intel-xe@lists.freedesktop.org In-Reply-To: <20261201180419.3211018-2-himal.prasad.ghimiray@intel.com> References: <20261201180419.3211018-2-himal.prasad.ghimiray@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 18:31:21 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-xe" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/xe/guc: race in guc_exec_queue_start() overwrites kill TDR timeout -- commit 2ed1517ec035f7e7c46006fffdc88ad66148b770 Author: Himal Prasad Ghimiray drm/xe/guc: Restore TDR timeout when resubmitting jobs after GT reset This commit calls xe_sched_reinit() in guc_exec_queue_start() to restore the scheduler timeout before resubmitting jobs after a GT reset. > diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_g= uc_submit.c > index fce39dd4e1177..3015d55e86df2 100644 > --- a/drivers/gpu/drm/xe/xe_guc_submit.c > +++ b/drivers/gpu/drm/xe/xe_guc_submit.c > @@ -3141,6 +3141,8 @@ static void guc_exec_queue_start(struct xe_exec_que= ue *q) > xe_lrc_ring_head(q->lrc[i])); > } > } > + /* Undo a prior xe_sched_tdr_queue_imm() zeroing the timeout */ > + xe_sched_reinit(sched); > xe_sched_resubmit_jobs(sched); > } [Severity: Medium] Can a concurrent guc_exec_queue_kill() have its zeroed TDR timeout overwritten by xe_sched_reinit() here, leaving pending jobs unsubmitted and never cleaned up? guc_exec_queue_kill() does not take guc->submission_state.lock. If userspace destroys a queue or closes the file descriptor during a GT reset after guc_exec_queue_start() checks exec_queue_killed_or_banned_or_wedged(q): CPU0 CPU1 guc_exec_queue_start(q) !exec_queue_killed_or_banned... guc_exec_queue_kill(q) set_exec_queue_killed(q) xe_guc_exec_queue_trigger_cleanup(q) xe_sched_tdr_queue_imm(sched) sched->base.timeout =3D 0 mod_delayed_work(..., 0) xe_sched_reinit(sched) sched->base.timeout =3D sched->timeout xe_sched_resubmit_jobs(sched) guc_exec_queue_run_job() /* sees KILLED, skips GuC submit */ ... xe_sched_submission_resume_tdr(sched) mod_delayed_work(..., sched->timeout) <-- replaces 0-delay TDR Because guc_exec_queue_run_job() re-checks exec_queue_killed_or_banned_or_wedged(q), it skips submitting the pending jobs to GuC and relies on TDR to signal and free them. On long-running queues where sched->timeout is MAX_SCHEDULE_TIMEOUT, work_tdr never fires, leaking the pending jobs, the xe_exec_queue reference, the GuC ID, and the runtime PM reference; on normal queues, cleanup stalls for the full job_timeout_ms. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201180419.3211= 018-2-himal.prasad.ghimiray@intel.com?part=3D1