From patchwork Mon Jul 23 14:29:56 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: 10541379 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 7A272184F for ; Tue, 24 Jul 2018 07:17:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 631D4286E7 for ; Tue, 24 Jul 2018 07:17:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56F5228744; Tue, 24 Jul 2018 07:17:26 +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 0AC3E286E7 for ; Tue, 24 Jul 2018 07:17:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EAC8D6E250; Tue, 24 Jul 2018 07:16:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id B73716E24E; Mon, 23 Jul 2018 14:30:03 +0000 (UTC) Received: by mail-pl0-x243.google.com with SMTP id w8-v6so299909ply.8; Mon, 23 Jul 2018 07:30:03 -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=d/enA9Dabp1CBMZ1IgW5Q6tHLtresYeIsFqybjDD+kI=; b=YkEbNpzKvUJAwiTL/K70M8a8cq7KUaHetgw91iybIDCJL51kP8Iuzif9zgsNVK1C+2 atNtPZTTSAw1LzOAR2GN3NB/lfo6pXZ5o9oT6H2meAH2flPIlBfdfZG9J747Q5y3q7eP CJb/DO7ARoo2mN1nPTS/RBwM8EzBtuP2baZ2MhOeI4sIFvuXAl1TxqCkzkAmbvCvon0i TlGSHMzLC8i6PNz44uIdrxbC8Hs2sNBGXJ0/nXS/+oUiQbA7x5UDDXdFYrPa+w5Dpvs5 NPTbRjcIBOqygC5wE1T42tMdw8prO0ldvxySBHkGSRwLc0AEm9cCuIY8u/eYMEiFRy7p ZMvQ== X-Gm-Message-State: AOUpUlG13HuCsNP6VXsmfSsTLHy2XwzZb2ONFy7TkbwJpsbf/g6jU4n6 5F0JnCSY/iO9rIsFel/u20M= X-Google-Smtp-Source: AAOMgpccE27i/VxdGmzLtohBaqhmKzGDwPTf2GpsBFnJr68saTuOtXtsh12sIp1yUvUx8nK8flsEtw== 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 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 X-Mailman-Approved-At: Tue, 24 Jul 2018 07:16:52 +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 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);