]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/rtc/rtc-s3c.c: allow multiple open / allow no-ioctl-open'ed rtc to have irq.
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 25 Aug 2011 22:59:24 +0000 (15:59 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Aug 2011 01:51:00 +0000 (18:51 -0700)
commit925917c4899e8eace159f0dca2638d81c5541120
tree67aac33c82bec7cc50034374c58b7ef1f5bd38a2
parentb5e6c4b9aba2f60fdd7bde9cf566a95525406151
drivers/rtc/rtc-s3c.c: allow multiple open / allow no-ioctl-open'ed rtc to have irq.

The previous rtc-s3c had two issues related with its IRQ.

1. Users cannot open rtc multiple times because an open operation
   calls request_irq on the same IRQ.  (e.g., two user processes wants to
   open and read RTC time from rtc-s3c at the same time)

2. If alarm is set and no one has the rtc opened with filesystem
   (either the alarm is set by kernel/boot-loader or user set an alarm and
   closed rtc dev file), the pending bit is not cleared and no further
   interrupt is invoked.  When the alarm is used by the system itself such
   as a resume from suspend-to-RAM or other Low-power modes/idle, this is
   a critical issue.

This patch mitigates these issues by calling request_irq at probe and
free_irq at remove.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-s3c.c