pinctrl: renesas: rzg2l: Use raw_spinlock_irqsave() on power source update

The rest of the driver uses raw_spin_lock_irqsave() and
raw_spin_unlock_irqrestore() for locking.  To avoid concurrency issues
or deadlocks, use raw_spinlock_irqsave() via the scoped_guard() helper
for power source updates as well.

Fixes: bbe2277ded ("pinctrl: renesas: rzg2l: Add support for selecting power source for {WDT,AWO,ISO}")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260603151642.4075678-2-claudiu.beznea@kernel.org
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
This commit is contained in:
Claudiu Beznea 2026-06-03 18:16:37 +03:00 committed by Geert Uytterhoeven
parent 80538a5397
commit 1427017980

View File

@ -1137,7 +1137,7 @@ static int rzg2l_set_power_source(struct rzg2l_pinctrl *pctrl, u32 pin, u32 caps
return pwr_reg;
if (pwr_reg == OTHER_POC) {
scoped_guard(raw_spinlock, &pctrl->lock) {
scoped_guard(raw_spinlock_irqsave, &pctrl->lock) {
val = readb(pctrl->base + pwr_reg);
if (poc_val)
val |= mask;