From patchwork Fri Mar 1 00:43:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 2201751 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 1B482DF24C for ; Fri, 1 Mar 2013 12:56:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 01B40E6510 for ; Fri, 1 Mar 2013 04:56:39 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 91B93E673F for ; Thu, 28 Feb 2013 16:44:27 -0800 (PST) Received: by mail-pa0-f54.google.com with SMTP id fa10so1454351pad.27 for ; Thu, 28 Feb 2013 16:44:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=EU5wZuPgFWyAWGWRWC3ULxzwonM9j4hOX92njuF+k9E=; b=N5hO/r404b3zOhQWQfWry3jaIXe5q+ARQbqUf1pn+DN4HKxHP6l3qWKelBJcXJJ58A SvtsWxrvpT8h5pnVfmKLDgobPEQEfSyyyNDc1kH/NZL42vLJsnMUTXW8KK9jTh/98gPY 81MH43TMfoG5U7W9vcnfaFOY3FrSp0wO7AXfuRf3atyX61gCiAPvfo6Jpo1U+3vk1g5z SgnCDdkqme14wqilXXpurbcQJn/7nRfip7XXa3lFqexRAdRxu1t2hXevwevOTGdNfvh1 TCthGGj9mpQse/Gxi/CVQj/fymfdzB1UGAYNUE88ILAlwoj8RArSdtX+R5rVdWQdayqC bpnw== X-Received: by 10.66.27.199 with SMTP id v7mr15676860pag.215.1362098667434; Thu, 28 Feb 2013 16:44:27 -0800 (PST) Received: from localhost.localdomain (c-24-21-54-107.hsd1.or.comcast.net. [24.21.54.107]) by mx.google.com with ESMTPS id dx17sm10914892pac.17.2013.02.28.16.44.25 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 16:44:26 -0800 (PST) From: John Stultz To: lkml Subject: [PATCH 30/30] staging: sync: Fix timeout = 0 wait behavior Date: Thu, 28 Feb 2013 16:43:26 -0800 Message-Id: <1362098606-26469-31-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> References: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> X-Gm-Message-State: ALoCoQkdHcKIhbxD2PSzzYbByprDZQVTPNDYVdvrHHfvySKW0RLQkMqltMKU8eyE6Euw4s9ab0Ox X-Mailman-Approved-At: Fri, 01 Mar 2013 04:21:20 -0800 Cc: Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Jamie Gennis , Greg KH , John Stultz , Android Kernel Team X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Jamie Gennis Fix wait behavior on timeout == 0 case Cc: Maarten Lankhorst Cc: Erik Gilling Cc: Daniel Vetter Cc: Rob Clark Cc: Sumit Semwal Cc: Greg KH Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team Signed-off-by: Jamie Gennis [jstultz: Added commit message] Signed-off-by: John Stultz --- drivers/staging/android/sync.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index 9b8b0e9..b9bb974 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -616,10 +616,12 @@ int sync_fence_wait(struct sync_fence *fence, long timeout) return fence->status; } - if (fence->status == 0 && timeout > 0) { - pr_info("fence timeout on [%p] after %dms\n", fence, - jiffies_to_msecs(timeout)); - sync_dump(); + if (fence->status == 0) { + if (timeout > 0) { + pr_info("fence timeout on [%p] after %dms\n", fence, + jiffies_to_msecs(timeout)); + sync_dump(); + } return -ETIME; }