From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com ([217.140.101.70]:34424 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753045AbeF2NhZ (ORCPT ); Fri, 29 Jun 2018 09:37:25 -0400 Date: Fri, 29 Jun 2018 14:39:11 +0100 From: Lorenzo Pieralisi To: Marek Vasut Cc: linux-pci@vger.kernel.org, Marek Vasut , Geert Uytterhoeven , Phil Edworthy , Simon Horman , Wolfram Sang , linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH] PCI: rcar: Clean up PHY init on failure Message-ID: <20180629133911.GB9643@red-moon> References: <20180525183326.5245-1-marek.vasut+renesas@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180525183326.5245-1-marek.vasut+renesas@gmail.com> Sender: linux-pci-owner@vger.kernel.org List-ID: On Fri, May 25, 2018 at 08:33:26PM +0200, Marek Vasut wrote: > 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. > > Signed-off-by: Marek Vasut > Reported-by: Geert Uytterhoeven > Cc: Geert Uytterhoeven > Cc: Lorenzo Pieralisi > Cc: Phil Edworthy > Cc: Simon Horman > Cc: Wolfram Sang > Cc: linux-renesas-soc@vger.kernel.org > Fixes: 517ca93a7159 ("PCI: rcar: Add R-Car gen3 PHY support") > --- > drivers/pci/host/pcie-rcar.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) Applied to pci/controller-fixes to be tentatively merged for -rc4, thanks. Lorenzo > diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c > index 695781934f0a..477bf40cc031 100644 > --- a/drivers/pci/host/pcie-rcar.c > +++ b/drivers/pci/host/pcie-rcar.c > @@ -678,7 +678,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) > -- > 2.16.2 >