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 D6E7AECAAD1 for ; Wed, 31 Aug 2022 15:51:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D1BF510E476; Wed, 31 Aug 2022 15:50:59 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2908B10E46F; Wed, 31 Aug 2022 15:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661961056; x=1693497056; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=vkPU7sdfJueWPEchVhmJ8DiR+YVfE1Z5xxWYFkCgOW0=; b=OLvpM3BVvb7xIiwTqXyKNTSyVamFFLMyDzWKasokwIYQ7nCuHpV9WbbY pRDvStxO1N1Ej9G/ol7LYFSYlEaucyu42PpQqCwH4lajnjA70+KDndtTV 1mUG3I4ztjJ8I6u2wwKxKoV2NT9M4h8bUvkb7hgYkKr6wx8xrqE3Hsrhu F84AEW34KK8a9JD4BsnoSIwsPjYhK1R8PIrL71UnfzgLzCHmmZzyWVnsw qP7RCqVA2BgK2uhZgy8Y6PUugZ+/M9fQnw/ymQWFdQFfa5dvL3z4AAh3F 040yWs7KtH6f2+cFHW+/WlDDFljhrIcDyXPzzfzdLD1D01+a0GZVsXXz6 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10456"; a="278494418" X-IronPort-AV: E=Sophos;i="5.93,278,1654585200"; d="scan'208";a="278494418" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 08:50:55 -0700 X-IronPort-AV: E=Sophos;i="5.93,278,1654585200"; d="scan'208";a="641920880" Received: from salwamoh-mobl.gar.corp.intel.com (HELO [10.214.169.63]) ([10.214.169.63]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 08:50:52 -0700 Message-ID: Date: Wed, 31 Aug 2022 16:50:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.2.0 Content-Language: en-GB To: Nirmoy Das , intel-gfx@lists.freedesktop.org References: <20220829120409.24260-1-nirmoy.das@intel.com> From: Matthew Auld In-Reply-To: <20220829120409.24260-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/ttm: Abort suspend on i915_ttm_backup failure 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: thomas.hellstrom@intel.com, chris.p.wilson@intel.com, dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 29/08/2022 13:04, Nirmoy Das wrote: > On system suspend when system memory is low then i915_gem_obj_copy_ttm() > could fail trying to backup a lmem obj. GEM_WARN_ON() is not enough, > suspend shouldn't continue if i915_ttm_backup() throws an error. > > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6529 Does this fix it? Does CI not complain about the drm_err? Also do we know what the actual error was? > Suggested-by: Chris P Wilson > Signed-off-by: Nirmoy Das Passing the error along seems reasonable to me, Reviewed-by: Matthew Auld > --- > drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c > index 9aad84059d56..6f5d5c0909b4 100644 > --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c > +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c > @@ -79,7 +79,12 @@ static int i915_ttm_backup(struct i915_gem_apply_to_region *apply, > goto out_no_populate; > > err = i915_gem_obj_copy_ttm(backup, obj, pm_apply->allow_gpu, false); > - GEM_WARN_ON(err); > + if (err) { > + drm_err(&i915->drm, > + "Unable to copy from device to system memory, err:%d\n", > + err); > + goto out_no_populate; > + } > ttm_bo_wait_ctx(backup_bo, &ctx); > > obj->ttm.backup = backup;