linux-mips
[Top] [All Lists]

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

To: alessandro.zummo@towertech.it
Subject: Re: [rtc-linux] [PATCH 3/4] rtc: Add rtc-tx4939 driver
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Fri, 21 Nov 2008 23:12:06 +0900 (JST)
Cc: rtc-linux@googlegroups.com, linux-mips@linux-mips.org, ralf@linux-mips.org
In-reply-to: <20081120164533.73ba1f7f@i1501.lan.towertech.it>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1227194815-16200-1-git-send-email-anemo@mba.ocn.ne.jp> <20081120164533.73ba1f7f@i1501.lan.towertech.it>
Sender: linux-mips-bounce@linux-mips.org
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);

<Prev in Thread] Current Thread [Next in Thread>