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

From: Geert Uytterhoeven

Date: Tue Jul 14 2026 - 11:11:04 EST


Hi Marek,

On Sat, 4 Jul 2026 at 22:28, Marek Vasut
<marek.vasut+renesas@xxxxxxxxxxx> 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 <marek.vasut+renesas@xxxxxxxxxxx>

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 -- geert@xxxxxxxxxxxxxx

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