<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/rtc, branch v3.10.107</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.107</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.107'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2017-06-20T12:04:40Z</updated>
<entry>
<title>rtc: s35390a: improve irq handling</title>
<updated>2017-06-20T12:04:40Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>uwe@kleine-koenig.org</email>
</author>
<published>2016-07-02T15:28:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=535c7d619017d41a03a5b8b475a8348a9646af2b'/>
<id>urn:sha1:535c7d619017d41a03a5b8b475a8348a9646af2b</id>
<content type='text'>
commit 3bd32722c827d00eafe8e6d5b83e9f3148ea7c7e upstream.

On some QNAP NAS devices the rtc can wake the machine. Several people
noticed that once the machine was woken this way it fails to shut down.
That's because the driver fails to acknowledge the interrupt and so it
keeps active and restarts the machine immediatly after shutdown. See
https://bugs.debian.org/794266 for a bug report.

Doing this correctly requires to interpret the INT2 flag of the first read
of the STATUS1 register because this bit is cleared by read.

Note this is not maximally robust though because a pending irq isn't
detected when the STATUS1 register was already read (and so INT2 is not
set) but the irq was not disabled. But that is a hardware imposed problem
that cannot easily be fixed by software.

Signed-off-by: Uwe Kleine-König &lt;uwe@kleine-koenig.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>rtc: s35390a: implement reset routine as suggested by the reference</title>
<updated>2017-06-20T12:04:40Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>uwe@kleine-koenig.org</email>
</author>
<published>2016-07-02T15:28:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=df4be7e66b1e801140e65b275bcc67809610ad7a'/>
<id>urn:sha1:df4be7e66b1e801140e65b275bcc67809610ad7a</id>
<content type='text'>
commit 8e6583f1b5d1f5f129b873f1428b7e414263d847 upstream.

There were two deviations from the reference manual: you have to wait
half a second when POC is active and you might have to repeat
initialization when POC or BLD are still set after the sequence.

Note however that as POC and BLD are cleared by read the driver might
not be able to detect that a reset is necessary. I don't have a good
idea how to fix this.

Additionally report the value read from STATUS1 to the caller. This
prepares the next patch.

Signed-off-by: Uwe Kleine-König &lt;uwe@kleine-koenig.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>rtc: s35390a: make sure all members in the output are set</title>
<updated>2017-06-20T12:04:39Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>uwe@kleine-koenig.org</email>
</author>
<published>2017-04-03T21:32:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=231b0f80d19c96a2083fc735a116882e8db92df5'/>
<id>urn:sha1:231b0f80d19c96a2083fc735a116882e8db92df5</id>
<content type='text'>
commit ac4d4f65bbcba478309de36929016d2618421ba1 upstream.

The rtc core calls the .read_alarm with all fields initialized to 0. As
the s35390a driver doesn't touch some fields the returned date is
interpreted as a date in January 1900. So make sure all fields are set
to -1; some of them are then overwritten with the right data depending
on the hardware state.

In mainline this is done by commit d68778b80dd7 ("rtc: initialize output
parameter for read alarm to "uninitialized"") in the core. This is
considered to dangerous for stable as it might have side effects for
other rtc drivers that might for example rely on alarm-&gt;time.tm_sec
being initialized to 0.

Signed-off-by: Uwe Kleine-König &lt;uwe@kleine-koenig.org&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>rtc: interface: ignore expired timers when enqueuing new timers</title>
<updated>2017-06-20T12:04:21Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2016-05-16T16:22:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=296a1ab22e2a153f428d8b3c7c47fc4076c05760'/>
<id>urn:sha1:296a1ab22e2a153f428d8b3c7c47fc4076c05760</id>
<content type='text'>
commit 2b2f5ff00f63847d95adad6289bd8b05f5983dd5 upstream.

This patch fixes a RTC wakealarm issue, namely, the event fires during
hibernate and is not cleared from the list, causing hwclock to block.

The current enqueuing does not trigger an alarm if any expired timers
already exist on the timerqueue. This can occur when a RTC wake alarm
is used to wake a machine out of hibernate and the resumed state has
old expired timers that have not been removed from the timer queue.
This fix skips over any expired timers and triggers an alarm if there
are no pending timers on the timerqueue. Note that the skipped expired
timer will get reaped later on, so there is no need to clean it up
immediately.

The issue can be reproduced by putting a machine into hibernate and
waking it with the RTC wakealarm.  Running the example RTC test program
from tools/testing/selftests/timers/rtctest.c after the hibernate will
block indefinitely.  With the fix, it no longer blocks after the
hibernate resume.

BugLink: http://bugs.launchpad.net/bugs/1333569

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>rtc: vr41xx: Wire up alarm_irq_enable</title>
<updated>2016-06-07T08:42:51Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2016-03-01T08:50:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e35d98315485e10cf3865e0495ec7d1e0d3a3379'/>
<id>urn:sha1:e35d98315485e10cf3865e0495ec7d1e0d3a3379</id>
<content type='text'>
commit a25f4a95ec3cded34c1250364eba704c5e4fdac4 upstream.

drivers/rtc/rtc-vr41xx.c:229: warning: âvr41xx_rtc_alarm_irq_enableâ defined but not used

Apparently the conversion to alarm_irq_enable forgot to wire up the
callback.

Fixes: 16380c153a69c378 ("RTC: Convert rtc drivers to use the alarm_irq_enable method")
Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>rtc: rtc-at91rm9200: fix infinite wait for ACKUPD irq</title>
<updated>2014-06-26T19:12:37Z</updated>
<author>
<name>Boris BREZILLON</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2014-06-06T21:36:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4b6b037c15b9463e6e80aa8d346e53f08ecabb34'/>
<id>urn:sha1:4b6b037c15b9463e6e80aa8d346e53f08ecabb34</id>
<content type='text'>
commit 2fe121e1f5aa3bf31b418a9790db6c400e922291 upstream.

The rtc user must wait at least 1 sec between each time/calandar update
(see atmel's datasheet chapter "Updating Time/Calendar").

Use the 1Hz interrupt to update the at91_rtc_upd_rdy flag and wait for
the at91_rtc_wait_upd_rdy event if the rtc is not ready.

This patch fixes a deadlock in an uninterruptible wait when the RTC is
updated more than once every second.  AFAICT the bug is here from the
beginning, but I think we should at least backport this fix to 3.10 and
the following longterm and stable releases.

Signed-off-by: Boris BREZILLON &lt;boris.brezillon@free-electrons.com&gt;
Reported-by: Bryan Evenson &lt;bevenson@melinkcorp.com&gt;
Tested-by: Bryan Evenson &lt;bevenson@melinkcorp.com&gt;
Cc: Andrew Victor &lt;linux@maxim.org.za&gt;
Cc: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Cc: Jean-Christophe Plagniol-Villard &lt;plagnioj@jcrosoft.com&gt;
Cc: 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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rtc-cmos: Add an alarm disable quirk</title>
<updated>2014-02-13T21:48:03Z</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@alien8.de</email>
</author>
<published>2013-07-20T17:00:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=29a16182858f1aea2715aa96ecd19763e75d6def'/>
<id>urn:sha1:29a16182858f1aea2715aa96ecd19763e75d6def</id>
<content type='text'>
commit d5a1c7e3fc38d9c7d629e1e47f32f863acbdec3d upstream.

41c7f7424259f ("rtc: Disable the alarm in the hardware (v2)") added the
functionality to disable the RTC wake alarm when shutting down the box.

However, there are at least two b0rked BIOSes we know about:

https://bugzilla.novell.com/show_bug.cgi?id=812592
https://bugzilla.novell.com/show_bug.cgi?id=805740

where, when wakeup alarm is enabled in the BIOS, the machine reboots
automatically right after shutdown, regardless of what wakeup time is
programmed.

Bisecting the issue lead to this patch so disable its functionality with
a DMI quirk only for those boxes.

Cc: Brecht Machiels &lt;brecht@mos6581.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Rabin Vincent &lt;rabin.vincent@stericsson.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
[jstultz: Changed variable name for clarity, added extra dmi entry]
Tested-by: Brecht Machiels &lt;brecht@mos6581.org&gt;
Tested-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rtc: max8907: weekday encoding fixes</title>
<updated>2014-02-06T19:08:15Z</updated>
<author>
<name>Stephen Warren</name>
<email>swarren@nvidia.com</email>
</author>
<published>2014-01-23T23:55:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0ac9f15fbe599024fa3523c3083add257f53c849'/>
<id>urn:sha1:0ac9f15fbe599024fa3523c3083add257f53c849</id>
<content type='text'>
commit 75ea799df4cb07e505c91b4abaa87bc28aad3e66 upstream.

The current MAX8907 driver has two issues related to weekday value
handling:

1)

The HW WEEKDAY register has range 0..6 rather than 1..7 as documented.
Note that I validated the actual HW range by observing the HW register
roll from 6-&gt;0 rather than 6-&gt;7-&gt;1 as would otherwise be expected.

This matches Linux's tm_wday range of 0..6.

When the CMOS RAM content is lost, the date returned from the device is
2007-01-01 00:00:00, which is a Monday.  The WEEKDAY register reads 1 in
this case.  This matches the numbering in Linux's tm_wday field.

Hence we should write Linux's tm_wday value to the register without
modifying it.  Hence, remove the +1/-1 calculations for WEEKDAY/tm_wday.

2)

There's no need to make alarms match on the WEEKDAY register, since the
other fields together uniquely define the alarm date/time.  Ignoring the
WEEKDAY value in the match isolates the driver from any incorrect value in
the current time copy of the WEEKDAY register.

Each change individually, or both together, solves an issue that I
observed; "hwclock -r" would time out waiting for its alarm to fire if the
CMOS RAM content had been lost, and hence the WEEKDAY register value
mismatched what the driver expected it to be.  "hwclock -w" would solve
this by over-writing the HW default WEEKDAY register value with what the
driver expected.

Signed-off-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drivers/rtc/rtc-at91rm9200.c: correct alarm over day/month wrap</title>
<updated>2013-12-20T15:45:09Z</updated>
<author>
<name>Linus Pizunski</name>
<email>linus@narrativeteam.com</email>
</author>
<published>2013-12-13T01:12:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8de7e61bf3ea5eb5349c4bd1de196fa4d397caab'/>
<id>urn:sha1:8de7e61bf3ea5eb5349c4bd1de196fa4d397caab</id>
<content type='text'>
commit eb3c227289840eed95ddfb0516046f08d8993940 upstream.

Update month and day of month to the alarm month/day instead of current
day/month when setting the RTC alarm mask.

Signed-off-by: Linus Pizunski &lt;linus@narrativeteam.com&gt;
Signed-off-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drivers/rtc/rtc-max77686.c: Fix wrong register</title>
<updated>2013-09-14T13:54:57Z</updated>
<author>
<name>Sangjung Woo</name>
<email>sangjung.woo@samsung.com</email>
</author>
<published>2013-09-11T21:24:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=70aa7b8f105b0b5bb82d2082a230efb7f34645a0'/>
<id>urn:sha1:70aa7b8f105b0b5bb82d2082a230efb7f34645a0</id>
<content type='text'>
commit 1748cbf7f7c464593232cde914f5a103181a83b5 upstream.

Fix a read of the wrong register when checking whether the RTC timer has
reached the alarm time.

Signed-off-by: Sangjung Woo &lt;sangjung.woo@samsung.com&gt;
Signed-off-by: Myugnjoo Ham &lt;myungjoo.ham@samsung.com&gt;
Reviewed-by: Jonghwa Lee &lt;jonghwa3.lee@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;
Signed-off-by: Jonghwan Choi &lt;jhbird.choi@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
