diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2018-06-29 13:48:15 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2018-08-09 17:19:02 +0200 |
commit | 4a13248a7ac3e77583e13cebffaf9c8188c39834 (patch) | |
tree | 1b24c995b5ec7a6ee6b181999398b6c050f0dfd1 | |
parent | f3b326a6091ad115a09b47ec818a96033f1dfd1c (diff) | |
download | renesas-backport-4a13248a7ac3e77583e13cebffaf9c8188c39834.tar.gz |
PCI: rcar: Clean up PHY init on failure
If the Gen3 PHY fails to power up, the code does not undo the
initialization caused by phy_init(). Add the missing failure
handling to the rcar_pcie_phy_init_gen3() function.
Fixes: 517ca93a7159 ("PCI: rcar: Add R-Car gen3 PHY support")
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 3c5777c372b6eb2e17802b3dc4bd5ebea45d9bcc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
drivers/pci/controller/pcie-rcar.c
drivers/pci/host/pcie-rcar.c
-rw-r--r-- | drivers/pci/host/pcie-rcar.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index 2c0af4772c39c2..2edd2155a012fd 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -681,7 +681,11 @@ static int rcar_pcie_phy_init_gen3(struct rcar_pcie *pcie) if (err) return err; - return phy_power_on(pcie->phy); + err = phy_power_on(pcie->phy); + if (err) + phy_exit(pcie->phy); + + return err; } static int rcar_msi_alloc(struct rcar_msi *chip) |