Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1065129imm; Fri, 3 Aug 2018 17:34:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeZ9bQA5TA7ZyWLybcElu2gafmlykKsNcXQZsvZKx3VFCDMFdy+2WyzObGkeGT+IsVme/C+ X-Received: by 2002:a62:3cd7:: with SMTP id b84-v6mr6865705pfk.183.1533342896725; Fri, 03 Aug 2018 17:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533342896; cv=none; d=google.com; s=arc-20160816; b=Fji9mfiOJhDNaUOuaWelVQnaA5mcafJjXFCKA/y0fdBvOUz+LgebrACDmmvynTYqzu cQu9K9fuUSB66sYpnFehmC/2tc+iPhMS3GKMCW18ggHk3GbvKex1axgq9cBCF1UB2BHG 7aclRZpWTt3sNnscewrWfp4vZiHq+uKuC4KuVaXT+oTQWbiKGkhaf2B2eNOeFzlufkop YpwQHqQc8U7CYAadegjAQ7eg44BU1FON4sZbrhV9v0TVryRLlS3znFU9f6Ablzc6PVta XHjTdHgWUOQ0nesx73uWdWIWz+nlmOg3tw32yVurPASnseA/nEM1Uyusg8ERIWIrz3fW 8IFw== 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=JF9iBhlRE70KaEqu6ZTLgZazp+LTn0J6LlrD0LRVg4U=; b=neLRExPwTamf9v98p6SWL9eAjcpfmaGgU8z9wdFXc8jH7CkXXmvE5zYVghoxKKc5dQ B4uKb91UTEhZCqXPXNbuEWJq8Rp9nvdjcZ49uP27XW7hZutgtxQXrM/I4+cW8JFzgKyO HfufvqKRSDQ9+SvxFQ9qNCHrWXwq+LbAR1B+iDXbHgxdI/vfv0l5JGG2DYY51h3krhUG EaPbqWTrbd+8cuDFCkxxwovRVMAtp0HlwwiYbX+ZQiYIDGWgevhT2y+lG3NwKZHUvVRC ss2wmaOHMZ+yJsmexVMTQxXk+dL6xQyryxUGhGQfzYENspq1ErnCN/XY9Kr0ncq63pvl ycgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UnBs4OBl; 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 p14-v6si6748997pfk.275.2018.08.03.17.34.41; Fri, 03 Aug 2018 17:34:56 -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=UnBs4OBl; 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 S1732124AbeHDCc1 (ORCPT + 99 others); Fri, 3 Aug 2018 22:32:27 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:35868 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728173AbeHDCc1 (ORCPT ); Fri, 3 Aug 2018 22:32:27 -0400 Received: by mail-pg1-f195.google.com with SMTP id h12-v6so3573316pgs.3 for ; Fri, 03 Aug 2018 17:33:53 -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=JF9iBhlRE70KaEqu6ZTLgZazp+LTn0J6LlrD0LRVg4U=; b=UnBs4OBlFrlsnOlxuOQbangus+JarR3+4yMCmjmX2EWqU/y1i44r3rGRYemv2mtttx 8q46KVRT6b8I9y3b0zKMYtVcTC5OoYRj+rOeGNqe/nMG0D7Ud1El//rpNM8gtYwJsPMK wr/coXP2aejoBEfADvUXA+GslFRg7E/IFvgwZRDKBsjbugSP/YGPcwucomAYRX41vMLS s33sB0iciROVJBpkEeEwZG9B2twTJXFiIfug1dulTNkkEkG0ygN63b5GDifdJPUXI9TZ ZzsEtzAhpuge/WPaemTUski/uwO+DK2vbOPWOV6mxAnl7j2mb7YMUtfFmpUOU5jjCcx6 YJFA== 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=JF9iBhlRE70KaEqu6ZTLgZazp+LTn0J6LlrD0LRVg4U=; b=eIyHGeeoeSgtCUF7eg1/8rHHfvVQ+De8cvJTMPXpeEmY7PThoQG1W73B621Hb2m5OR +frORth7RdQByAgtBNcQnppZa5beTkytrcbJTkWSZX9hPQ8qTKlT7WVfu7qhuH9tfsog bTC4VfBUNGasgTYptXnjQdTTira80uLkMTAJATQQblJ2MSgk3oLw2LP5CI1MpMOXdUyd QlGnWwmVMKf88aIAqG9Py70dTZz9pem/IOE2+EoZG2WL1pGEXRqzZf2l88YHsXLRs3DW +Bg2hKH9xS+XofOwZE2k/bAoZA1Lhtpyn8LXNsWtKyiTpdi1EK6S6f7Fi9fRhO2Eztvk B2PQ== X-Gm-Message-State: AOUpUlH87fVg8ykGTk19hwPt4OU/sStIPUHBNHEz//R2ZtWGyqpd6f47 dYJZDWEGWKGPscWyNYHiwptAH+iC X-Received: by 2002:a65:60cf:: with SMTP id r15-v6mr5707234pgv.41.1533342833202; Fri, 03 Aug 2018 17:33:53 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:80c0:93b4:a4e2:6d2f]) by smtp.gmail.com with ESMTPSA id z2-v6sm5376076pgv.12.2018.08.03.17.33.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 17:33:52 -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: si: Replace mdelay() with msleep() in si_pcie_gen3_enable() Date: Sat, 4 Aug 2018 08:33:44 +0800 Message-Id: <20180804003344.18775-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 si_pcie_gen3_enable() is never called in atomic context. It 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/radeon/si.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 1907c950d76f..c28743443970 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c @@ -7181,7 +7181,7 @@ static void si_pcie_gen3_enable(struct radeon_device *rdev) tmp |= LC_REDO_EQ; WREG32_PCIE_PORT(PCIE_LC_CNTL4, tmp); - mdelay(100); + msleep(100); /* linkctl */ pci_read_config_word(root, bridge_pos + PCI_EXP_LNKCTL, &tmp16); -- 2.17.0