[PATCH v4 1/2] pinctrl: renesas: rzg2l: Fix PMC restore

Biju Das posted 2 patches 1 week, 3 days ago
[PATCH v4 1/2] pinctrl: renesas: rzg2l: Fix PMC restore
Posted by Biju Das 1 week, 3 days ago
The PMC restore needs unlocking the register using PWPR register.

Fixes: 14c32dc1f63d ("pinctrl: renesas: rzg2l: Add function pointer for PFC register locking")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/pinctrl/renesas/pinctrl-rzg2l.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index f524af6f586f..94cb77949f59 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -2993,7 +2993,11 @@ static void rzg2l_pinctrl_pm_setup_regs(struct rzg2l_pinctrl *pctrl, bool suspen
 		 * Now cache the registers or set them in the order suggested by
 		 * HW manual (section "Operation for GPIO Function").
 		 */
-		RZG2L_PCTRL_REG_ACCESS8(suspend, pctrl->base + PMC(off), cache->pmc[port]);
+		if (suspend)
+			RZG2L_PCTRL_REG_ACCESS8(suspend, pctrl->base + PMC(off), cache->pmc[port]);
+		else
+			pctrl->data->pmc_writeb(pctrl, cache->pmc[port], PMC(off));
+
 		if (has_iolh) {
 			RZG2L_PCTRL_REG_ACCESS32(suspend, pctrl->base + IOLH(off),
 						 cache->iolh[0][port]);
-- 
2.43.0
Re: [PATCH v4 1/2] pinctrl: renesas: rzg2l: Fix PMC restore
Posted by Geert Uytterhoeven 1 week, 2 days ago
Hi Biju,

Thanks for your patch!

On Sun, 21 Sept 2025 at 13:16, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> The PMC restore needs unlocking the register using PWPR register.
>
> Fixes: 14c32dc1f63d ("pinctrl: renesas: rzg2l: Add function pointer for PFC register locking")

I would rather say:

    Fixes: ede014cd1ea6422d ("pinctrl: renesas: rzg2l: Add function
pointer for PMC register write")

as that is the (later) commit that should have converted the direct
write to an indirect call.  However, both commits prepare for the
advent of RZ/V2H support, and the actual issue cannot be experienced
before commit 9bd95ac86e700ab8 ("pinctrl: renesas: rzg2l: Add support
for RZ/V2H SoC").

> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-pinctrl for v6.19.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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