| From f1965c85a5e37140640cab2e9956d99799662398 Mon Sep 17 00:00:00 2001 |
| From: Marek Vasut <marek.vasut@gmail.com> |
| Date: Tue, 22 May 2018 14:24:20 +0200 |
| Subject: [PATCH 1435/1795] PCI: rcar: Poll more often in |
| rcar_pcie_wait_for_dl() |
| |
| 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. |
| |
| Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> |
| [lorenzo.pieralisi@arm.com: updated commit log] |
| Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> |
| Reviewed-by: Simon Horman <horms+renesas@verge.net.au> |
| Cc: Geert Uytterhoeven <geert+renesas@glider.be> |
| Cc: Phil Edworthy <phil.edworthy@renesas.com> |
| Cc: Simon Horman <horms+renesas@verge.net.au> |
| Cc: Wolfram Sang <wsa@the-dreams.de> |
| Cc: linux-renesas-soc@vger.kernel.org |
| |
| (cherry picked from commit 0353ff29b3881a8d9df65ce08a01e636868c1ef2) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| --- |
| drivers/pci/host/pcie-rcar.c | 5 +++-- |
| 1 file changed, 3 insertions(+), 2 deletions(-) |
| |
| diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c |
| index 92b2b7725b9c..dc2166ec097c 100644 |
| --- a/drivers/pci/host/pcie-rcar.c |
| +++ b/drivers/pci/host/pcie-rcar.c |
| @@ -549,13 +549,14 @@ static int rcar_pcie_wait_for_phyrdy(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); |
| + cpu_relax(); |
| } |
| |
| return -ETIMEDOUT; |
| -- |
| 2.19.0 |
| |