From patchwork Sun Oct 6 00:37:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 2992061 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D37979F170 for ; Sun, 6 Oct 2013 00:37:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 072A420254 for ; Sun, 6 Oct 2013 00:37:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5BFA020251 for ; Sun, 6 Oct 2013 00:37:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 71BCDE6174 for ; Sat, 5 Oct 2013 17:37:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by gabe.freedesktop.org (Postfix) with ESMTP id 4132AE5EB4 for ; Sat, 5 Oct 2013 17:37:39 -0700 (PDT) Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r960bXQk030941 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 6 Oct 2013 00:37:34 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r960bVu9024565 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 6 Oct 2013 00:37:32 GMT Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r960bVb3019231; Sun, 6 Oct 2013 00:37:31 GMT Received: from elgon.mountain (/41.202.233.186) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 05 Oct 2013 17:37:30 -0700 Date: Sun, 6 Oct 2013 03:37:23 +0300 From: Dan Carpenter To: David Airlie , Jerome Glisse Subject: [patch] drm/radeon: tweak a timeout condition slightly Message-ID: <20131006003723.GB16592@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Cc: Alex Deucher , David Howells , kernel-janitors@vger.kernel.org, Christian =?iso-8859-1?Q?K=F6nig?= , dri-devel@lists.freedesktop.org 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: , 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 X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 The code was supposed to loop 10 times but it loops 11 times because it uses a post op instead of pre op. Using parenthesis doesn't affect how post ops work. Also I have clarified the comment. Hopefully I understood the intent correctly. Signed-off-by: Dan Carpenter --- Static checkers stuff. I haven't tested this. I was auditing for post op vs pre op increments. It turns out that some people always put parenthesis around increment operations for style reasons so it's also possible that the intent was to loop 11 times. diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index ddb8f8e..fc6e9f4 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c @@ -180,11 +180,10 @@ void radeon_fence_process(struct radeon_device *rdev, int ring) */ wake = true; last_seq = seq; - if ((count_loop++) > 10) { - /* We looped over too many time leave with the - * fact that we might have set an older fence - * seq then the current real last seq as signaled - * by the hw. + if (++count_loop > 10) { + /* We have looped too many times. Leave despite the + * fact that we might have set an older fence seq than + * the current real last_seq as signaled by the hw. */ break; }