Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3958733imm; Mon, 6 Aug 2018 13:50:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf80kszBZO9eD5pzAeP3F8IkZe2lwu84smnDG2UundoItCOe+dTryOUiQnsa0EsftGrWVX2 X-Received: by 2002:a17:902:9a06:: with SMTP id v6-v6mr15658476plp.316.1533588617319; Mon, 06 Aug 2018 13:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533588617; cv=none; d=google.com; s=arc-20160816; b=0Kg9YKCX8cnEKGxvi0yNm28vCqQQKI9KAKknEa/x9CDagvXGDBqRif5tdKNhdFPZGI FV4pORoftCHIoJ5IKJ6J9WcSqJiNC678mBnK2H67TsTpo2rtK2fZQXJp6RR57VXVbUVx Jyg1NX19FmWxuhbxuQVztco5EMnMik+oXQ9CqviHZ097NPRzL9nNWmNayIoPcgXdYAOI xiVpXIJhQFsp2Zm2r3etgVPVW2xU7R6AFw+wqkVh4/3OwiSyHuhtMZ/ozTz8QQkYD0tW 9/iMlMqxQqd3QdzufkrYeRcz9NH2A0bM9ORLxdQu89beFNINFNAE8DsKJuSGLJ0r1988 oy1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=FJgiz9th4BMVyOX11V+JMAmzNBMDenfA8DcsZu9xsrs=; b=qAz5nrmSILkf+nCiBl983eYGk57WqErg3CV8xPxc4ELxoRor/I46aM5RcISl181LsR 50Tm6i+PDZviIvfeDWva49FBXees1jE121gNsVtjLFhpXR1ZBuWIZx4zdQcGnWMx68y7 eksprlb3SGewM73IcqVyuWt2HztGAF8IPQVbj7zo/nK9VKiVewLqkWgepKkKyPyPNe1f DflEHLDOHfZ0VMq8x6iwg5kmne4G6H4FjPFmLd2VufUyRPxzJHD959ZpOCu5B9IZEGI1 AP2cXnbPuIwSn5N+BJuvK2s0fVk29WykWkadtJH271rz94c7MJuR1qzp7qBl3N6NCSK9 2XcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZrlXaqZT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d128-v6si14749453pfc.211.2018.08.06.13.50.02; Mon, 06 Aug 2018 13:50:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZrlXaqZT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387870AbeHFWkP (ORCPT + 99 others); Mon, 6 Aug 2018 18:40:15 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:37093 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732544AbeHFWkP (ORCPT ); Mon, 6 Aug 2018 18:40:15 -0400 Received: by mail-wm0-f67.google.com with SMTP id n11-v6so15602369wmc.2 for ; Mon, 06 Aug 2018 13:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=FJgiz9th4BMVyOX11V+JMAmzNBMDenfA8DcsZu9xsrs=; b=ZrlXaqZTuezmmz/IRNEkWnQ8ajOjKCVSA+h82GTFt4/TlEkDaC/1nnYzk2euC1SKfb F84MbMJQheCnDz6BmJnjYhMs3n8vXHUKnxfcH9L2TFaBL18Cd5iIKSfmizO/rg39fGIp f4GocafvNg59VJ2CgOW8Te14piWYfj/AwURHSoQKrGQTca23+xj8fgAHzxqHshoarfX4 9VYt4527dkrxtnr7hbPZiS58Sf+PsyH2HrJh/+P7+W2NVkdrnXpd//tQ+gZS1Nd7tN0L IhuB54YAsTLgYMvgosr50v5Q5pCLat7EfG4hGb0GNxLYF3fpFO1wXwcr5Tt6pQmNWQfv O9OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=FJgiz9th4BMVyOX11V+JMAmzNBMDenfA8DcsZu9xsrs=; b=pETqHkPBFk3B/CukJks7ligKDWGyyskTrx/0izG8gCEyTBEfRe5YcW63YcJNMjtuvu 7i1FFHX6YKbQqpecAlKI2ni2wpafc7H07SDQTA71zGXJO+mS9+rRj/Zb/GsqFZp1OZG6 sA1e+QbwEbxWE+2TxXsBfTpPzjzjQBdL0UYrT9wovte9r+Fva4sJdR66600jfaI0oALs dnueVWNjHO0sJ9bb0XaqKUehxSrGS3Xc2gYI2OcC4gBkqzzhZzx8B5o265gvX/4Oettt qW9iBNg4lN6stBh90QMEck5vWl95v/YlhKmlW2vhgz0vUT6aiZvQATPJD5SsMCXIDEsl 1ZEg== X-Gm-Message-State: AOUpUlH2CqZiwtKemIY0VyeD9xkdmmWr1fwPkjyVBII7zgeMl/nwXzE6 F1i7kHw2/jRVr5gp2vgSIrnhhPg442Z7PeW/ABE= X-Received: by 2002:a1c:d750:: with SMTP id o77-v6mr12436431wmg.67.1533587369582; Mon, 06 Aug 2018 13:29:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:979e:0:0:0:0:0 with HTTP; Mon, 6 Aug 2018 13:29:29 -0700 (PDT) In-Reply-To: <20180804000102.17737-1-baijiaju1990@gmail.com> References: <20180804000102.17737-1-baijiaju1990@gmail.com> From: Alex Deucher Date: Mon, 6 Aug 2018 16:29:29 -0400 Message-ID: Subject: Re: [PATCH] gpu: drm: radeon: radeon_test: Replace mdelay() with msleep() To: Jia-Ju Bai Cc: "Deucher, Alexander" , Christian Koenig , Chunming Zhou , Dave Airlie , Maling list - DRI developers , amd-gfx list , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 3, 2018 at 8:01 PM, Jia-Ju Bai wrote: > radeon_test_ring_sync() and radeon_test_ring_sync2() are never > called in atomic context. > They call mdelay() to busily wait, which is not necessary. > mdelay() can be replaced with msleep(). > > This is found by a static analysis tool named DCNS written by myself. > > Signed-off-by: Jia-Ju Bai Applied. thanks! Alex > --- > drivers/gpu/drm/radeon/radeon_test.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c > index f5e9abfadb56..411efa303f54 100644 > --- a/drivers/gpu/drm/radeon/radeon_test.c > +++ b/drivers/gpu/drm/radeon/radeon_test.c > @@ -347,7 +347,7 @@ void radeon_test_ring_sync(struct radeon_device *rdev, > if (r) > goto out_cleanup; > > - mdelay(1000); > + msleep(1000); > > if (radeon_fence_signaled(fence1)) { > DRM_ERROR("Fence 1 signaled without waiting for semaphore.\n"); > @@ -368,7 +368,7 @@ void radeon_test_ring_sync(struct radeon_device *rdev, > goto out_cleanup; > } > > - mdelay(1000); > + msleep(1000); > > if (radeon_fence_signaled(fence2)) { > DRM_ERROR("Fence 2 signaled without waiting for semaphore.\n"); > @@ -441,7 +441,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev, > if (r) > goto out_cleanup; > > - mdelay(1000); > + msleep(1000); > > if (radeon_fence_signaled(fenceA)) { > DRM_ERROR("Fence A signaled without waiting for semaphore.\n"); > @@ -461,7 +461,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev, > radeon_ring_unlock_commit(rdev, ringC, false); > > for (i = 0; i < 30; ++i) { > - mdelay(100); > + msleep(100); > sigA = radeon_fence_signaled(fenceA); > sigB = radeon_fence_signaled(fenceB); > if (sigA || sigB) > @@ -486,7 +486,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev, > radeon_semaphore_emit_signal(rdev, ringC->idx, semaphore); > radeon_ring_unlock_commit(rdev, ringC, false); > > - mdelay(1000); > + msleep(1000); > > r = radeon_fence_wait(fenceA, false); > if (r) { > -- > 2.17.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel