Hello Miquèl, On Tue, 5 Apr 2022 20:47:11 +0200 Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote: > + spin_lock_irqsave(&sysctrl_priv->lock, flags); Taking a lock here... > + > + if (enable) { > + val = readl(sysctrl_priv->reg + R9A06G032_SYSCTRL_PWRCTRL_RTC); > + val &= ~R9A06G032_SYSCTRL_PWRCTRL_RTC_RST; > + writel(val, sysctrl_priv->reg + R9A06G032_SYSCTRL_PWRCTRL_RTC); > + val |= R9A06G032_SYSCTRL_PWRCTRL_RTC_CLKEN; > + writel(val, sysctrl_priv->reg + R9A06G032_SYSCTRL_PWRCTRL_RTC); > + val |= R9A06G032_SYSCTRL_PWRCTRL_RTC_RSTN_FW; > + writel(val, sysctrl_priv->reg + R9A06G032_SYSCTRL_PWRCTRL_RTC); > + val &= ~R9A06G032_SYSCTRL_PWRCTRL_RTC_IDLE_REQ; > + writel(val, sysctrl_priv->reg + R9A06G032_SYSCTRL_PWRCTRL_RTC); > + val = readl(sysctrl_priv->reg + R9A06G032_SYSCTRL_PWRSTAT_RTC); > + if (val & R9A06G032_SYSCTRL_PWRSTAT_RTC_IDLE) > + return -EIO; And forgetting to release it here in the error case. Thomas -- Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com