From patchwork Tue Mar 6 03:09:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Monk" X-Patchwork-Id: 10260599 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 38292602C8 for ; Tue, 6 Mar 2018 03:22:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28ADB28BD4 for ; Tue, 6 Mar 2018 03:22:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D04928BD9; Tue, 6 Mar 2018 03:22:33 +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 7D79928BD4 for ; Tue, 6 Mar 2018 03:22:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2375C6E522; Tue, 6 Mar 2018 03:22:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0057.outbound.protection.outlook.com [104.47.33.57]) by gabe.freedesktop.org (Postfix) with ESMTPS id 93EAA6E522 for ; Tue, 6 Mar 2018 03:22: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=DmtiRcolY61MyL71y6r/a2HU8P9MkG+EuAH+Zp6eItQ=; b=bu/TN/lB5EI5aL8CTGHSogZKDlGkFYVS99Sq+qhAlEQ+sQNH5O7UtiB70kSS68IH7jHy8ltWojhNRal8e6wT0NZu+a6BYZIX+wuoaJLK2oYxxYLloIfdDXqazBUYmSF57Hn26MQmdaqC2cRXvg1qHj6Kpc8dCKkYqbku5Fae8sU= Received: from MWHPR12CA0032.namprd12.prod.outlook.com (2603:10b6:301:2::18) by DM2PR12MB0029.namprd12.prod.outlook.com (2a01:111:e400:3c11::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Tue, 6 Mar 2018 03:22:25 +0000 Received: from BY2NAM03FT060.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::201) by MWHPR12CA0032.outlook.office365.com (2603:10b6:301:2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.548.13 via Frontend Transport; Tue, 6 Mar 2018 03:22:25 +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 SATLEXCHOV02.amd.com (165.204.84.17) by BY2NAM03FT060.mail.protection.outlook.com (10.152.85.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.527.18 via Frontend Transport; Tue, 6 Mar 2018 03:22:24 +0000 Received: from monk-build.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.382.0; Mon, 5 Mar 2018 21:22:18 -0600 From: Monk Liu To: Subject: [PATCH] dma-buf/reservation: should keep the new fence in add_shared_inplace Date: Tue, 6 Mar 2018 11:09:10 +0800 Message-ID: <1520305750-29001-1-git-send-email-Monk.Liu@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)(376002)(346002)(39380400002)(396003)(39860400002)(2980300002)(428003)(189003)(199004)(2351001)(6666003)(6916009)(106466001)(104016004)(316002)(7696005)(105586002)(51416003)(36756003)(2906002)(53416004)(356003)(305945005)(8936002)(77096007)(81166006)(81156014)(26005)(53936002)(186003)(47776003)(478600001)(1857600001)(8676002)(50226002)(72206003)(48376002)(50466002)(86362001)(68736007)(97736004)(336012)(4326008)(59450400001)(16586007)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0029; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT060; 1:SXApXPOTZ4ICKB96Zq5vc9um8wkx7C/O6Da3vOonVuodAN7omFFpHjbebGqBz1Ty/t1yYdMd/R3X7sYhGfcbxC1UFc58sc5nYn2mTSaXWa03HoIw2oYOtDeCVcFAa3Dc X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0b54523c-8af1-467a-a6b1-08d583117b54 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603328)(7153060); SRVR:DM2PR12MB0029; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0029; 3:fUjCLaFz+U6VyJHKAHat6Sezb+hbM4pF6WbXIH6lhumD7ULg8kbJIiQZV5/jHgoMHoFK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FUvvPbrZHFM4K8r0M1585Rq6QsHqOQErQzeU9gt/J/hUUITOauExEEZMOTP9qbPkYyGEGSdelI5Gu4eGsKZoibSYAs+YISSWr1UJj4lCo6VfqoU0oZGohgkcpqsJR+f1m8U/qHBZ6gLGQEeYPNC/VH5NNOxBvhiU4avnD47lc20edsyAE7Xgtpj97GfkFbaKbWyfX7DsLVLIxis6VraeAeEYHXDlTofY4cUjdSrM7UE+eI2YPHw3np2sk+5OLHg9MVwSaMMfl3KW1B7M/hHKzptOpudGGqrlbYwaIlhNLYSkVo5CplB3casqlLheNeBM7omNhSHuEXA1AZ40D10r7ZkhVPpBhF0iAN4zQLM5DddE28H+IlIcxWfS92cE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(3002001)(93006095)(93003095)(10201501046)(3231220)(944501244)(52105095)(6055026)(6041288)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM2PR12MB0029; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0029; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0029; 4:KkLhhYt8PrFc0CrhJhjADPYJo26VnwGHdwahP1hYEZg2nbmaLZe81SxJlGc49rivXU/NAflDRSfjlgApQ27lXNP2ywNwrjDP4XRWlTtV4RbcG4asOSvnDX3dQcOlRJph+SW8YEPhnng9Jx5x4T4LN80FPtANfrNPCV0AnsfQI5ZDrYUkovTR4fttKw9cOjxo0j+wjQhi18IwF76OlnXJbm6ECSs5qt7uX1V1z0Cex/F9BhIbuhixlktl73tJzDgUhBamkSlC8ULWJQtj4PazgwTbe2IUaiTn2vpMuvM6TeAFxSUgPArvWysKDF6QgGzz X-Forefront-PRVS: 06036BD506 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?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9VtI7eqNE0onGDqIo4Sqvhi6kVATjaOJsxpznbmF2rPG8tJaBn9lkeVVy70MYZA0KnjjdtipSwDdvFjRdd53ngtvD+YsCo=; 7:QnnIxchrmN6tzCOOZ8JIXDPZO1GcPlkQ2JCMYE72/q4PTBllA31wxpyjYeY9jVSLU5WkEGITY/vgncLBmUgJuWwliUUMD7djN6wBVjEP3QkuYPr8rPCgut4TAbREYFjHQ5ZI+9nE+Uj+nFuX/NemujiosKgHtSHdJZUiONCOqRidQKzQlDAfjc0NNEgP7YsI2izX4OuGhtpwPOLYze1PyBBSGBwntn9jYC9r0bp9SKO7pTpbLWx/WGvoGzh8lo8K SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0029; 20:qysUBSeIfyu79jSj6diKtIsGJcBEsxAG8e4mVIXLJUW6Rs58goA0QR6S8jc5vfkCiVexvKlApkRuDCw+lQQbLAE15auSUUWe8wz3S2VnWfbsojeXsd7muCk0eV3AepnVMSXt2nCuqQhRt5O1OxfYZhDMEtBZ7cCHnYw9P0WjFWf/1F7hqo7cpHFUc6ZsQL+zmFasAT+peEqzvGXgeGI5MmGrZsS9WcYqN7dnHOmDZuxg/zkbxi44byNu1GLZPTnc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2018 03:22:24.8058 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b54523c-8af1-467a-a6b1-08d583117b54 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0029 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: Monk Liu Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Change-Id: If6a979ba9fd6c923b82212f35f07a9ff31c86767 Signed-off-by: Monk Liu --- drivers/dma-buf/reservation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c index 314eb10..29b7e45 100644 --- a/drivers/dma-buf/reservation.c +++ b/drivers/dma-buf/reservation.c @@ -118,7 +118,7 @@ reservation_object_add_shared_inplace(struct reservation_object *obj, old_fence = rcu_dereference_protected(fobj->shared[i], reservation_object_held(obj)); - if (old_fence->context == fence->context) { + if (dma_fence_is_later(fence, old_fence)) { /* memory barrier is added by write_seqcount_begin */ RCU_INIT_POINTER(fobj->shared[i], fence); write_seqcount_end(&obj->seq);