Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5872985imm; Mon, 23 Jul 2018 07:31:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfj7TLHv0NgzE3CSKXCliM42d5dy/rj91IRj4ALJ4d3+49hJt2VUKc9AG9gcSauw2EWQJDK X-Received: by 2002:a63:1a49:: with SMTP id a9-v6mr12822921pgm.423.1532356270687; Mon, 23 Jul 2018 07:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532356270; cv=none; d=google.com; s=arc-20160816; b=wPHx66PZ2h0EN+QCwzp40wzIprDnvRxfuLayEaUyNdMdlgtpOGWqYdeVy3wULtJIXB w3SW1FdvCiTrv955SGgI3YzpdLpQ6xfCSor9wvVOhcKqt9h6qIdket8rMCiSvPHYNEuC P3Czeq8LmOLlbWajj5sQd0EPMjUr/uEGmvnmkLxUsyS2AY1Z9A7MpR6n0P1dKjR+MOzj sLwAhqD9oTL/+ai6efwS43sfHXxhgA8k0TB/3drP51mSfB/+PL6BqHvCU/xdbG+W6fcc oGm6IS5fA3NmBW90IZl1QHlufdZSC7zbmtwNKLNQmBg+wLy6oAgCdKEVUWZfcOmL8uTm KDXQ== 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=d/enA9Dabp1CBMZ1IgW5Q6tHLtresYeIsFqybjDD+kI=; b=e+gt3FkeEzhI/eh01MPaBkvSfQ1A0BFIulCY8CWplyO4bDuiZ2Nc6qokYBH8TTILsq DSZ1iTNFkIy9rhJdkYus7gNYNXA3qEZQSDcP5KNzWIO3g+8fBEO4Q/tFfqDt+rHOXJ5e U1g56c8d5NcqPGaKbdBOCzs8k3EcmUXP8TgjGZuWQ017DXBJ4CXsvdwunRQ19E5K5FNG dzQqdIFoUbgz5P/2H2JBZRAZkXk/G7xssn4z3Xtxac6QohGEk/4JmGrbjK3QfZOnEhbO upMTpZVDXYinTbgEp31gG9ficMxrrqIK3yBcCcs4kTTKk8W/fark63L4g4HgRUAws1Kh cltQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vAP1Clwb; 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 f18-v6si8473153pgd.16.2018.07.23.07.30.56; Mon, 23 Jul 2018 07:31:10 -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=vAP1Clwb; 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 S2388461AbeGWPbe (ORCPT + 99 others); Mon, 23 Jul 2018 11:31:34 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:46173 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388104AbeGWPbe (ORCPT ); Mon, 23 Jul 2018 11:31:34 -0400 Received: by mail-pl0-f67.google.com with SMTP id t17-v6so296526ply.13 for ; Mon, 23 Jul 2018 07:30:03 -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=d/enA9Dabp1CBMZ1IgW5Q6tHLtresYeIsFqybjDD+kI=; b=vAP1ClwbgUJp8927jmENPLPQAL2Px/JDKC0SpKfIEH/RIm/z3rl6U/KxXRSfRW7Nxj VuTm0boZ4NOlpT46nPeVfvusd8gs7Iz/roEXsFjPi4aznWuSd1z3/hJnqb+43nHz0g+B I2Mc3gCy7TXpbilI0303mfm6zieXuN8OJlDYuXr5eTd19/SxjpElukdwFH7VQrbGeyQy ehaU0Ved/n4O9x59JK/W+HZbpgvxKXG4SOWVE56nxo6zVsaWm4ZReb2lKkJQasEdySRh QvrrNNqxA1lVnd7XmsREF6uV29gTBxeTeGewNxkfT+BDoUijSJ43rICEO5TSJf4dXCxV uOLQ== 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=d/enA9Dabp1CBMZ1IgW5Q6tHLtresYeIsFqybjDD+kI=; b=ICULXLKFuPvy1oY3aVLSNLnoRlbNZAtoadDlsEUNlFZR07V8dKvW57DJ4xTZX3olxc 3dNzFPrPn0bxcDgulpe/pkAr9+IqPWo+2hVW5b/7y3XjArIU1UwPeAn1g6C0tmXo1Pry AW2aUiX83BRe6Ej4S2w25WWouHKjdo4ZHRGmp9jRpBnMcHq9B4ARTMCRtoiRIzvfRVWp 22BnvLH8muz5nBUnn2XJfrk3ljQ1o4RnoamGx366Zt6/WmiusyPnrNvFW7MoFuP9EPys Jt5/Y143Qj1RNG1UhxY90pxdL6DbAAXrTRoH7Ikp5djiSACOFOra0ZAFl6ZxDUPg9esG Y5Sg== X-Gm-Message-State: AOUpUlG04kvi7LwrRk69RYRbCN6myGorpHJL8RKYj2Zqz7MPZzbB/dzU xurzHFdkzVHlVrzaVeB956g= X-Received: by 2002:a17:902:683:: with SMTP id 3-v6mr13197141plh.291.1532356203444; Mon, 23 Jul 2018 07:30:03 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:e422:450a:e730:728b]) by smtp.gmail.com with ESMTPSA id p3-v6sm13228872pfo.130.2018.07.23.07.30.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 07:30:03 -0700 (PDT) From: Jia-Ju Bai To: alexander.deucher@amd.com, christian.koenig@amd.com, David1.Zhou@amd.com, airlied@linux.ie, Rex.Zhu@amd.com, harry.wentland@amd.com, Samuel.Li@amd.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] gpu: drm: amdgpu: Replace mdelay with msleep in cik_pcie_gen3_enable() Date: Mon, 23 Jul 2018 22:29:56 +0800 Message-Id: <20180723142956.3718-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 cik_pcie_gen3_enable() is only called by cik_common_hw_init(), which is never called in atomic context. cik_pcie_gen3_enable() calls 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/amd/amdgpu/cik.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c index 0df22030e713..5b7fab2c2008 100644 --- a/drivers/gpu/drm/amd/amdgpu/cik.c +++ b/drivers/gpu/drm/amd/amdgpu/cik.c @@ -1476,7 +1476,7 @@ static void cik_pcie_gen3_enable(struct amdgpu_device *adev) tmp |= PCIE_LC_CNTL4__LC_REDO_EQ_MASK; WREG32_PCIE(ixPCIE_LC_CNTL4, tmp); - mdelay(100); + msleep(100); /* linkctl */ pci_read_config_word(root, bridge_pos + PCI_EXP_LNKCTL, &tmp16); -- 2.17.0