From patchwork Sat Aug 4 00:33:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 10556637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC30714E5 for ; Mon, 6 Aug 2018 08:23:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAFF9205F6 for ; Mon, 6 Aug 2018 08:23:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF5E12094F; Mon, 6 Aug 2018 08:23:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9096E202DB for ; Mon, 6 Aug 2018 08:23:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 92A3F6E24F; Mon, 6 Aug 2018 08:20:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id 82AAD6E7E0; Sat, 4 Aug 2018 00:33:53 +0000 (UTC) Received: by mail-pg1-x543.google.com with SMTP id y4-v6so3562765pgp.9; Fri, 03 Aug 2018 17:33:53 -0700 (PDT) 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=fIXZ+INGrISs9bgf/SP737Umg45K9/1u4Ot+tjjIiIJOoDKq48EUeIARXGqdfqYdci wHrL2IrRlOMX80QnMCgZLNQVeTXgc2Layt7gc/OQq1oThk4UEy91fqXtjkLpYDihcOgw 6EduofLav70X/gpVZBxjgBcRRRsKqXgXsQsWK1N1euJHUh+4kmFMJXlAwOaz7a6EgwsJ OwMiKddoCgZYqtcUQKJs1hd2nG+lzqyl+5rcE0OvU5liroNMJ9c/1M36wbv2NkwiRpOv /buS06rFW6PPxkf8fsfiEhCgGAKJNvkKYYGgvr/Nnp3uyMuhHAmxLEnrI7MlAkJeRpSc M6JQ== X-Gm-Message-State: AOUpUlGufF7PcPhLJZyrKrSrKTFOjT/qS/d3HblZRmjTWiFXWAZMLeYV oo2xur2iK/xCE7cWe3H0rgI= X-Google-Smtp-Source: AAOMgpeJcLaa8NJ7hj0NR4qQWgrezEafm+VgvYZIvb0TfBrw6DOfjr1pGNZkej0jFzu7zu38b6olew== 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 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 X-Mailman-Approved-At: Mon, 06 Aug 2018 08:20:19 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jia-Ju Bai , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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);