Skip to content

Commit cda6a5d

Browse files
prabhakarladgeertu
authored andcommitted
clk: renesas: cpg-mssr: Unlock before reset verification
Move spin_unlock_irqrestore() before verifying the reset result and printing errors. The verification condition only uses local variables and does not require locking. Reported-by: Pavel Machek <pavel@nabladev.com> Closes: https://lore.kernel.org/all/aVujAQJSDn6WyORK@duo.ucw.cz/ Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260105140625.2590685-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent c292266 commit cda6a5d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/clk/renesas/renesas-cpg-mssr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,14 +794,14 @@ static int cpg_mrcr_set_reset_state(struct reset_controller_dev *rcdev,
794794

795795
/* Verify the operation */
796796
val = readl(reg_addr);
797+
798+
spin_unlock_irqrestore(&priv->pub.rmw_lock, flags);
799+
797800
if (set == !(bitmask & val)) {
798801
dev_err(priv->dev, "Reset register %u%02u operation failed\n", reg, bit);
799-
spin_unlock_irqrestore(&priv->pub.rmw_lock, flags);
800802
return -EIO;
801803
}
802804

803-
spin_unlock_irqrestore(&priv->pub.rmw_lock, flags);
804-
805805
return 0;
806806
}
807807

0 commit comments

Comments
 (0)