From patchwork Mon May 21 21:05:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 10416347 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 0ED316053B for ; Mon, 21 May 2018 21:05:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F264928A73 for ; Mon, 21 May 2018 21:05:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E682E28A80; Mon, 21 May 2018 21:05:31 +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 3CD3B28A73 for ; Mon, 21 May 2018 21:05:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752198AbeEUVFa (ORCPT ); Mon, 21 May 2018 17:05:30 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:50498 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752128AbeEUVF2 (ORCPT ); Mon, 21 May 2018 17:05:28 -0400 Received: by mail-wm0-f65.google.com with SMTP id t11-v6so27586772wmt.0; Mon, 21 May 2018 14:05:28 -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=E3jtgdO1vr4/oEHEHTS7JNYEXPWwwjMM79AXyjlRGH8=; b=MvNntsiG8AOUliYF2sN93pe4s9dPK9ztmoY9BrBdijaCt75NcyruaKmXKR0ac+MdRK vis3Xklb/vmtZhnzDZEjQEsSLK1SsyZJjUfgjOUODYgHMHwDt7Lb3JrxdYAa569kDK4J z+ldzA3RzhGTAW9iJj4Kn6aHiLmOWvkQXGBLt7d0N0+EpEDIcVV16Esh8qXtKLfbyBP3 hY+h0OIuBQkRRUbujkH+1tZDqvPj+QwEcw8KsjW9Ccm0nbyDc5uLLTVoYlyPNOxCvkuw L6Sqi1QA00Z+FXDIizQKFAY5HIpMwDjfc7664kV+1xeiAAXIoS2qvNV353b3wnIKAcL8 wvzA== 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=E3jtgdO1vr4/oEHEHTS7JNYEXPWwwjMM79AXyjlRGH8=; b=eTXWUjLBuLxtiF4SIrwm9SlzJT2EKLZBjafn9G749Y5xWj8ULT59VY2/lGi+gKlSeC cOIY4XAvVSfOKmgZCSehFUHTkPuvMjueFMvBk4MX7FWMcqbJtSI9sDexqT0tmQjX3qzg zH1vdDBVhvJWDbDW2/sBlNw9e9Rk4kaEd9p24HRYIH5ff+j2f41eiOLkw7G8lSeeuw3V BMajqb/gfEhZbvPYdACJG3/aHQcYTjZWa2TtvaJ2WeFS/ZCvzzsNvfw+TMcypsCWeGjC wapTcGdzKC0zeZt7pgwvIUIaMvXtpJ21ueHqe09zqyzhwDt3wXi9goI4pkBI7FfX+nb4 1UWw== X-Gm-Message-State: ALKqPwcWXMOFX/rUp11NgmCG7gOdRjaFd72xcixRe4j0/DOspytaCiTh hT4eaN71b5O/+NgTKyZNnYOn5Uue X-Google-Smtp-Source: AB8JxZomFhORatQcy5Ezur95gR3tpifdARD7ormUG7O54JANwF9I22EJHbZg2VICELcdWSjeUsosvg== X-Received: by 2002:a1c:c46:: with SMTP id 67-v6mr259031wmm.79.1526936727252; Mon, 21 May 2018 14:05:27 -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 p189-v6sm15307040wmg.18.2018.05.21.14.05.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 14:05:26 -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 23:05:22 +0200 Message-Id: <20180521210522.29346-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 context 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 --- V2: s/content/context in commit message --- 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;