Re: [PATCH 4/5] PCI: dwc: rcar-gen4: Handle PERST via reset subsystem

Geert Uytterhoeven <[email protected]>
Newsgroups org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci
Message-ID <CAMuHMdUVqw-gqydVg5N7WiMj04rVAPuLjJjzgrk+eEgJpbzS2g@mail.gmail.com>
Hi Marek,

On Sat, 4 Jul 2026 at 22:28, Marek Vasut
<[email protected]> wrote:
> Handle PERST via both GPIO and reset subsystem. On R-Car Gen4, the
> PERST signal is operated as a GPIO, on R-Car Gen5 it might only be
> accessible via SCMI reset via reset subsystem. Support both options.
> This is a preparatory patch for R-Car Gen5 support.
>
> Signed-off-by: Marek Vasut <[email protected]>

Thanks for your patch!

> --- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> +++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c

> @@ -299,10 +300,27 @@ static void rcar_gen4_pcie_unprepare(struct rcar_gen4_pcie *rcar)
>
>  static int rcar_gen4_pcie_get_resources(struct rcar_gen4_pcie *rcar)
>  {
> +       struct device *dev = rcar->dw.dev;
> +       struct reset_control *perst;
> +
>         rcar->phy_base = devm_platform_ioremap_resource_byname(rcar->pdev, "phy");
>         if (IS_ERR(rcar->phy_base))
>                 return PTR_ERR(rcar->phy_base);
>
> +       rcar->perst = NULL;
> +       for_each_available_child_of_node_scoped(dev->of_node, of_port) {
> +               perst = of_reset_control_get(of_port, "perst");
> +               if (IS_ERR(perst)) {
> +                       if (PTR_ERR(perst) != -EPROBE_DEFER)
> +                               dev_err(dev, "Failed to get PERST#\n");
> +                       return PTR_ERR(perst);

return dev_err_probe(...)?

This error condition is triggered on Sparrow Hawk and White Hawk,
as their DTS does not have perst:

    pcie-rcar-gen4 e65d0000.pcie: Failed to get PERST#
    pcie-rcar-gen4 e65d0000.pcie: probe with driver pcie-rcar-gen4
failed with error -2

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.