Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99A30F8DFCE for ; Fri, 17 Apr 2026 08:25:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 587EB10E991; Fri, 17 Apr 2026 08:25:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Ga9dkhIw"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 02A0F10E991 for ; Fri, 17 Apr 2026 08:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1776414345; x=1807950345; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eDJx6hA9Z8NpM6QhQJ8wyB/yEfSCr3CIiJCBche7khM=; b=Ga9dkhIwbrByfw6JBe+n87Wr1AoivV7WYi+gB4hqi9/ss1FdiPqYeZyM gdmp01mjZQ/vTQqp/kZ2P/Xtay51eqwM0ybkW3UzqQjoEDd9aeNFfn66W 55eVspd/Ke+ZsHbGGd+24HJSitvAmDlBoOJ3eQicNwhkJycs+acGlKJWw +fqGLDo/jzbnR9wa3MIYPhypgjMk6gCyQTinfU8A6ePOZA1QGW/wmJXl/ NtZgvvax2ALcvtIPKHnC/kqS4weHouPgkJPFoY0Z0yTb/PLSv5+T6twNT MuXKi/2zT3aYWqqCaKrZ7Su4QgAXnbNK1/GtvAD51bWmqOkRogXY0wOoq A==; X-CSE-ConnectionGUID: nGsWiszgT8Wt5TR1pZxnZw== X-CSE-MsgGUID: 8tkikIk7SECKu6UWX2D3Aw== X-IronPort-AV: E=McAfee;i="6800,10657,11761"; a="88045839" X-IronPort-AV: E=Sophos;i="6.23,183,1770624000"; d="scan'208";a="88045839" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2026 01:25:45 -0700 X-CSE-ConnectionGUID: xsghtvKzS4GZwu3lcqEzJw== X-CSE-MsgGUID: a2uBC6NpSRaSmBXMMYpDgQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,183,1770624000"; d="scan'208";a="235962250" Received: from rtauro-desk.iind.intel.com ([10.190.238.50]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2026 01:25:41 -0700 From: Riana Tauro To: intel-xe@lists.freedesktop.org Cc: riana.tauro@intel.com, anshuman.gupta@intel.com, rodrigo.vivi@intel.com, aravind.iddamsetty@linux.intel.com, badal.nilawar@intel.com, raag.jadav@intel.com, ravi.kishore.koppuravuri@intel.com, mallesh.koujalagi@intel.com, soham.purkait@intel.com, Matthew Brost , Himal Prasad Ghimiray Subject: [PATCH v4 04/13] drm/xe: Skip device access during PCI error recovery Date: Fri, 17 Apr 2026 14:28:16 +0530 Message-ID: <20260417085812.4013309-19-riana.tauro@intel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260417085812.4013309-15-riana.tauro@intel.com> References: <20260417085812.4013309-15-riana.tauro@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" When a fatal error occurs and the error_detected callback is invoked the device is inaccessible. The error_detected callback wedges the device causing the jobs to timeout. The timedout handler acquires forcewake to dump devcoredump and triggers a GT reset. Since the device is inacessible this causes errors. Skip all mmio accesses and gt reset when the device is in recovery. Cc: Matthew Brost Cc: Himal Prasad Ghimiray Signed-off-by: Riana Tauro --- v2: add check in worker (Mallesh) --- drivers/gpu/drm/xe/xe_gt.c | 14 +++++++++++--- drivers/gpu/drm/xe/xe_guc_submit.c | 9 +++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c index 8a31c963c372..5ea5524d83af 100644 --- a/drivers/gpu/drm/xe/xe_gt.c +++ b/drivers/gpu/drm/xe/xe_gt.c @@ -917,6 +917,9 @@ static void gt_reset_worker(struct work_struct *w) if (xe_device_wedged(gt_to_xe(gt))) goto err_pm_put; + if (xe_device_is_in_recovery(gt_to_xe(gt))) + goto err_pm_put; + /* We only support GT resets with GuC submission */ if (!xe_device_uc_enabled(gt_to_xe(gt))) goto err_pm_put; @@ -977,18 +980,23 @@ static void gt_reset_worker(struct work_struct *w) void xe_gt_reset_async(struct xe_gt *gt) { - xe_gt_info(gt, "trying reset from %ps\n", __builtin_return_address(0)); + struct xe_device *xe = gt_to_xe(gt); + + if (xe_device_is_in_recovery(xe)) + return; /* Don't do a reset while one is already in flight */ if (!xe_fault_inject_gt_reset() && xe_uc_reset_prepare(>->uc)) return; + xe_gt_info(gt, "trying reset from %ps\n", __builtin_return_address(0)); + xe_gt_info(gt, "reset queued\n"); /* Pair with put in gt_reset_worker() if work is enqueued */ - xe_pm_runtime_get_noresume(gt_to_xe(gt)); + xe_pm_runtime_get_noresume(xe); if (!queue_work(gt->ordered_wq, >->reset.worker)) - xe_pm_runtime_put(gt_to_xe(gt)); + xe_pm_runtime_put(xe); } void xe_gt_suspend_prepare(struct xe_gt *gt) diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index 10556156eaad..1f32fb14a5c1 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -1522,7 +1522,7 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job) * If devcoredump not captured and GuC capture for the job is not ready * do manual capture first and decide later if we need to use it */ - if (!exec_queue_killed(q) && !xe->devcoredump.captured && + if (!xe_device_is_in_recovery(xe) && !exec_queue_killed(q) && !xe->devcoredump.captured && !xe_guc_capture_get_matching_and_lock(q)) { /* take force wake before engine register manual capture */ CLASS(xe_force_wake, fw_ref)(gt_to_fw(q->gt), XE_FORCEWAKE_ALL); @@ -1544,8 +1544,8 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job) set_exec_queue_banned(q); /* Kick job / queue off hardware */ - if (!wedged && (exec_queue_enabled(primary) || - exec_queue_pending_disable(primary))) { + if (!xe_device_is_in_recovery(xe) && !wedged && + (exec_queue_enabled(primary) || exec_queue_pending_disable(primary))) { int ret; if (exec_queue_reset(primary)) @@ -1613,7 +1613,8 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job) trace_xe_sched_job_timedout(job); - if (!exec_queue_killed(q)) + /* Do not access device if in recovery */ + if (!xe_device_is_in_recovery(xe) && !exec_queue_killed(q)) xe_devcoredump(q, job, "Timedout job - seqno=%u, lrc_seqno=%u, guc_id=%d, flags=0x%lx", xe_sched_job_seqno(job), xe_sched_job_lrc_seqno(job), -- 2.47.1