From patchwork Wed Jan 21 10:35:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jammy Zhou X-Patchwork-Id: 5676091 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C1F549F357 for ; Wed, 21 Jan 2015 10:01:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B70E82026F for ; Wed, 21 Jan 2015 10:01:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DD1E220503 for ; Wed, 21 Jan 2015 10:01:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25C146E252; Wed, 21 Jan 2015 02:01:50 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0130.outbound.protection.outlook.com [157.56.110.130]) by gabe.freedesktop.org (Postfix) with ESMTP id 558166E252 for ; Wed, 21 Jan 2015 02:01:49 -0800 (PST) Received: from BY2PR02MB201.namprd02.prod.outlook.com (10.242.232.12) by BY2PR02MB314.namprd02.prod.outlook.com (10.141.140.147) with Microsoft SMTP Server (TLS) id 15.1.59.20; Wed, 21 Jan 2015 10:01:47 +0000 Received: from BLUPR02CA035.namprd02.prod.outlook.com (25.160.23.153) by BY2PR02MB201.namprd02.prod.outlook.com (10.242.232.12) with Microsoft SMTP Server (TLS) id 15.1.59.20; Wed, 21 Jan 2015 10:01:46 +0000 Received: from BN1AFFO11FD018.protection.gbl (2a01:111:f400:7c10::167) by BLUPR02CA035.outlook.office365.com (2a01:111:e400:8ad::25) with Microsoft SMTP Server (TLS) id 15.1.59.20 via Frontend Transport; Wed, 21 Jan 2015 10:01:45 +0000 Received: from atltwp02.amd.com (165.204.84.222) by BN1AFFO11FD018.mail.protection.outlook.com (10.58.52.78) with Microsoft SMTP Server id 15.1.75.11 via Frontend Transport; Wed, 21 Jan 2015 10:01:45 +0000 X-WSS-ID: 0NIIUIU-08-OE4-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2B590BD8673; Wed, 21 Jan 2015 04:01:42 -0600 (CST) Received: from SATLEXDAG06.amd.com (10.181.40.13) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 21 Jan 2015 04:01:47 -0600 Received: from SCYBEXDAG04.amd.com (10.34.11.14) by satlexdag06.amd.com (10.181.40.13) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 21 Jan 2015 05:01:43 -0500 Received: from jammy-System-Product-Name.amd.com (10.237.74.196) by SCYBEXDAG04.amd.com (10.34.11.14) with Microsoft SMTP Server id 14.3.195.1; Wed, 21 Jan 2015 18:01:36 +0800 From: Jammy Zhou To: , Subject: [PATCH 2/2] dma-buf/fence: don't wait when specified timeout is zero Date: Wed, 21 Jan 2015 18:35:48 +0800 Message-ID: <1421836549-4539-2-git-send-email-Jammy.Zhou@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421836549-4539-1-git-send-email-Jammy.Zhou@amd.com> References: <1421836549-4539-1-git-send-email-Jammy.Zhou@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=Jammy.Zhou@amd.com; X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(199003)(189002)(53416004)(19580395003)(50466002)(92566002)(46102003)(48376002)(77156002)(62966003)(19580405001)(50986999)(76176999)(86362001)(106466001)(97736003)(229853001)(87936001)(50226001)(105586002)(101416001)(2950100001)(36756003)(77096005)(64706001)(68736005)(47776003); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR02MB201; H:atltwp02.amd.com; FPR:; SPF:None; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-DmarcAction-Test: None X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(3005004);SRVR:BY2PR02MB201; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:BY2PR02MB201; X-Forefront-PRVS: 04631F8F77 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BY2PR02MB201; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2015 10:01:45.2207 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96; Ip=[165.204.84.222] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB201 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR02MB314; X-OriginatorOrg: amd4.onmicrosoft.com Cc: alexander.deucher@amd.com, christian.koenig@amd.com 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When specified timeout is zero for fence_wait_timeout, just check if the fence is signaled or not without wait. Signed-off-by: Jammy Zhou Reviewed-By: Maarten Lankhorst Reviewed-by: Christian König --- drivers/dma-buf/fence.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma-buf/fence.c b/drivers/dma-buf/fence.c index e554111..50ef8bd 100644 --- a/drivers/dma-buf/fence.c +++ b/drivers/dma-buf/fence.c @@ -159,6 +159,9 @@ fence_wait_timeout(struct fence *fence, bool intr, signed long timeout) if (WARN_ON(timeout < 0)) return -EINVAL; + if (timeout == 0) + return fence_is_signaled(fence); + trace_fence_wait_start(fence); ret = fence->ops->wait(fence, intr, timeout); trace_fence_wait_end(fence);