From patchwork Fri Jan 26 18:29:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "StDenis, Tom" X-Patchwork-Id: 10186721 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 EDF4D60383 for ; Fri, 26 Jan 2018 18:30:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF400297F7 for ; Fri, 26 Jan 2018 18:30:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3A5D29BC8; Fri, 26 Jan 2018 18:30:11 +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=-2.6 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, 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 7423E297F7 for ; Fri, 26 Jan 2018 18:30:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2515D6E7B1; Fri, 26 Jan 2018 18:29:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0075.outbound.protection.outlook.com [104.47.36.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0D1876E404; Fri, 26 Jan 2018 18:29:37 +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=dPvE78bxSQNG4XUDjUhmO0qp92QoxFeC4tTsCczPR+c=; b=3dwsQd7wGxiYic/IPyHpOw60QUxMWA8dWFZ25kqJ4BJjVbc4t3Hel3t06Sw+9oPFELAh5cLK+fFQGYo2Yx6ETsHsL7RKfFlGWAbVufzpvrHQH3rsGU9doZxJhPJ54pBiztvitAsSND7bW3lysMzHIII1Bu2XqtnknlIJgzoRnk0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Tom.StDenis@amd.com; Received: from fx8.amd.com (165.204.55.251) by DM5PR1201MB0076.namprd12.prod.outlook.com (10.174.106.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Fri, 26 Jan 2018 18:29:35 +0000 From: Tom St Denis To: amd-gfx@lists.freedesktop.org Subject: [PATCH 12/12] drm/ttm: Simplify ttm_eu_reserve_buffers() Date: Fri, 26 Jan 2018 13:29:11 -0500 Message-Id: <20180126182911.20761-13-tom.stdenis@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180126182911.20761-1-tom.stdenis@amd.com> References: <20180126182911.20761-1-tom.stdenis@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: MWHPR03CA0027.namprd03.prod.outlook.com (10.174.173.144) To DM5PR1201MB0076.namprd12.prod.outlook.com (10.174.106.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7cd49539-cb1c-4460-b65e-08d564eac0db X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR1201MB0076; X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0076; 3:6D99bqUdgwMFS64S7kLq7JM9BNEflNOdirGmZ4JBJYIIHmctlMN+/8nvYHjhvn48ahF9yM0kHE/sybOlhA/zrwszao+7clZklJoSMXuTRxBPwKI+Es0Rkbz2rUL/ikjHf0saw93nofsVxod77RvG/42ywXfO0MWArdPkl6Gw6Qz0LU3Md/xlRJWn798Y6Z6Zl9FUoNQw3J5QG5Bw/gt4BcK8QT+xbZO07gUnswLM3m9N4F7oy8q/EJlzothXHFO5; 25:FhEsFlt/jOs4jWeRMZHcYiSWeoalh2F/abOF+Q9ES0ToUDXSxG/iSCoATJjTdqbHFwqzkx4C8QI26NUkzdnQkn4SMUVby2GtnCxkDWta86kURKuAaOUm6G4iiZn4pCX1vjbequYjWsOR67XS0kDTpHn5pWfdxQeonQ/5VGAGQstVfgKq3IUvdXTHW3lZ5TFgB626wVyH61jigxM4DRL15f8G3IPIrOD34dRS1M4EnQYspi8ANgAqf1LNzBsYqIBBkN0L7zYNuJFBgj8YMGIPclaU2fafjTUJu1t+b+xMSJtYHdNhAIYI0OJfxG7DedgVIsqEEIq79bmfToq2Llu/Ng==; 31:w9w6ELJBBmhXxDjBuWIXFX6/SkfQO/nFAtUlXTRuOmqOrV1jspMAW97g3+88ZP+08leqSQrRSXHsucT3jSVpAhazFuQTWZfbInoHwyF62hzt162W6i0/KmDgsK0OZKAZjtXmynyAVMWnvIGl7/PmNoCR4555jLi3SKcqMjjTkYpKHM2XkeSwGiEKcM9XiqZqFBSp08u8vSijnA0t6Nd6Ow== X-MS-TrafficTypeDiagnostic: DM5PR1201MB0076: X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0076; 20:R4+0ypwcfKYn+6Y37Kk1CXDYmoU6y30Gmp2vciiFJGdHNf4tjkk8bziuvlqY/YaOI0UhkyTSu2VlqqrRy/Ey8qJF7HwTI8Tq937wGM2vNAC1OuC8dzrmVOY3Oj2kkw5FV34WttIa7a/qrNNQG16J+miAORWkCUp0ci1CFbIFgUbGCLDWKumV1FyRp768QiXtFZ0PLDIEZocYVchxd3hcs4pM++l7x6SHQbdyuJ5jNA21XVUq9uvdhPApSzEJ4k3K8UAlWOWiHeYzOXrJbZKFIhLCNfXNL8bd6yESa/Es9aiaXYYQBsr9OANM7ezvM0ogJ+CARy5ngzT0Y3fUtOoP6sS1n/KK4PknTT/crSSBiVmwp1VaPyG1iQdiSQJYmZOzLkTmj8rX5YWU6elgJn1nRu3HkiQRjwFvVZVLmpTyd1LRW63k1ZonVIrabH+tT/n3WLr5afgLOqV1n8OCYNGXptlgj8J+ZAqLuhxLV2zeuUt0mvf6exCdGF1CIiMjVSd7; 4:pvRrw09FvRu/dSEKsl1fJiF8ppqeDkpXupuE1vScQG8Sn43X2lF8y5heZx0HF7CGN6zjHOi442C1pxahZvmHYzyQ1u9RspiH7hc7AljrDKjJKX4YKYj8dwERMBRkDaYn97JqFxCTZm8snCt687D+SflhyDMzkc3A7JStY13d5BHgW1MNgCSAV+TRVmC6Uj+7kkr7Xsod9kwubTWkLkNYYhkjn4TVUzS4vnesfxj8UW2DA9ZDEUkrDLW5dDuDnPQriCX0IFLsk4tzIT4yFkq3NkvqzgVN+6MEUZbSXXDLqWs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231075)(2400081)(944501161)(93006095)(93001095)(6055026)(6041288)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR1201MB0076; BCL:0; PCL:0; RULEID:; SRVR:DM5PR1201MB0076; X-Forefront-PRVS: 05641FD966 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(376002)(396003)(39380400002)(346002)(199004)(189003)(6916009)(2950100002)(6666003)(7736002)(305945005)(5660300001)(1076002)(6486002)(6116002)(3846002)(53936002)(86362001)(51416003)(16526019)(81156014)(7696005)(52116002)(186003)(26005)(575784001)(8676002)(97736004)(59450400001)(386003)(50226002)(53416004)(76176011)(8936002)(81166006)(25786009)(36756003)(316002)(478600001)(72206003)(47776003)(50466002)(68736007)(16586007)(48376002)(450100002)(66066001)(4326008)(2361001)(106356001)(105586002)(2906002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR1201MB0076; H:fx8.amd.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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR1201MB0076; 23:XOl5DBs+jrpofSum+/cHTj9h46OPp71CIWoo4NE?= =?us-ascii?Q?QRwPQxETqZi/6Xq3zN8CqYrmhrm5LeaCuDj7HnpTjucF53UeLzVvXP9aUtPn?= =?us-ascii?Q?uYPl7/mjhKcZ2n3f6MQbdg6wXYo46Jie9vZpCI/HX4mtusZDylS/jk9f6BLv?= =?us-ascii?Q?0m594TxcfwdpSQ9YFTod0pAxo2KL5E5tQ6qtP/vXoz6A4dSf3JGGDQnSPjkC?= =?us-ascii?Q?Gh88aPDIASIWp1IdxjZUalitHCSDlOhP+si5AWfAF8a1BGw8FmORR+IANE2u?= =?us-ascii?Q?T3MgXdKS5Fe6oCNKmgZIxRFAh63Cp76+syT0USpFuLXipfvHLWfC+FssPStV?= =?us-ascii?Q?oSfzoUUldIP0Hk2FoUnS7TZ8dLMSdUUvw6BETRCBZAsoV70m8gz+oC79710m?= =?us-ascii?Q?nrFOaUZPYX0PZbWbzLw9ywLcrwMEn2PEBPeGMb4QOjNw3mfSpuOH+58+2S2J?= =?us-ascii?Q?VR+OJlsXgOwTfJqdPcZy8diwMWy2rwqTaa8PxJz6KsG4oA0MfPsUCfrPEKFd?= =?us-ascii?Q?XxJZhBfjUJQmJC9q+e386il/k+BaUKZ6E340mIAqx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XEeRbCSTjo4vwraMvOC+dOhzDn23bnccdTlO0Wtuf4V0PRohpObn1xnYu0TODu5luwPrlkG5Rjhddd0fBAJTUHq0cA9LsDCBd0zeKTW/66+btetkYwqnFZWRTl0FgO7VUsq+8seoNa3GYmX7/G5w9CX2SlqZAJL9iPAIHReEL69CJpXA==; 5:LJrOZC3vJGlHir2gJS/y20O1qYmKnj8o8e/LTscBKVEsM+UI1MflU5KiFvVfJAJNPiLTjvjoGakgxJivvlA2TfZ2Rn0HiOc2hutJO7sbT6jsgLRyza0zpNC3Ho9BEm66pqdesck2eZ1HAPsmEjtt/Ejek4RKcfKPkNrd1vIygzc=; 24:Q0GnRSn5yeaZyPTJkHwVaOTlgVLeze7RQC/nmXgzjGYxgqSXCQpn96ykZ9CLrkAKl5YDF8drMS8v7LDFuLWotEH3fyZhtalakRJnVObPlUw=; 7:N76axoG6pOWzg5jjHfZW9J9hUpGsOpzVVMCoBFrQTwF9wQZpMVxuFr0j1FbcLepublFyCRR17uY6HHp3kqJf/e87W4FeUXJ9MBCoVAT8JmMfvj/0FjnogA/PCpwuCEt8vR/K2PEKYdSYASvflxBl2H47PdoI2YCO1GorVrgczM81Jlykth3of/+XwjcleUdNAveTWJyoSKNeDQpbF3jDcySq4m5ZeJd9eE8z1n+UmxGc6MB7H5+1fZkr0zCjddFU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0076; 20:WSDMdi/xtL8yBVoWWmmLjOg15I2iF5TTYFIU253fS8+qqLZe86FASDv4/MrH+JhiawcXA3wGw5A33Y28tNKQ0mvo4Gm4wfnlmjfsoLvm8PwLsrkMe0YtQndvWcjehBSYXEZS3zTBMaQRBiJiNnI2Ec6dj+TuWp0f+bbkdVXdxKPsFKsVBeMYYwAiDeigSrRJUOTqBdh8bLXWIcr9VIjs9X//fv5T78sd+IF2k/jRK/uIKpWkG7yH2WtkpvKAj8SY X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2018 18:29:35.7292 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7cd49539-cb1c-4460-b65e-08d564eac0db X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0076 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom St Denis , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Tom St Denis --- drivers/gpu/drm/ttm/ttm_execbuf_util.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c index 373ced0b2fc2..fa44f7b15285 100644 --- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c +++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c @@ -139,12 +139,14 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket, */ ttm_eu_backoff_reservation_reverse(list, entry); - if (ret == -EDEADLK && intr) { - ret = ww_mutex_lock_slow_interruptible(&bo->resv->lock, - ticket); - } else if (ret == -EDEADLK) { - ww_mutex_lock_slow(&bo->resv->lock, ticket); - ret = 0; + if (ret == -EDEADLK) { + if (intr) { + ret = ww_mutex_lock_slow_interruptible(&bo->resv->lock, + ticket); + } else { + ww_mutex_lock_slow(&bo->resv->lock, ticket); + ret = 0; + } } if (!ret && entry->shared)