Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1260AC07E94 for ; Fri, 4 Jun 2021 15:44:48 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F30946101C for ; Fri, 4 Jun 2021 15:44:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F30946101C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=blueri.se Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC6EB82B8D; Fri, 4 Jun 2021 17:44:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=blueri.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E9DFB82C9B; Fri, 4 Jun 2021 17:44:42 +0200 (CEST) Received: from pwildt.genua.de (pwildt.genua.de [80.154.94.49]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 71CC382B89 for ; Fri, 4 Jun 2021 17:44:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=blueri.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=patrick@blueri.se Received: from mini.fritz.box (p200300c1c72389009c39944bc57ba271.dip0.t-ipconnect.de [2003:c1:c723:8900:9c39:944b:c57b:a271]) by pwildt.genua.de (OpenSMTPD) with ESMTPSA id ff5596b0 (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Fri, 4 Jun 2021 17:44:37 +0200 (CEST) Date: Fri, 4 Jun 2021 17:44:35 +0200 From: Patrick Wildt To: Anand Moon Cc: u-boot@lists.denx.de, Neil Armstrong , Kever Yang Subject: Re: [PATCHv3 3/3] pci: pcie_dw_rockchip: Replace msleep occurences by udelay Message-ID: References: <20210604045607.1003-1-linux.amoon@gmail.com> <20210604045607.1003-3-linux.amoon@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210604045607.1003-3-linux.amoon@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Am Fri, Jun 04, 2021 at 04:56:07AM +0000 schrieb Anand Moon: > Replace msleep occurences by udelay. > > drivers/pci/pcie_dw_rockchip.c:254:3: warning: implicit > declaration of function 'msleep' [-Wimplicit-function-declaration] > > Cc: Patrick Wildt > Cc: Neil Armstrong > Cc: Kever Yang > Signed-off-by: Anand Moon > --- > V2: drop the msleep macro. > --- > drivers/pci/pcie_dw_rockchip.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c > index 4e448c0a3d..039266a357 100644 > --- a/drivers/pci/pcie_dw_rockchip.c > +++ b/drivers/pci/pcie_dw_rockchip.c > @@ -62,6 +62,7 @@ struct rk_pcie { > > /* Parameters for the waiting for #perst signal */ > #define PERST_WAIT_MS 1000 > +#define MACRO_US 1000 > > static int rk_pcie_read(void __iomem *addr, int size, u32 *val) > { > @@ -249,7 +250,7 @@ static int rk_pcie_link_up(struct rk_pcie *priv, u32 cap_speed) > * some wired devices need much more, such as 600ms. > * Add a enough delay to cover all cases. > */ > - msleep(PERST_WAIT_MS); > + udelay(PERST_WAIT_MS); You're missing the * MACRO_US here. I'm not sure though that really needs a macro for MS to US, or did someone request that? > dm_gpio_set_value(&priv->rst_gpio, 1); > } > > @@ -271,12 +272,12 @@ static int rk_pcie_link_up(struct rk_pcie *priv, u32 cap_speed) > dev_info(priv->dw.dev, "PCIe Linking... LTSSM is 0x%x\n", > rk_pcie_readl_apb(priv, PCIE_CLIENT_LTSSM_STATUS)); > rk_pcie_debug_dump(priv); > - msleep(1000); > + udelay(PERST_WAIT_MS * MACRO_US); > } > > dev_err(priv->dw.dev, "PCIe-%d Link Fail\n", dev_seq(priv->dw.dev)); > /* Link maybe in Gen switch recovery but we need to wait more 1s */ > - msleep(1000); > + udelay(PERST_WAIT_MS * MACRO_US); > return -EIO; > } > > @@ -296,7 +297,7 @@ static int rockchip_pcie_init_port(struct udevice *dev) > } > } > > - msleep(1000); > + udelay(PERST_WAIT_MS * MACRO_US); > > ret = generic_phy_init(&priv->phy); > if (ret) { > -- > 2.31.1 >