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 EDF10ECAAD3 for ; Thu, 1 Sep 2022 15:58:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D02C10E05B; Thu, 1 Sep 2022 15:58:05 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id AAE9F10E05B; Thu, 1 Sep 2022 15:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662047881; x=1693583881; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=P1Ks+pOrIKYw4I5ZGK3yM1ct5kvw2WsJqNzAMSaPTt8=; b=n9rZ13XSVLOYp359nQgDpoehO4CnvVMVM8Firvz+qtIxk1wjLRC+e0xe vpt10ro8bdSD0M+eY9d2VlbncmzpW0KIjjLO6tLCJOW246V1rN9bndUEk WOKl1EaYU7OKz1ZrlqP9RGLilBAZAMGQACWfnbdl8n7Gy7CPrN1nFAFeo KS55MW5Kn17JzdYyoGaimI5EH8BjrO6CVNfoM5K8+OuLLogzX+wMeIZ6/ SbX4LDwhAun5mildJaG1ZCqGHbu0nxvlQ+eI+K87DzUwDV+lVRWOh5r9d wxuGJCxsJVCZp9vQ+YNgaqv5ISpXRKvuWJN0YEM098wAej8gk0mIkmQhq A==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="293330800" X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="293330800" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 08:57:15 -0700 X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="940905249" Received: from ahajda-mobl.ger.corp.intel.com (HELO [10.213.20.60]) ([10.213.20.60]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 08:57:13 -0700 Message-ID: <119f1fe3-e7cb-6cd6-2710-e1c3e395d49e@intel.com> Date: Thu, 1 Sep 2022 17:57:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.13.0 Content-Language: en-US To: Nirmoy Das , intel-gfx@lists.freedesktop.org References: <20220831161841.20033-1-nirmoy.das@intel.com> From: Andrzej Hajda Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 In-Reply-To: <20220831161841.20033-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, matthew.auld@intel.com, dri-devel@lists.freedesktop.org, chris.p.wilson@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 31.08.2022 18:18, 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. > > References: https://gitlab.freedesktop.org/drm/intel/-/issues/6529 > Reviewed-by: Matthew Auld > Suggested-by: Chris P Wilson > Signed-off-by: Nirmoy Das > --- > 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); I wonder if %pe wouldn't be better here, up to you. Reviewed-by: Andrzej Hajda Regards Andrzej > + goto out_no_populate; > + } > ttm_bo_wait_ctx(backup_bo, &ctx); > > obj->ttm.backup = backup;