From patchwork Fri Feb 9 10:00:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10208711 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 6724A602D8 for ; Fri, 9 Feb 2018 10:01:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 415952981C for ; Fri, 9 Feb 2018 10:01:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 358562981F; Fri, 9 Feb 2018 10:01:25 +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=BAD_ENC_HEADER,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 32A0B2981C for ; Fri, 9 Feb 2018 10:01:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFD2C6E7B9; Fri, 9 Feb 2018 10:01:22 +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-sn1nam02on0080.outbound.protection.outlook.com [104.47.36.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id B89BA6E7B9 for ; Fri, 9 Feb 2018 10:01:20 +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=N8zwaZMkld8iiojDLQP9ZvONk0kma0N3KBlWvGdptdw=; b=O5N3+5tIOTaTuDNseOP7/YTakJnfycp3Dze5UP6vryOH9i9cD9Qe3/yR54fYQ6531cvf14QkOuMUJzqh0fBLyy2KKz2hN5Rl2CfhqTbijdoTmq9kLrFnaD5Grq2KbG8HRKbMfnKKR/G7I2TuPaRq+QCt/MynNJ6jYH8M0+bAL00= Received: from MWHPR12CA0054.namprd12.prod.outlook.com (10.175.47.144) by SN1PR12MB0368.namprd12.prod.outlook.com (10.162.4.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Fri, 9 Feb 2018 10:01:18 +0000 Received: from CO1NAM03FT021.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::206) by MWHPR12CA0054.outlook.office365.com (2603:10b6:300:103::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.485.10 via Frontend Transport; Fri, 9 Feb 2018 10:01:18 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT021.mail.protection.outlook.com (10.152.80.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.485.12 via Frontend Transport; Fri, 9 Feb 2018 10:01:17 +0000 Received: from roger-build-server.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.361.1; Fri, 9 Feb 2018 04:01:16 -0600 From: Roger He To: Subject: [PATCH 2/3] drm/ttm: set TTM_OPT_FLAG_FORCE_ALLOC in ttm_bo_force_list_clean Date: Fri, 9 Feb 2018 18:00:51 +0800 Message-ID: <1518170452-31111-2-git-send-email-Hongbo.He@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518170452-31111-1-git-send-email-Hongbo.He@amd.com> References: <1518170452-31111-1-git-send-email-Hongbo.He@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(396003)(376002)(346002)(2980300002)(428003)(189003)(199004)(2906002)(86362001)(356003)(316002)(54906003)(104016004)(8936002)(305945005)(97736004)(16586007)(72206003)(5660300001)(68736007)(81156014)(50226002)(81166006)(8676002)(48376002)(186003)(53416004)(4326008)(2351001)(50466002)(106466001)(77096007)(478600001)(36756003)(53936002)(47776003)(6666003)(76176011)(59450400001)(2950100002)(51416003)(336011)(7696005)(6916009)(26005)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0368; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT021; 1:/Jy5TyABQXigHZDnzNcpbTxJZri67g9K4xA9OIYrmUO9ALkUIcVjo+NDEpZzo++V/xrpEChsJ7RwK4e6LQ2qoWmlDOjJUQzwjDdaTgS8c4voQoVr7gUz+PqHn0qxSty+ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 650e5468-a5c2-4dc8-daad-08d56fa4103e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:SN1PR12MB0368; X-Microsoft-Exchange-Diagn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98S8OVxWPYVqnWh5KewLKAHMqO5DZXtPbjsNQAc9DtrEmz25buUDIXWb8a+gCfppGRQp3pr+MEGX4iX4LX0rCyhqw3Iqhqm2njGk6XQ3G0wLD8X9KpbbuFU6mh94KW3yhTux4GNQjoBCIpLPhXuYEGQVlzgBokZHLmCII7K83Ko6pIsDlwYLju45iGcujj/BKZOCBHSVMmiqSkxtyAyx2XOEkNPzmsT5GzmYIqFVW1scYWH9rWW9GjYk8Okq270ml/H+tuLDSiiPAjjKcapGf9crB2x+7oV0io0q2BwaZEorHSU+z4RaPBRcgmoDwKStk96DZPjlNPR5O8sOJpsY0Deo1mVaFqQjUTnOW0BZWhmhNRrCYJKwDezVNjHWcQv+tExMhCen4UPu6QXaY7mpPbtQi9XRV0Ct6X2JKZ8GT2gxBexQtDvgWbdJ5HfPkBuglEu1HAxxdPnAvgnjUjobS+bOM5oEVgu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(3231101)(2400082)(944501161)(93006095)(93003095)(3002001)(10201501046)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:SN1PR12MB0368; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0368; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0368; 4:Z1QJOJmlJk2FJhWa3Ye2PEHHfCKThWlIAE1tUJwU/IyUI4Hein8Shx11+J2jS2VtAaNufyHDLOB5vDTdO86VXfMHN8eqf5ayDcSgEGJcHjRoz85KWkwE3kWPdwBOw3M/B+55mUQdbRO7Cp5KiYfYjksBfGqWvDojlJjKjjS0vomj6sd3kHGn1Ejh+yPkx72/sK56uTni6c+KzPq6g6KS4rMBvOsDeOHgws7xoZ99zHqHf5ftENaC5kepx0baS4f5DS469m/pEKzCddWnZif+aTg9iAIFAT68Yb5cWyopGNkxzeJ/nFnejxiZYIsJwnBV X-Forefront-PRVS: 057859F9C5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0368; 23:C+HFZM7Ww5CVmxpIXUxgRN+SfvzPOFijTMqUD8pb1?= =?us-ascii?Q?mj+nY0MFZPm88gYXB2daqtyMPtCv1pa6ratJbA8Z8NpsQcmAcekv97HjZ5Ov?= =?us-ascii?Q?HTPD31YMcAWyKsYEuWQ70u/mXQ5qRNXVPhK06BL5NZzLbh+Av2JYy/ny4VRJ?= =?us-ascii?Q?HdppDd8Tw4bO42DJYO2nBas3rsdX32gyhf6ly6tj7i6MgeGWdAK9WR2UyP4L?= =?us-ascii?Q?DrbvT4qVXA0XGf+HMmism35wpo3FTrqrCA2IuNQJoGe8jQC2FhTbkzLEq/p3?= =?us-ascii?Q?mS/0khqbNyg1R0i1EQiLrDq7tBMswmX7ADSJ6wAbFkgTb3+2KCR6XNRS733C?= =?us-ascii?Q?Zr5PFsylHAX71mgcY77UVwKySKyh9Ohc9LBumdWKkRSmgJoYvlJMbsppRqHL?= =?us-ascii?Q?yAJUEeAitN1izh+jrk49nHgSnZxTCu1E6TBxjMnTgiR7hWwfErLknw4hCKcB?= =?us-ascii?Q?rSRRVQIcfHJn3RUKeH+nRklRrUEaNV+heCWo6j9uUGIcncH2wOzuHT59snAF?= =?us-ascii?Q?DlXXiwRA2Z+PsZuobVJ+lW56Mah66dWnmITDxIXp9nmn2e95s3TFa2Be3SxU?= =?us-ascii?Q?MIYOua1JiODkoBym1Ue5gurFUIiQ4aoZdjEqSTHnawq6az4Zji+2ReO7ornm?= =?us-ascii?Q?aJJQR2A6nTVozR8y6Mw/HPogN3KOkpAQwI/oLP99ky0AmDyefgWgoZ9vXozX?= =?us-ascii?Q?CiHsQmerGMTVMMTpDpJe7kSamG7FgRp8FzqZU+NKf+lqZllk2SGiP1yiXhgv?= =?us-ascii?Q?if1bR/yWpPhLB8Q2U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E055HLZ7MfuEYpQLq8dTOCW9EaSn6AnEecWtriQ0xsYNMAs=; 7:iU3DoXXhSeT+O+1Q63fzQy1yEpt5hvoJyIyT7GibVt/vbqLKbMNYwlqETfiFKM/cvNI4iPYxlPFdaLMi42aLKRzCvTs3Sa4lfcfm9Jh72cwHE0DJXlQXAuHkzmwRuqInJkBEqkNgPE1R8gS5apHNrqJzs1MoI3qPJ6fHOgADiIUuANKq0OvCdjSWlGf+h5CXYDCIDAl69frMw8idVTsehzk6Wyypkl9UDZPQe1APK4z4IXQzHRa/IswFr0zj3Lku SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0368; 20:9bCMc39aQ957tzff6jfHY/Rh7hzUviEPRNfuX3OrIfHi6uVEXhonWkfkr/3ICitfMplOGRiFP9w7nHVzeaOPkpIwdneBXhXv9OnvBRmGLPIaQD5NprOUdZ4GOQdOQf9Oxq+OjHVnx//EF72hkSVj8jB1mW+EHOX+k1UQTOo2H60xv5BzwUtbIp8cYqRwWu1WcPgnz2pksmIKH/P7Q3+uw81oY0NBdrq8D+T1dJxW8ln5+salzp2ExFJugpRVZ1W2 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2018 10:01:17.8792 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 650e5468-a5c2-4dc8-daad-08d56fa4103e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0368 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: Roger He , Christian.Koenig@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Because ttm_bo_force_list_clean() is only called on two occasions: 1. By ttm_bo_evict_mm() during suspend. 2. By ttm_bo_clean_mm() when the driver unloads. On both cases we absolutely don't want any memory allocation failure. Signed-off-by: Roger He --- drivers/gpu/drm/ttm/ttm_bo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index a907311..2bde372 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1344,7 +1344,11 @@ EXPORT_SYMBOL(ttm_bo_create); static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev, unsigned mem_type) { - struct ttm_operation_ctx ctx = { false, false }; + struct ttm_operation_ctx ctx = { + .interruptible = false, + .no_wait_gpu = false, + .flags = TTM_OPT_FLAG_FORCE_ALLOC + }; struct ttm_mem_type_manager *man = &bdev->man[mem_type]; struct ttm_bo_global *glob = bdev->glob; struct dma_fence *fence;