Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0353ff29 authored by Marek Vasut's avatar Marek Vasut Committed by Lorenzo Pieralisi
Browse files

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: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
[lorenzo.pieralisi@arm.com: updated commit log]
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: default avatarSimon 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
parent f7e1c646
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -546,13 +546,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;