From patchwork Mon Jan 16 03:22:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 9518031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 27CDA601B7 for ; Mon, 16 Jan 2017 03:38:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B77082835B for ; Mon, 16 Jan 2017 03:38:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB84F2840E; Mon, 16 Jan 2017 03:38:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9CB0D2835B for ; Mon, 16 Jan 2017 03:38:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 354126E22B; Mon, 16 Jan 2017 03:38:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 502 seconds by postgrey-1.35 at gabe; Mon, 16 Jan 2017 03:38:07 UTC Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0040.outbound.protection.outlook.com [104.47.38.40]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C88B6E22A; Mon, 16 Jan 2017 03:38:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GnOTDpqGLbOedMsQAXxJNbQPgAAlZyqPOGLotoXef6M=; b=DR7D591UWyGUzWlC5rBuvT+DJV635Jls5B7wz6Q9+aT+BjkvYI7nW+K3Ee8Bi5vPqpNXb2WOakpJkksaHyV3kzRmOrMiw2TfZxwv5oo3W2reFEV04JtmybiDZ6IfiVsnnen59kAcuofl85gn4hzfzS2nGBFNscQEFcB5fq8Ukzs= Received: from MWHPR1201MB0127.namprd12.prod.outlook.com (10.174.98.142) by MWHPR1201MB0126.namprd12.prod.outlook.com (10.174.98.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Mon, 16 Jan 2017 03:22:59 +0000 Received: from MWHPR1201MB0127.namprd12.prod.outlook.com ([10.174.98.142]) by MWHPR1201MB0127.namprd12.prod.outlook.com ([10.174.98.142]) with mapi id 15.01.0845.013; Mon, 16 Jan 2017 03:22:59 +0000 From: "He, Hongbo" To: =?utf-8?B?Q2hyaXN0aWFuIEvDtm5pZw==?= Subject: RE: [PATCH 1/6] drm/ttm: remove allow_errors parameter from ttm_bo_force_list_clean Thread-Topic: [PATCH 1/6] drm/ttm: remove allow_errors parameter from ttm_bo_force_list_clean Thread-Index: AQHSbYKa61FzYqH2zEmzUXyoWF4Jl6E6dFgQ Date: Mon, 16 Jan 2017 03:22:59 +0000 Message-ID: References: <1484301071-21703-1-git-send-email-deathsimple@vodafone.de> <1484301071-21703-2-git-send-email-deathsimple@vodafone.de> In-Reply-To: <1484301071-21703-2-git-send-email-deathsimple@vodafone.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Hongbo.He@amd.com; x-originating-ip: [116.228.147.241] x-ms-office365-filtering-correlation-id: 744c6c2f-fb0c-4e4c-3e12-08d43dbef910 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:MWHPR1201MB0126; x-microsoft-exchange-diagnostics: 1; MWHPR1201MB0126; 7:fyZBtczSM5GwpZb3yH3cLbQwzRb5X/GNeU+nzDdC25eULVHmNOtJh/LkZp3G0NG8Pqdmha4ACXcnARn0iY2w0mFsP+t2vuc0yeYHRf62T9cUmZ47kSHtt1aXRP+HpSsM3t1lBc7acYy6R4/6jQw736JC5IWWTZBOCeu+9HBHdPTwFoYhOfHW7QeczxB3z/izG+ziXfBYL8aCG3/LRnKNaovWUnjRHepBlllZO7ldwgtFRncyNQW6qzEp0m2VtdWIl3vchS32G2jokb3q7ClE31gwzsAR5M4oXi+HXKphcGvh9s63OsxfH+TtUAs2FcXzVG4LWufnGadrqD65Z3X3BPDKdtQKzyvCfwLHSYTMiNCbJ7RX9Rd93MKfO036Eat0q2A7eE5000s+H8OOmAJJ3RinvNuU3yf2kjSSgJT0uL4EVMbUy5b7Z7e8LIBrNZPGUBRUSs9/6DmJ5TmE8/Jeqw==; 20:URRZWVSJ9btnT6+ZzB+JBLbUeWp9F6pUiJydIdAx3XBlYe+nBYdRjALruufdAyzeQlwwjsbtaXettCPGfcXsFk3gnk21NgTySvlb6I24qGNyNIcEYPC4RHvR+ADo1H/hD6eDgRH8ahjjO2/Pu30H3IDqHqpnftCcuIxGCv+EFmSkflgEVkNIyInHKbmCiqfgWRtooYi1lx2ohBF8xIh33ubsAHjPrE5FfICoalx81/UNRqfAzWnzyNjD3ygbjnpI x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(217544274631240); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:MWHPR1201MB0126; BCL:0; PCL:0; RULEID:; SRVR:MWHPR1201MB0126; x-forefront-prvs: 01894AD3B8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39860400002)(39840400002)(39450400003)(39850400002)(39410400002)(13464003)(377454003)(199003)(189002)(3846002)(3280700002)(102836003)(99286003)(6116002)(77096006)(6506006)(27001)(105586002)(6436002)(54906002)(4326007)(50986999)(55016002)(9686003)(3660700001)(68736007)(6306002)(122556002)(229853002)(54356999)(106356001)(76176999)(25786008)(2906002)(106116001)(38730400001)(101416001)(86362001)(92566002)(97736004)(2900100001)(81156014)(81166006)(66066001)(7696004)(74316002)(7736002)(305945005)(8676002)(110136003)(189998001)(5660300001)(2950100002)(33656002)(6916009)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR1201MB0126; H:MWHPR1201MB0127.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jan 2017 03:22:59.4451 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0126 Cc: "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Looks good to me, patch is Reviewed-by: Roger.He -----Original Message----- From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Christian K?nig Sent: Friday, January 13, 2017 5:51 PM To: He, Hongbo Cc: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org Subject: [PATCH 1/6] drm/ttm: remove allow_errors parameter from ttm_bo_force_list_clean From: Christian König Not allowing errors here is completely pointless and actually dangerous cause trying to continue on an error can cause an endless loop. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) spin_unlock(&glob->lru_lock); ret = ttm_mem_evict_first(bdev, mem_type, NULL, false, false); - if (ret) { - if (allow_errors) { - return ret; - } else { - pr_err("Cleanup eviction failed\n"); - } - } + if (ret) + return ret; spin_lock(&glob->lru_lock); } spin_unlock(&glob->lru_lock); @@ -1324,13 +1319,8 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev, if (fence) { ret = fence_wait(fence, false); fence_put(fence); - if (ret) { - if (allow_errors) { - return ret; - } else { - pr_err("Cleanup eviction failed\n"); - } - } + if (ret) + return ret; } return 0; @@ -1359,7 +1349,11 @@ int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type) ret = 0; if (mem_type > 0) { - ttm_bo_force_list_clean(bdev, mem_type, false); + ret = ttm_bo_force_list_clean(bdev, mem_type); + if (ret) { + pr_err("Cleanup eviction failed\n"); + return ret; + } ret = (*man->func->takedown)(man); } @@ -1382,7 +1376,7 @@ int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type) return 0; } - return ttm_bo_force_list_clean(bdev, mem_type, true); + return ttm_bo_force_list_clean(bdev, mem_type); } EXPORT_SYMBOL(ttm_bo_evict_mm); -- 2.7.4 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index b5038c5..6683399 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1291,7 +1291,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev, EXPORT_SYMBOL(ttm_bo_create); static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev, - unsigned mem_type, bool allow_errors) + unsigned mem_type) { struct ttm_mem_type_manager *man = &bdev->man[mem_type]; struct ttm_bo_global *glob = bdev->glob; @@ -1306,13 +1306,8 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev, while (!list_empty(&man->lru)) {