From mboxrd@z Thu Jan 1 00:00:00 1970 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 5399DC25B50 for ; Tue, 24 Jan 2023 11:07:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C18F10E059; Tue, 24 Jan 2023 11:07:23 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 96C0A10E059 for ; Tue, 24 Jan 2023 11:07:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674558442; x=1706094442; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=WgkBlOgn9TtEighOhaOu2/cCe5U938qnvBGmTqLLw/w=; b=D0vE1nHst5tMxyErRspI3sDT3MCgsNfIEvSctu/OCBgEOGFJZjccYQ7k T8yvOov8KhHuriR4ZAJ/u+8IUcZOcNTbjJWb5YVTBytlhgJzJOeTioouu NZg/PMWOnxH6iPgTa83qoN8mw6myW3w2Nw+JGFKf7STdPjYNslgnOLdt+ 94Hy5XZ0hLqVEuePaY+FFtmsJzFi/0WrUWzMN+2Hjl2DeIvLthof+zbLA F9APfNou7wfk9XaF0rHIjiofRihW2ZUdjX6ApCDXNrk8rvAoPlzWvwE3D 8WnilJYgA0MweJxH2TMSlumRUEW5wN2303DFpRzxA3OmHr9BSG5jQmadM g==; X-IronPort-AV: E=McAfee;i="6500,9779,10599"; a="323965453" X-IronPort-AV: E=Sophos;i="5.97,242,1669104000"; d="scan'208";a="323965453" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2023 03:07:22 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10599"; a="990836019" X-IronPort-AV: E=Sophos;i="5.97,242,1669104000"; d="scan'208";a="990836019" Received: from nirmoyda-mobl.ger.corp.intel.com (HELO [10.252.57.194]) ([10.252.57.194]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2023 03:07:21 -0800 Message-ID: Date: Tue, 24 Jan 2023 12:07:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US To: Nirmoy Das , intel-gfx@lists.freedesktop.org References: <20230124110515.17017-1-nirmoy.das@intel.com> From: "Das, Nirmoy" In-Reply-To: <20230124110515.17017-1-nirmoy.das@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: Clear wedged status upon suspend 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: , Cc: Chris Wilson Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Forgot to add the drm issue a reference. On 1/24/2023 12:05 PM, Nirmoy Das wrote: > From: Chris Wilson > > Currently we use set-wedged on suspend if the workload is not responding > in order to allow a fast suspend (albeit at the cost of discarding the > current userspace). This may leave the device wedged during suspend, > where we may require the device available in order to swapout CPU > inaccessible device memory. Clear any temporary wedged-status after > flushing userspace off the device so we can use the blitter ourselves > inside suspend. > > Testcase: igt/gem_eio/in-flight-suspend References: https://gitlab.freedesktop.org/drm/intel/-/issues/7896 > Cc: Mika Kuoppala > Cc: Tvrtko Ursulin > Signed-off-by: Chris Wilson > Signed-off-by: Nirmoy Das > --- > drivers/gpu/drm/i915/gt/intel_gt_pm.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c > index cef3d6f5c34e..74d1dd3793f9 100644 > --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c > +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c > @@ -317,19 +317,17 @@ int intel_gt_resume(struct intel_gt *gt) > > static void wait_for_suspend(struct intel_gt *gt) > { > - if (!intel_gt_pm_is_awake(gt)) > - return; > - > - if (intel_gt_wait_for_idle(gt, I915_GT_SUSPEND_IDLE_TIMEOUT) == -ETIME) { > + if (intel_gt_wait_for_idle(gt, I915_GT_SUSPEND_IDLE_TIMEOUT) == -ETIME) > /* > * Forcibly cancel outstanding work and leave > * the gpu quiet. > */ > intel_gt_set_wedged(gt); > - intel_gt_retire_requests(gt); > - } > > intel_gt_pm_wait_for_idle(gt); > + > + /* Make the GPU available again for swapout */ > + intel_gt_unset_wedged(gt); > } > > void intel_gt_suspend_prepare(struct intel_gt *gt)