<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/rtc/interface.c, branch v3.19</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-12-11T01:41:16Z</updated>
<entry>
<title>rtc: refine rtc_timer_do_work() to consider other set alarm failures</title>
<updated>2014-12-11T01:41:16Z</updated>
<author>
<name>Xunlei Pang</name>
<email>pang.xunlei@linaro.org</email>
</author>
<published>2014-12-10T23:54:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6528b889955d36caa06712789746cfbd0ecf3898'/>
<id>urn:sha1:6528b889955d36caa06712789746cfbd0ecf3898</id>
<content type='text'>
rtc_timer_do_work() only judges -ETIME failure of__rtc_set_alarm(), but
doesn't handle other failures like -EIO, -EBUSY, etc.

If there is a failure other than -ETIME, the next rtc_timer will stay in
the timerqueue.  Then later rtc_timers will be enqueued directly because
they have a later expires time, so the alarm irq will never be programmed.

When such failures happen, this patch will retry __rtc_set_alarm(), if
still can't program the alarm time, it will remove current rtc_timer from
timerqueue and fetch next one, thus preventing it from affecting other rtc
timers.

Signed-off-by: Xunlei Pang &lt;pang.xunlei@linaro.org&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd.bergmann@linaro.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>drivers/rtc/interface.c: check the validation of rtc_time in __rtc_read_time</title>
<updated>2014-12-11T01:41:13Z</updated>
<author>
<name>Hyogi Gim</name>
<email>ciogenis@gmail.com</email>
</author>
<published>2014-12-10T23:52:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=16682c86d2fb68cc78c6cc0af51c2a78809dc5b0'/>
<id>urn:sha1:16682c86d2fb68cc78c6cc0af51c2a78809dc5b0</id>
<content type='text'>
Some rtc devices always return '0' when rtc_class_ops.read_time is
called.  So if rtc_time isn't verified in callback, rtc interface cannot
know whether rtc_time is valid.

Check rtc_time by using 'rtc_valid_tm' in '__rtc_read_time'.  And add
the message for debugging.

Signed-off-by: Hyogi Gim &lt;hyogi.gim@lge.com&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>drivers/rtc/interface.c: check the error after __rtc_read_time()</title>
<updated>2014-08-08T22:57:19Z</updated>
<author>
<name>Hyogi Gim</name>
<email>hyogi.gim@lge.com</email>
</author>
<published>2014-08-08T21:20:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ca6dc2dab97133b874c2f6a76b6125497b67b429'/>
<id>urn:sha1:ca6dc2dab97133b874c2f6a76b6125497b67b429</id>
<content type='text'>
In __rtc_set_alarm(), the error after __rtc_read_time() is not checked.
If rtc device fail to read time, we cannot guarantee the following
process.

Add the verification code for returned __rtc_read_time() error.

Signed-off-by: Hyogi Gim &lt;hyogi.gim@lge.com&gt;
Acked-by: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>drivers/rtc/interface.c: fix infinite loop in initializing the alarm</title>
<updated>2014-06-06T23:08:06Z</updated>
<author>
<name>Ales Novak</name>
<email>alnovak@suse.cz</email>
</author>
<published>2014-06-06T21:35:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ee1d90146815fdc8d653c558b327fff2acba041d'/>
<id>urn:sha1:ee1d90146815fdc8d653c558b327fff2acba041d</id>
<content type='text'>
In __rtc_read_alarm(), if the alarm time retrieved by
rtc_read_alarm_internal() from the device contains invalid values (e.g.
month=2,mday=31) and the year not set (=-1), the initialization will
loop infinitely because the year-fixing loop expects the time being
invalid due to leap year.

Fix reduces the loop to the leap years and adds final validity check.

Signed-off-by: Ales Novak &lt;alnovak@suse.cz&gt;
Acked-by: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Reported-by: Jiri Bohac &lt;jbohac@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>rtc: verify a critical argument to rtc_update_irq() before using it</title>
<updated>2014-04-03T23:21:22Z</updated>
<author>
<name>Alessandro Zummo</name>
<email>a.zummo@towertech.it</email>
</author>
<published>2014-04-03T21:50:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=131c9cc832162bfe45be1065fa88d1ec2c165a3d'/>
<id>urn:sha1:131c9cc832162bfe45be1065fa88d1ec2c165a3d</id>
<content type='text'>
This small addition to the core simplifies code in the drivers and makes
them more robust when handling shared IRQs.

Signed-off-by: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: Alexander Shiyan &lt;shc_work@mail.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>rtc: Keep system awake until all expired RTC timers are handled</title>
<updated>2013-07-22T16:38:25Z</updated>
<author>
<name>Zoran Markovic</name>
<email>zoran.markovic@linaro.org</email>
</author>
<published>2013-06-26T23:09:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=14d0e347ea2db51144a8800d7c7576db96f69983'/>
<id>urn:sha1:14d0e347ea2db51144a8800d7c7576db96f69983</id>
<content type='text'>
Current implementation of RTC interface allows for system suspend to
occur in the following cases:
(a) if a timer is set in the past and rtc_timer_do_work() is scheduled
to handle it, and
(b) if rtc_timer_do_work() is called to handle expired timers whose
handlers implement a preemption point.

A pending suspend request may be honoured in the above cases causing
timer handling to be delayed until after the next resume. This is
undesirable since timer handlers may have time-critical code to execute.

This patch makes sure that the system stays awake until all expired
timers are handled.

Note that all calls to pm_stay_awake() are eventually paired with
the single pm_relax() call in rtc_timer_do_work(), which is launched
using schedule_work().

Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Arve Hjonnevag &lt;arve@android.com&gt;
Cc: Todd Poynor &lt;toddpoynor@google.com&gt;
Signed-off-by: Zoran Markovic &lt;zoran.markovic@linaro.org&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>drivers/rtc/interface.c: return -EBUSY, not -EACCES when device is busy</title>
<updated>2013-07-03T23:08:00Z</updated>
<author>
<name>Chris Brand</name>
<email>chris.brand@broadcom.com</email>
</author>
<published>2013-07-03T22:07:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0734e27f0befe9e88c2b5dad789b05b7bf86ce90'/>
<id>urn:sha1:0734e27f0befe9e88c2b5dad789b05b7bf86ce90</id>
<content type='text'>
If rtc-&gt;irq_task is non-NULL and task is NULL, they always
rtc_irq_set_freq(), whenever err is set to -EBUSY it will then immediately
be set to -EACCES, misleading the caller as to the underlying problem.

Signed-off-by: Chris Brand &lt;chris.brand@broadcom.com&gt;
Acked-by: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>drivers/rtc/interface.c: fix checkpatch errors</title>
<updated>2013-07-03T23:07:46Z</updated>
<author>
<name>Sachin Kamat</name>
<email>sachin.kamat@linaro.org</email>
</author>
<published>2013-07-03T22:05:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3ff2e13ce1b4172bf7d188799d3a106c0e2bb5cd'/>
<id>urn:sha1:3ff2e13ce1b4172bf7d188799d3a106c0e2bb5cd</id>
<content type='text'>
Fixes the following types of errors:
  ERROR: "foo* bar" should be "foo *bar"
  ERROR: else should follow close brace '}'
  WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Sachin Kamat &lt;sachin.kamat@linaro.org&gt;
Cc: Jingoo Han &lt;jg1.han@samsung.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>driver-core: constify data for class_find_device()</title>
<updated>2013-02-06T20:18:56Z</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2013-02-01T19:40:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9f3b795a626ee79574595e06d1437fe0c7d51d29'/>
<id>urn:sha1:9f3b795a626ee79574595e06d1437fe0c7d51d29</id>
<content type='text'>
All in-kernel users of class_find_device() don't really need mutable
data for match callback.

In two places (kernel/power/suspend_test.c, drivers/scsi/osd/osd_uld.c)
this patch changes match callbacks to use const search data.

The const is propagated to rtc_class_open() and power_supply_get_by_name()
parameters.

Note that there's a dev reference leak in suspend_test.c that's not
touched in this patch.

Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Acked-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>RTC: Avoid races between RTC alarm wakeup and suspend.</title>
<updated>2012-08-08T18:49:16Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2012-08-05T20:56:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7523ceed42d84c1afaa1dc498bffed53c2aa444e'/>
<id>urn:sha1:7523ceed42d84c1afaa1dc498bffed53c2aa444e</id>
<content type='text'>
If an RTC alarm fires just as suspend is happening, it is possible for
suspend to complete and the alarm to be missed.

To avoid the race, we must register the event with the PM core.

As the event is made visible to userspace through a thread which is
only scheduled by the interrupt, we need a pm_stay_awake/pm_relax
pair preventing suspend from the interrupt until the thread completes
its work.

This makes the pm_wakeup_event() call in cmos_interrupt unnecessary as
it provides suspend protection for all RTCs that use rtc_update_irq.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
</feed>
