Hi Thomas, thomas.petazzoni@xxxxxxxxxxx wrote on Wed, 6 Apr 2022 09:00:04 +0200: > 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. Right, I'll fix it. Thanks! Miquèl