From patchwork Mon May 21 17:02:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 10415925 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7805C6032C for ; Mon, 21 May 2018 17:04:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63CB61FE8B for ; Mon, 21 May 2018 17:04:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 612AA2897F; Mon, 21 May 2018 17:04:15 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E4ED1FE8B for ; Mon, 21 May 2018 17:03:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752986AbeEURDF (ORCPT ); Mon, 21 May 2018 13:03:05 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:40076 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753278AbeEURDA (ORCPT ); Mon, 21 May 2018 13:03:00 -0400 Received: by mail-wm0-f67.google.com with SMTP id j5-v6so27811048wme.5; Mon, 21 May 2018 10:02:59 -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=LwzjM+Y3fglsSyZOaGtF+amtmzJ4eQRcsC3Lgvu4tjY=; b=JUzhnFmhghoUzDzPdPwpUmpTAitWadJ7Kvg0qZSGs/HNfWj/u94Rji4minxvCgezpp g855nAoTY7v2wFnXHRWPcZcD9Vmqxo0hry1CcvfcpeoSp5kNCiVH/XEkAEhunIK5SpFI 6zkqv1glfOjxXNUrqBt9aluEPQ/Twt4+TDZ4n5d81CxzOgF/7nafbuJFfb+41w0Hutbb z2CDoG3ez5uj3YBJ8O1usRTeEJCO23CRjKDLy2gmdi5zPSuiVy7td3/TO/R8V6BiUmMk A8KADO+DHD3WHlujKPjlxz7AnEmZW+LDO+tXaIUSMV8kXE+8lgv7//BnFQaCMJC2aDNV +cGw== 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=LwzjM+Y3fglsSyZOaGtF+amtmzJ4eQRcsC3Lgvu4tjY=; b=LZ1qxPNLDLZSRmjJDDvfjrEWPfh8lTpbIal0nifgdah51Skko1rl0mH7Ofx3q+2oDI J8MNcRl3xT4Vsm3WL/4qyvyoZLA5c99f1z5xyFiDMvGy0USHgKEU8bf81PdQeXNxf8Op CtCkxFVM5yVatL0gIj6yMuBZFw/DrX/mfnCrxfkS2ogx+B7GZocSSafygTORbEXuKznc q46AIGy8kD5w0DBujFIFSvatp4lmPHbUBszcHjIz69GwUEw8u8TEdzSP0FnU96U0D2lW vDnB5igrvM2ZakWvAqgTPz46I496xZq1XLrb5c1Uw6BxOKgvZJHP5E68LwI+B3YR9DEe 9MWg== X-Gm-Message-State: ALKqPwdU97jSaubFLCzZO8r4zn7i/3/ftAYZXRNVUCRGeCig9IVcHJKy sCKXUKxWK9XqetAwTrh/BL9GEbzO X-Google-Smtp-Source: AB8JxZozdEsFFjZTARnrJ73QQ3QledvlZzhHvEyDhVXWbt1earLK+Aqlllrze7CIrcPLRk1uD7AR9Q== X-Received: by 2002:a1c:5d4f:: with SMTP id r76-v6mr10997961wmb.55.1526922178166; Mon, 21 May 2018 10:02:58 -0700 (PDT) Received: from kurokawa.lan (ip-86-49-107-50.net.upcbroadband.cz. [86.49.107.50]) by smtp.gmail.com with ESMTPSA id k5-v6sm6793212wrd.13.2018.05.21.10.02.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 10:02:56 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut To: linux-pci@vger.kernel.org Cc: Marek Vasut , Geert Uytterhoeven , Phil Edworthy , Simon Horman , Wolfram Sang , linux-renesas-soc@vger.kernel.org Subject: [PATCH] PCI: rcar: Poll more often in rcar_pcie_wait_for_dl() Date: Mon, 21 May 2018 19:02:50 +0200 Message-Id: <20180521170250.13224-1-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.16.2 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The data link active signal usually takes ~20 uSec to be asserted, poll the bit more often to avoid useless delays in this function. Use udelay() instead of usleep() for such a small delay as suggested by the timer documentation and because this will be used in atomic content later on when the suspend/resume patches land. Signed-off-by: Marek Vasut Cc: Geert Uytterhoeven Cc: Phil Edworthy Cc: Simon Horman Cc: Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org --- drivers/pci/host/pcie-rcar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index 5c365f743df5..65ebe7aa3488 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -529,13 +529,13 @@ static void phy_write_reg(struct rcar_pcie *pcie, static int rcar_pcie_wait_for_dl(struct rcar_pcie *pcie) { - unsigned int timeout = 10; + unsigned int timeout = 10000; while (timeout--) { if ((rcar_pci_read_reg(pcie, PCIETSTR) & DATA_LINK_ACTIVE)) return 0; - msleep(5); + udelay(5); } return -ETIMEDOUT;