Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1043601imm; Fri, 3 Aug 2018 17:02:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdQrmMw2FrAcZl62zvY1B0Ucai6LVXBYZSOkl/fC7zpgkUvKYuTji0xlTgu7vfXPzCNrxKz X-Received: by 2002:a62:1f8c:: with SMTP id l12-v6mr6817716pfj.143.1533340940010; Fri, 03 Aug 2018 17:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533340939; cv=none; d=google.com; s=arc-20160816; b=ALCXoCqcb0pIFdXaKTfduCuDa3CyB/POtPG6ou3o/h6PU180Qj1U/dRpH6Ht3V5zmm GDbPB8mNbQL14uX3V5r5+Tj+5chdCARpFU3R4HtzD+xKNml78FfPwshoavE0pSxfFCO2 YW0c7GVnUOLrpfOxAdNpYxRkN+/wWQFLP7jKDEvqfqwqEDnBRmA7P99aIcLCW+7I3Y9G b2NfdZitsc8OOHGsJL93Oj24IxUDzSY4DhWyyAwK00rFnuzKwqRkXwIrFRr6XryBGtH+ YS6XU6SLtZY1rVSspmVa1Nm2Zh+lbIu3ffCdFzqaQobnab5tGvUMKb5CFD3BfLORIHB1 RciQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=TeDGWoUCE1/7nYGv9ZuhCQ6I7+aZQaGsKzWeIInoLbA=; b=AJALgPlnUEpza+XUR0t/jFeJvs5t+qHkOJzQmCrs464nS5tcV9RXaMBvReLR8hAph3 16kpesY24TJi8qoOKNU6RdJhvLwepQwo/bSEIElGdE1YlZn9Ron8Ic/g9XD+v8jIYI8c vZJLK9PfwhQTY85Doo9dLWqlTHQF3QDgOwhQo8dcEakRp04y7+N1yDG5QWAos+U1ulub Tbe3VnmIAf9RHx2N/MJQ1DpB1kJmu2apZTWmC4OJx3HBAW9/1w0lQGfxWwXMH7kajD6z PUHbBV/LEyspJOha9qeZwM6T5hWcJwiG2WMbtI5wmJVYRtcaBtL9SMZB1fpWGFoGP900 OGNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y71VCIBs; 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 cc6-v6si4877451plb.458.2018.08.03.17.02.03; Fri, 03 Aug 2018 17:02:19 -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=Y71VCIBs; 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 S1732090AbeHDB7j (ORCPT + 99 others); Fri, 3 Aug 2018 21:59:39 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:44448 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731990AbeHDB7j (ORCPT ); Fri, 3 Aug 2018 21:59:39 -0400 Received: by mail-pl0-f68.google.com with SMTP id ba4-v6so3204896plb.11 for ; Fri, 03 Aug 2018 17:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=TeDGWoUCE1/7nYGv9ZuhCQ6I7+aZQaGsKzWeIInoLbA=; b=Y71VCIBsHQBr523kwGBnnb+r5x20Af2j5Y81GuGM5GuaAXlMD4BKKjU1DI0wO61N6b Z8474z0dRAoTaUKqnxxeVBmUY2IcRtG1LMczsE9dunRhumcAyyDXY+EzSdboF9ItT8Y4 ry+wj1cXTjFmIqNKdLo8QjSVd9r2N7pECv3NOb/NxmFEC3SNLnTeX95nRdSoTpXuwThz aOPZvsYp6LlkQRoIQhGYwuIWVOq2LwV79Ok5elGWBjBDwe42KZ6kLkVMvdYOm4EiXsOC +impkNM86QgCQsO8kWaRhS5S0Goku25ghrZQt3dZ8E2MxXwMyPCBfYBfMY2ZEdxu6f5w Gzfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TeDGWoUCE1/7nYGv9ZuhCQ6I7+aZQaGsKzWeIInoLbA=; b=AW401nknEt7KDQmXLjakG08TK5KbwekqcYbXrbfW2WcyWbLoBWmFk2Xn1xB5r2YgoC fVEGUS5c/ozXCz3D1cKRntx9Chb/w6l2lMdZcImpyBOvybRI64lUZ7kLah6lzndzO7lG +MS38H6VrahzOhI4uImwLQHDHMkrHQ/dwK0b3BWvprhYC9iafFn5SHUh/upT436vn8mO +j/E7T6plm7w1d2G3nIMeUmiA93VX8vhmlaP2uCBqWYNpTS8M0uYO0aYl+swfuS9QkDF GJoNo62/JirUWU83WhmeILheyWJEq0Mu4PLMTMdFbeqnwneNGXAvRgi/drk6uQ4wC3Z2 vO8w== X-Gm-Message-State: AOUpUlE13R+wuAoh5dxY1TO+kx7ypvnGmbzvtead0CwNX4BDw0V3QICR Op/dCg3LteeCR+kjzGIZQWk= X-Received: by 2002:a17:902:7896:: with SMTP id q22-v6mr5374852pll.47.1533340870474; Fri, 03 Aug 2018 17:01:10 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:80c0:93b4:a4e2:6d2f]) by smtp.gmail.com with ESMTPSA id s14-v6sm14369312pfj.105.2018.08.03.17.01.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 17:01:09 -0700 (PDT) From: Jia-Ju Bai To: alexander.deucher@amd.com, christian.koenig@amd.com, David1.Zhou@amd.com, airlied@linux.ie Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] gpu: drm: radeon: radeon_test: Replace mdelay() with msleep() Date: Sat, 4 Aug 2018 08:01:02 +0800 Message-Id: <20180804000102.17737-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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