diff mbox

Re: [PATCH 3/4] rtc: Add rtc-tx4939 driver

Message ID 20081121.231206.96686926.anemo@mba.ocn.ne.jp
State Accepted, archived
Headers show

Commit Message

Atsushi Nemoto Nov. 21, 2008, 2:12 p.m. UTC
On Thu, 20 Nov 2008 16:45:33 +0100, Alessandro Zummo <alessandro.zummo@towertech.it> wrote:
>  AIE_ON an OFF are mapped to alarm_irq_enable, please see the latest patches
>  on the rtc mailing list or here http://patchwork.ozlabs.org/patch/9676/

This patch cause deadlock on RTC UIE emulation (again).

Please fold this fix into the rtc-add-alarm-update-irq-interfaces patch.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
-~----------~----~----~----~------~----~------~--~---

Comments

Alessandro Zummo Nov. 21, 2008, 4:24 p.m. UTC | #1
On Fri, 21 Nov 2008 23:12:06 +0900 (JST)
Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:

> On Thu, 20 Nov 2008 16:45:33 +0100, Alessandro Zummo <alessandro.zummo@towertech.it> wrote:
> >  AIE_ON an OFF are mapped to alarm_irq_enable, please see the latest patches
> >  on the rtc mailing list or here http://patchwork.ozlabs.org/patch/9676/  
> 
> This patch cause deadlock on RTC UIE emulation (again).
> 
> Please fold this fix into the rtc-add-alarm-update-irq-interfaces patch.

 thanks!

 done, with minor changes. available
 at http://patchwork.ozlabs.org/patch/10039/
diff mbox

Patch

diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 6195f7a..6c39915 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -333,9 +333,8 @@  int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled)
 
 #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
 	if (enabled == 0 && rtc->uie_irq_active) {
-		err = rtc_dev_update_irq_enable_emul(rtc, enabled);
 		mutex_unlock(&rtc->ops_lock);
-		return err;
+		return rtc_dev_update_irq_enable_emul(rtc, enabled);
 	}
 #endif
 
@@ -353,8 +352,10 @@  int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled)
 	 * -EINVAL to signal that it has been configured without
 	 * interrupts or that are not available at the moment.
 	 */
-	if (err == -EINVAL)
-		err = rtc_dev_update_irq_enable_emul(rtc, enabled);
+	if (err == -EINVAL) {
+		mutex_unlock(&rtc->ops_lock);
+		return rtc_dev_update_irq_enable_emul(rtc, enabled);
+	}
 #endif
 
 	mutex_unlock(&rtc->ops_lock);