From patchwork Mon Oct 21 22:43:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dong, Zhanjun" X-Patchwork-Id: 13844804 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 053F1D17142 for ; Mon, 21 Oct 2024 22:43:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 94CB510E245; Mon, 21 Oct 2024 22:43:23 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="gIvc849B"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF21B10E15A; Mon, 21 Oct 2024 22:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729550599; x=1761086599; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eNj13D7N9QfLTCPuudEVkz7xwSQKchMfnfCCJl1Jp08=; b=gIvc849BBiTKl0yQqRqCRoGEOduSDLj1SI+6ULYOvnTyK3+typNnMaZl eTq/jZUBq+k5EXh4JMJpehgQLtTlNY5YeQVWt4bn6EGCSsYYGCY7HyBmY E+vZd1Cs6TWwgHIVfDlaSRd2Uj56lnh8kNGhODyez+OsvO7v1hoWbwakb VswEcM3itU3F6WhWs64orVxVwqxBC8btp1UrRIfvcubMNQ5prKiJR+i4a +AhB9zqsAxLYvIsCHXeWCOW9902D4TFwDDsb/PBk72nm+vNTMipFoL6eH n0GP34HHubVV5jEH2knbCWPQJxz4pDi7dM99JVc73uTA/CX6uggKE3D4h Q==; X-CSE-ConnectionGUID: wpZz3bWfRR68d1wjq/4RMw== X-CSE-MsgGUID: bJHPAX3MTl6I2Oxp86WPMQ== X-IronPort-AV: E=McAfee;i="6700,10204,11232"; a="54464079" X-IronPort-AV: E=Sophos;i="6.11,221,1725346800"; d="scan'208";a="54464079" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2024 15:43:18 -0700 X-CSE-ConnectionGUID: Qi6b70AvR9KrLXZcAcGUMA== X-CSE-MsgGUID: 2OeDRGAPTjqr83jhAK1WQA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,221,1725346800"; d="scan'208";a="79751017" Received: from guc-pnp-dev-box-1.fm.intel.com ([10.1.27.7]) by fmviesa008.fm.intel.com with ESMTP; 21 Oct 2024 15:43:18 -0700 From: Zhanjun Dong To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Zhanjun Dong Subject: [PATCH v2 1/1] drm/i915/guc: Move destroy context at end of reset prepare Date: Mon, 21 Oct 2024 15:43:16 -0700 Message-Id: <20241021224316.293590-2-zhanjun.dong@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021224316.293590-1-zhanjun.dong@intel.com> References: <20241021224316.293590-1-zhanjun.dong@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" During GuC reset prepare, interrupt disabled before hardware reset, although interrupt disabled, the ct is still enabled, the host-GuC communication is still active. Move the destroy part to the end of reset preparation to avoid the situation of host processing G2H messages about an context, but the context already been destroyed. Signed-off-by: Zhanjun Dong --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index 9ede6f240d79..858756eb4eb9 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -1689,10 +1689,11 @@ void intel_guc_submission_reset_prepare(struct intel_guc *guc) spin_unlock_irq(guc_to_gt(guc)->irq_lock); guc_flush_submissions(guc); - guc_flush_destroyed_contexts(guc); flush_work(&guc->ct.requests.worker); scrub_guc_desc_for_outstanding_g2h(guc); + guc_flush_destroyed_contexts(guc); + } static struct intel_engine_cs *