From patchwork Mon Jan 29 13:55:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "StDenis, Tom" X-Patchwork-Id: 10189743 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 CC3C96020C for ; Mon, 29 Jan 2018 13:55:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAB69209CE for ; Mon, 29 Jan 2018 13:55:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF90022299; Mon, 29 Jan 2018 13:55:36 +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=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 6D3A2209CE for ; Mon, 29 Jan 2018 13:55:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 216136E4A8; Mon, 29 Jan 2018 13:55:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0080.outbound.protection.outlook.com [104.47.38.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id B18966E4A3; Mon, 29 Jan 2018 13:55:27 +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=9LjKK7dyXi2MoUEDpr+z8C1xIlpzFjoNHzH2WwxhlVY=; b=NPeaAybD4XGdVzmvy9RsAH3no9FF7VhOBtrxSkLpl5g2fXu5voEbAIkANW6fMhmIg4+GzhqqpZg8i5kskta0v5GQCU/46NV6F9N5/Inzb5Mjbu1nbxQIcoUwSL0YPSY6SDYah0foDQn0bW3dcX5q41RTZMIsgr6fXR4DsOtUwZM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Tom.StDenis@amd.com; Received: from fx8.amd.com (165.204.55.251) by DM5PR1201MB0075.namprd12.prod.outlook.com (10.174.106.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Mon, 29 Jan 2018 13:55:25 +0000 From: Tom St Denis To: amd-gfx@lists.freedesktop.org Subject: [PATCH 01/12] drm/ttm: Fix 'buf' pointer update in ttm_bo_vm_access_kmap() (v2) Date: Mon, 29 Jan 2018 08:55:02 -0500 Message-Id: <20180129135513.22538-2-tom.stdenis@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180129135513.22538-1-tom.stdenis@amd.com> References: <20180129135513.22538-1-tom.stdenis@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: CY4PR14CA0027.namprd14.prod.outlook.com (10.172.162.141) To DM5PR1201MB0075.namprd12.prod.outlook.com (10.174.106.17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5b439849-d4dd-46bb-ab06-08d5671ff30d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR1201MB0075; X-Microsoft-Ex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iSFGHqgDDdXYHcE057UAaIpv7iHPd2t3luDdn8dCyv8cqNse9knTuFy49ceS6skQ61x13dW0iGhXCAN78pwgkvyRCxau3vFENP820U1yuPVU3O91p6Gy6zcnD8TnkHHWS5SP1dohlqqmnanNdSZhTfze3I8CRf7yJ/QJVzG/N9wPlklVbKoTyMghMDwOcTlGlScwAwLud6hOkozvlvhyBhC9p6u9jolH5BpSHgMMMAYNgZOfpokzTyGhD8+O0zQgbgX+ZY6zkbtViHGGZ1UL5mKiA/6jefoz77QLeI1MERA1w8IFHj/4DFWCRmuG80cTNCayZDA99g0DrtGDwf3LYqB8fkXmu3tgbTzjA6SMc2YgAFQslA5KCOISZErGqIlVDJlL5; 4:HJtTm/nfayZl/Oz1LwR4Pgo54/y9uR96QpD2WCplRZkwiEjeNVAuXi2sOYgcz8Muo4YTN1MbPNWsn1p6SzR08eh5AjIrQEVJzTOCCXzf6pqCVGCN0mwt/yKNOzAFBOvHAsmmkiesKtJ9qmh/VX4IC2fZc4TtAWVgvmG9KoLqeU5fcu49UZNxOtt08ZNYA4H5NazwAun54oFPENAIaJpw1P+af8ZjHMA3PzwZY5d4e1hqZHd4D/V+PFoMI6WLqvMTYRUxdF3Xqr5VNNeAitSNWQwajR+BafI6fuE4aPz+xik9/3lmUdI7eFbhNMDf+d932H9qZtprYpFy5j7g7wQVNA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231101)(944501161)(93006095)(93001095)(6055026)(6041288)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR1201MB0075; BCL:0; PCL:0; RULEID:; SRVR:DM5PR1201MB0075; X-Forefront-PRVS: 0567A15835 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39380400002)(396003)(39860400002)(346002)(366004)(189003)(199004)(59450400001)(76176011)(478600001)(7696005)(450100002)(7736002)(52116002)(6486002)(23676004)(86362001)(305945005)(2870700001)(53936002)(66066001)(5660300001)(72206003)(47776003)(4326008)(386003)(81166006)(97736004)(2361001)(25786009)(2351001)(106356001)(316002)(6666003)(8936002)(2950100002)(16526019)(2906002)(81156014)(68736007)(6916009)(186003)(36756003)(105586002)(8676002)(53416004)(50226002)(1076002)(3846002)(6116002)(50466002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR1201MB0075; H:fx8.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyMDFNQjAwNzU7MjM6azcwRk85YUdFNW9TY0dzNHNZc0hMazM3?= =?utf-8?B?Wk5RaWlaVWUwdG54WUdJSFRmVUNIbDEyYWl2aXBBMDlJbzBqQURaMWswRHJG?= =?utf-8?B?MG1GOUJFRDN3TW9pU3lyd0cwdStxWHozMkhqNS90NXhEYzJISDI1TVIrdTFL?= =?utf-8?B?NE5kWms5cnV3T1p5aG44MkZwNnVJTmdTaFhzQTJ3V0o3QWhsR3FvVkt5YXRa?= =?utf-8?B?VE5qSHBwNnpnMFhZY2ZlSkI0Z1Q2eEhwOGt0U0FXb3JrbTlGbW5abFArb01x?= =?utf-8?B?VzdFdEhWZkJkdkhtS09WMzExZFlRZUpMMmtJWTJyTk0vNzgybVYvYVl6S0E5?= =?utf-8?B?RVBydXM1VDd3b0RRbjFGUXlUZ3VidjJZWm9RaFVOOVBVUUkySFJ4S0syb1VM?= =?utf-8?B?WEtWalNwUk14Z2ZBNWdYOEcveFJzL1JHWC8vY0VyZk0vaVVxbW5xZlFLUjR2?= =?utf-8?B?eGQ0c1BKWG9YUndrVERMVytCQzV6cGQxWTYzRWh4NndrMTZ0c2l0WVBBdHdG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o1+rzEaQOEVh83Gt8zZAF8hsTx44pbjB6WLQFURDd35Bew8M75szcbqFnXd9mBI8FO87iLLltT0q0Q8zT/ukBBRc++1omc636/9pAJ87Q/I3fyWahgpaws4igJ7zJQ1qXEdeeckwFk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0075; 20:JURrsBdviOv+CCTZmywj+7jldZLVufZjv6wuO5ddme2zae5eAPp6Cb61C9o52Hs+zbkpAKvFmX999w5VeXpq6Ptp1WMNxbQfsGnYAw+elwJvcCNNYdeQvpYrvlRVRDeIfgu+os9Tqz5hGgrkjGkGl/iJg8GzR9ZdGbT40Gsd/4n1uy8eQVnPjS2WnTNZ0AFImAal0nCWQ94xzvhhCwBTpb3NWWejrUgCd1jAomnTdB/c+9SlUgYBtbptIkh17nHY X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2018 13:55:25.5637 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b439849-d4dd-46bb-ab06-08d5671ff30d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0075 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 The buf pointer was not being incremented inside the loop meaning the same block of data would be read or written repeatedly. Signed-off-by: Tom St Denis Reviewed-by: Christian König (v2) Change 'buf' pointer to uint8_t* type --- drivers/gpu/drm/ttm/ttm_bo_vm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index 08a3c324242e..60fcef1593dd 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c @@ -316,7 +316,7 @@ static void ttm_bo_vm_close(struct vm_area_struct *vma) static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo, unsigned long offset, - void *buf, int len, int write) + uint8_t *buf, int len, int write) { unsigned long page = offset >> PAGE_SHIFT; unsigned long bytes_left = len; @@ -345,6 +345,7 @@ static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo, ttm_bo_kunmap(&map); page++; + buf += bytes; bytes_left -= bytes; offset = 0; } while (bytes_left);