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.
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);
|