[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231031083553.GD11778@thinkpad>
Date: Tue, 31 Oct 2023 14:05:53 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Xiaowei Song <songxiaowei@...ilicon.com>,
Binghui Wang <wangbinghui@...ilicon.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof Wilczyński <kw@...ux.com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Jingoo Han <jingoohan1@...il.com>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
linux-pci@...r.kernel.org
Subject: Re: [PATCH] PCI: kirin: Fix an error path in kirin_pcie_probe()
On Mon, Oct 30, 2023 at 09:21:16AM +0100, Christophe JAILLET wrote:
> If an error occurs after a successful kirin_pcie_power_on(),
> kirin_pcie_power_off() should be called, as already done in the remove
> function.
>
PERST# assert (gpio_id_dwc_perst) is missing from kirin_pcie_power_off(). So
first you need to add that in a separate patch and then this patch can come
next.
Also, this driver is using legacy GPIO APIs and needs cleanup too (Kudos if you
are willing to do that).
- Mani
> Fixes: fc5165db245a ("PCI: kirin: Add HiSilicon Kirin SoC PCIe controller driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> Not sure of the Fixes tag.
> ---
> drivers/pci/controller/dwc/pcie-kirin.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
> index 2ee146767971..0b93de9d2d06 100644
> --- a/drivers/pci/controller/dwc/pcie-kirin.c
> +++ b/drivers/pci/controller/dwc/pcie-kirin.c
> @@ -813,7 +813,15 @@ static int kirin_pcie_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - return dw_pcie_host_init(&pci->pp);
> + ret = dw_pcie_host_init(&pci->pp);
> + if (ret)
> + goto err_power_off;
> +
> + return 0;
> +
> +err_power_off:
> + kirin_pcie_power_off(kirin_pcie);
> + return ret;
> }
>
> static struct platform_driver kirin_pcie_driver = {
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists