From patchwork Wed Aug 16 07:20:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiangliang Yu X-Patchwork-Id: 9903303 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 785FA60231 for ; Wed, 16 Aug 2017 08:56:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 704F82898F for ; Wed, 16 Aug 2017 08:56:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 653F2289A5; Wed, 16 Aug 2017 08:56:43 +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 BDC662898F for ; Wed, 16 Aug 2017 08:56:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D8536E413; Wed, 16 Aug 2017 08:56:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 4796 seconds by postgrey-1.35 at gabe; Wed, 16 Aug 2017 08:56:40 UTC Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0075.outbound.protection.outlook.com [104.47.32.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id BDD396E413 for ; Wed, 16 Aug 2017 08:56:40 +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=jeoZxyKS/J/TCIqM8ZKwZI2qCtjaeA5zZb8LwPD95Iw=; b=FkhAsP3FEIihGK7xt7FP0yjyP3iZGrCKR8hB1zhtrju1uVOuAzmHpRrlq1J+5du6KaewD+cmfLUpACL5coPPlMLHCnWUfIb+VbOeOebx2uUBXDFdwxyLAlfvcHbBVPuIpDJGNs/yTWG9Eaa+gsj3VeVlw7pSR8l4RBxZpTQ6oBE= Received: from SN1PR12CA0025.namprd12.prod.outlook.com (10.162.96.163) by MWHPR12MB1456.namprd12.prod.outlook.com (10.172.55.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1341.21; Wed, 16 Aug 2017 07:20:56 +0000 Received: from CO1NAM03FT064.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::207) by SN1PR12CA0025.outlook.office365.com (2a01:111:e400:5174::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1341.21 via Frontend Transport; Wed, 16 Aug 2017 07:20:55 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; linux-foundation.org; dkim=none (message not signed) header.d=none;linux-foundation.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 CO1NAM03FT064.mail.protection.outlook.com (10.152.81.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1341.15 via Frontend Transport; Wed, 16 Aug 2017 07:20:54 +0000 Received: from SCYBEXDAG01.amd.com (10.34.11.11) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 16 Aug 2017 02:20:52 -0500 Received: from yxl-dev.amd.com (10.237.74.60) by SCYBEXDAG01.amd.com (10.34.11.11) with Microsoft SMTP Server id 14.3.361.1; Wed, 16 Aug 2017 15:20:48 +0800 From: Xiangliang.Yu To: , , , Subject: [PATCH 1/1] drm/ttm: Fix accounting error when fail to get pages for pool Date: Wed, 16 Aug 2017 15:20:46 +0800 Message-ID: <1502868046-32511-1-git-send-email-Xiangliang.Yu@amd.com> X-Mailer: git-send-email 2.7.4 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)(6009001)(39860400002)(2980300002)(428002)(189002)(199003)(5660300001)(101416001)(50226002)(77096006)(478600001)(53936002)(50986999)(53416004)(8936002)(356003)(305945005)(72206003)(81156014)(81166006)(2906002)(2201001)(4326008)(50466002)(47776003)(8676002)(106466001)(105586002)(86362001)(68736007)(626005)(48376002)(36756003)(5003940100001)(97736004)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1456; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT064; 1:ubH6KQFlem+quW9yNe5FgFdYDe5fQQ3tIsVbvTBhZDncoLzhVWR8HpnW8GPzUek2IJPB60gtAeGzx/WVzUDNjgKort9Dl2b+ZrjK2RCgpdxUVKKok9zE2CnnrZt7he6m X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c15cfb0b-dc8f-4c2f-377c-08d4e4775562 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR12MB1456; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1456; 3:m5lwtUtUtUFw6Pgm/74YvLd4FGmBFnO4uZfRIaeImg925qXOCU1JWt3hc3fAs9SVJhSPgFAddpBLKTAQ6QWvACKsA2/J6A757QgIl05rrYMrZCaaOguSWNOJ+nG0BVkRXsJGSQeKB0fJFzrgqHwk3yN/VnYhPPBrZDxy2jTdF+6JPFfwzCsuFmJOlXcxIWP3oVuOeyo52ZqvGrXP4i/0/jhMo+wJIN0iIJ5B/MUAPU8ui130LegdlJLdTmOaZZCRkjDjHMyBJRfErckYwAv6O1Gi+gkjxg/f1qaFZl3KSnlCxq1RVWMj0e/MGQ/vs6BgK8slrJsLh2cunj6mFcdz1Bk9Ou0YJSfvABLBadK/TM0=; 25:nVK07eg6SDgCcpp+n6sDTJ983DySas4LKmU9EH1CA6JYwDTRxZbU2jksR/EJNZwv1mcVF+hoAT6CrBfpb9Ho/b5pSCU4ncLH2oINroY/8s/QLeIhXbqb+KeoipulAVXDP4i/Il97zHqZuZLT/w75lJkNzqFGtOJEHlkEUO04hl5tkM4bqHNrVOMraL3ZT3iA3PXtcgmMTe/oFRaMmuRQuzNu0G89nsBI3m4stULlbuvpBK+o1ehOcE093mCaZEQwVuqeB+7wX/S25JVho2dH586PxPV5anbzOpK2myk0KyYaeQ6qcqdujAzKh9sW8ywF3AXwiAGRwBNPf5in36X87A== X-MS-TrafficTypeDiagnostic: MWHPR12MB1456:|MWHPR12MB1456: X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1456; 31:A9FsmUUG9OgOoXiVCSc0U2nU5aYrpZKPTHl5aCoav/hx/7NgYRoofXquIGOsSXb3KnPI8rq8TfjhHhfJEtTXMQI4Nw1FrpHoYHVTDd+7wClMGzh/ApXxGVIqoh4sE9tNwUQ1TUK7J3w9pcUEg++lnI0VewSCehteyyB6kthRpGpspCv3Sf8nc5wyl0iCfkUWSwWXbFjOFMSAFl3w2heL8XIX+RiYl9rOQniZb+yBMtg=; 20:J1VPIddx8yjMiW4mcb/+2B0ANJFf904XeM9SkIlw1xYBdj0qEmupfHJIZPhvMB033KV5SP4Bt73nY0pq9tJMGH/5VadEyuXcHTIjYkUSlybNkBxzTpSIApzbyqfkXYuvrnoQgPNneKXAdyEX+VYx+w18puSxWs8Qi0yLRslRp1PoV5KpQHmP5ToBaVjrkAdrbUCx1jvoZ54wPfX894gb3QmvEZN71Wa0K8GW4PPfXDR2GhA5olKkU/syc6FdJL6esS7OTuomSVqyDFmnbX+IVf+Ylh/NNjbs84w/OSLZ3Q2IZjEBMb8eOGxyUbwf14QpqXP8JLq9IUZfIf4Qv7FM6yN7Jhqdc7v0pSxo4YRwro6kqQj2S3wo6DifcyGf0DzNBpdlG8U7+srT2LMfY1DSxpOg9xTgHBfPLnJiO0OI2oB3KW+XJBnIdYAUouMyByfELn30a+b5phF2vb8IuNfHEcAn0/eav2O36lD1jpTCGV0fkUoM4sLDNhYsOwE2JkzP X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(13018025)(8121501046)(13016025)(5005006)(100000703101)(100105400095)(93006095)(93003095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR12MB1456; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR12MB1456; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1456; 4:ZUCX3zVLfKHnlcp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nosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1456; 20:z4PZGw7NFqSsAmGo9yGz27R3fmjsahBjio/KmBRkLIeIU2c6qkUVqpSbJBhe4Ippb0rdLAEE5Z+vqihOmQBasbCEwZxZ/ecxTT9OSrMowrtlI3AefWvhKG4QZ9BFQJ+F52iMJ+A8DKwLfQG7V5jiwvrGlpCtXgXs+lwY2my6IoopmtUYI33Q8r6vAxU07/z3NAijA6M4eChcGxOWYiVydl3RLQPYyPbzeH08cg8Scn4XUnD2RAO4th089aISuz6R; 23:88YSa5DwrHYsXl+mnJgqU/lr/5To2Mv3Hwju8fx04MEWizgPBJz+A0U5z+kIY1jqgOVCcwSzu6j+JAC1wv9mFZpBCdUr3E53X+zscsoT4OVvLFnQKxFF4AYnzhGEDf1X05G4ftF5B3W7KimkFLqVMA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2017 07:20:54.8479 (UTC) 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: MWHPR12MB1456 X-OriginatorOrg: amd.com Cc: "Xiangliang.Yu" 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 When fail to get needed page for pool, need to put allocated pages into pool. But current code has a miscalculation of allocated pages, correct it. Signed-off-by: Xiangliang.Yu --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index eeddc1e..8715998 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -615,7 +615,7 @@ static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool, } else { pr_err("Failed to fill pool (%p)\n", pool); /* If we have any pages left put them to the pool. */ - list_for_each_entry(p, &pool->list, lru) { + list_for_each_entry(p, &new_pages, lru) { ++cpages; } list_splice(&new_pages, &pool->list);