diff options
Diffstat (limited to 'drivers/rtc/rtc-dev.c')
-rw-r--r-- | drivers/rtc/rtc-dev.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 3109865e8d73..814b9e1873f5 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
@@ -61,7 +61,9 @@ static void rtc_uie_task(void *data) | |||
61 | int err; | 61 | int err; |
62 | 62 | ||
63 | err = rtc_read_time(&rtc->class_dev, &tm); | 63 | err = rtc_read_time(&rtc->class_dev, &tm); |
64 | spin_lock_irq(&rtc->irq_lock); | 64 | |
65 | local_irq_disable(); | ||
66 | spin_lock(&rtc->irq_lock); | ||
65 | if (rtc->stop_uie_polling || err) { | 67 | if (rtc->stop_uie_polling || err) { |
66 | rtc->uie_task_active = 0; | 68 | rtc->uie_task_active = 0; |
67 | } else if (rtc->oldsecs != tm.tm_sec) { | 69 | } else if (rtc->oldsecs != tm.tm_sec) { |
@@ -74,11 +76,11 @@ static void rtc_uie_task(void *data) | |||
74 | } else if (schedule_work(&rtc->uie_task) == 0) { | 76 | } else if (schedule_work(&rtc->uie_task) == 0) { |
75 | rtc->uie_task_active = 0; | 77 | rtc->uie_task_active = 0; |
76 | } | 78 | } |
77 | spin_unlock_irq(&rtc->irq_lock); | 79 | spin_unlock(&rtc->irq_lock); |
78 | if (num) | 80 | if (num) |
79 | rtc_update_irq(&rtc->class_dev, num, RTC_UF | RTC_IRQF); | 81 | rtc_update_irq(&rtc->class_dev, num, RTC_UF | RTC_IRQF); |
82 | local_irq_enable(); | ||
80 | } | 83 | } |
81 | |||
82 | static void rtc_uie_timer(unsigned long data) | 84 | static void rtc_uie_timer(unsigned long data) |
83 | { | 85 | { |
84 | struct rtc_device *rtc = (struct rtc_device *)data; | 86 | struct rtc_device *rtc = (struct rtc_device *)data; |
@@ -238,10 +240,10 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file, | |||
238 | 240 | ||
239 | /* avoid conflicting IRQ users */ | 241 | /* avoid conflicting IRQ users */ |
240 | if (cmd == RTC_PIE_ON || cmd == RTC_PIE_OFF || cmd == RTC_IRQP_SET) { | 242 | if (cmd == RTC_PIE_ON || cmd == RTC_PIE_OFF || cmd == RTC_IRQP_SET) { |
241 | spin_lock(&rtc->irq_task_lock); | 243 | spin_lock_irq(&rtc->irq_task_lock); |
242 | if (rtc->irq_task) | 244 | if (rtc->irq_task) |
243 | err = -EBUSY; | 245 | err = -EBUSY; |
244 | spin_unlock(&rtc->irq_task_lock); | 246 | spin_unlock_irq(&rtc->irq_task_lock); |
245 | 247 | ||
246 | if (err < 0) | 248 | if (err < 0) |
247 | return err; | 249 | return err; |