Hi Marek,
On Wed, Nov 8, 2017 at 10:58 AM, Marek Vasut <[email protected]> wrote:
> From: Dien Pham <[email protected]>
>
> The controller clock can be switched off during suspend/resume,
> let runtime PM take care of that.
>
> Signed-off-by: Dien Pham <[email protected]>
> Signed-off-by: Hien Dang <[email protected]>
> Signed-off-by: Marek Vasut <[email protected]>
> --- a/drivers/pci/host/pcie-rcar.c
> +++ b/drivers/pci/host/pcie-rcar.c
> @@ -1125,6 +1112,13 @@ static int rcar_pcie_probe(struct platform_device
> *pdev)
>
> rcar_pcie_parse_request_of_pci_ranges(pcie);
>
> + pm_runtime_enable(pcie->dev);
> + err = pm_runtime_get_sync(pcie->dev);
> + if (err < 0) {
> + dev_err(pcie->dev, "pm_runtime_get_sync failed\n");
> + goto err_pm_disable;
> + }
> +
> err = rcar_pcie_get_resources(pcie);
> if (err < 0) {
> dev_err(dev, "failed to request resources: %d\n", err);
(out of context)
goto err_free_bridge;
But that should do pm_runtime_put(), too.
> @@ -1135,13 +1129,6 @@ static int rcar_pcie_probe(struct platform_device
> *pdev)
> if (err)
> goto err_free_bridge;
>
> - pm_runtime_enable(dev);
> - err = pm_runtime_get_sync(dev);
> - if (err < 0) {
> - dev_err(dev, "pm_runtime_get_sync failed\n");
> - goto err_pm_disable;
> - }
> -
> /* Failure to get a link might just be that no cards are inserted */
> hw_init_fn = of_device_get_match_data(dev);
> err = hw_init_fn(pcie);
> @@ -1173,13 +1160,13 @@ static int rcar_pcie_probe(struct platform_device
> *pdev)
> err_pm_put:
> pm_runtime_put(dev);
"err_pm_put" should be moved, too.
> -err_pm_disable:
> - pm_runtime_disable(dev);
> -
> err_free_bridge:
> pci_free_host_bridge(bridge);
> pci_free_resource_list(&pcie->resources);
>
> +err_pm_disable:
> + pm_runtime_disable(dev);
> +
> return err;
> }
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds