<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/rtc/rtc-cmos.c, branch v4.9-rc5</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>rtc: cmos: avoid unused function warning</title>
<updated>2016-09-22T12:23:29+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-09-22T09:48:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=00f7f90c51dfc2403257e2c7410d453e72bf6a41'/>
<id>00f7f90c51dfc2403257e2c7410d453e72bf6a41</id>
<content type='text'>
A bug fix for the ACPI side of this driver caused a harmless
build warning:

drivers/rtc/rtc-cmos.c:1115:13: error: 'cmos_check_acpi_rtc_status' defined but not used [-Werror=unused-function]
 static void cmos_check_acpi_rtc_status(struct device *dev,

We can avoid the warning and simplify the driver at the same time
by removing the #ifdef for CONFIG_PM and rely on the SIMPLE_DEV_PM_OPS()
to set everything up correctly. cmos_resume() has to get marked
as __maybe_unused so we don't introduce another warning, and
the two variants of cmos_poweroff() can get merged into one using
an IS_ENABLED() check.

Fixes: 983bf1256edb ("rtc: cmos: Clear ACPI-driven alarms upon resume")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A bug fix for the ACPI side of this driver caused a harmless
build warning:

drivers/rtc/rtc-cmos.c:1115:13: error: 'cmos_check_acpi_rtc_status' defined but not used [-Werror=unused-function]
 static void cmos_check_acpi_rtc_status(struct device *dev,

We can avoid the warning and simplify the driver at the same time
by removing the #ifdef for CONFIG_PM and rely on the SIMPLE_DEV_PM_OPS()
to set everything up correctly. cmos_resume() has to get marked
as __maybe_unused so we don't introduce another warning, and
the two variants of cmos_poweroff() can get merged into one using
an IS_ENABLED() check.

Fixes: 983bf1256edb ("rtc: cmos: Clear ACPI-driven alarms upon resume")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: cmos: Restore alarm after resume</title>
<updated>2016-09-21T20:09:00+00:00</updated>
<author>
<name>Gabriele Mazzotta</name>
<email>gabriele.mzt@gmail.com</email>
</author>
<published>2016-09-19T23:12:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=68669d55f7ad31832692254485a07b6e412ae082'/>
<id>68669d55f7ad31832692254485a07b6e412ae082</id>
<content type='text'>
Some platform firmware may interfere with the RTC alarm over suspend,
resulting in the kernel and hardware having different ideas about system
state but also potentially causing problems with firmware that assumes the
OS will clean this case up.  This patch restores the RTC alarm on resume
to ensure that kernel and hardware are in sync.

The case we've seen is Intel Rapid Start, which is a firmware-mediated
feature that automatically transitions systems from suspend-to-RAM to
suspend-to-disk without OS involvement.  It does this by setting the RTC
alarm and a flag that indicates that on wake it should perform the
transition rather than re-starting the OS.  However, if the OS has set a
wakeup alarm that would wake the machine earlier, it refuses to overwrite
it and allows the system to wake instead.

This fails in the following situation:

1) User configures Intel Rapid Start to transition after (say) 15
minutes
2) User suspends to RAM. Firmware sets the wakeup alarm for 15 minutes
in the future
3) User resumes after 5 minutes. Firmware does not reset the alarm, and
as such it is still set for 10 minutes in the future
4) User suspends after 5 minutes. Firmware notices that the alarm is set
for 5 minutes in the future, which is less than the 15 minute transition
threshold. It therefore assumes that the user wants the machine to wake
in 5 minutes
5) System resumes after 5 minutes

The worst case scenario here is that the user may have put the system in a
bag between (4) and (5), resulting in it running in a confined space and
potentially overheating.  This seems reasonably important.  The Rapid
Start support code got added in 3.11, but it can be configured in the
firmware regardless of kernel support.

Signed-off-by: Gabriele Mazzotta &lt;gabriele.mzt@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some platform firmware may interfere with the RTC alarm over suspend,
resulting in the kernel and hardware having different ideas about system
state but also potentially causing problems with firmware that assumes the
OS will clean this case up.  This patch restores the RTC alarm on resume
to ensure that kernel and hardware are in sync.

The case we've seen is Intel Rapid Start, which is a firmware-mediated
feature that automatically transitions systems from suspend-to-RAM to
suspend-to-disk without OS involvement.  It does this by setting the RTC
alarm and a flag that indicates that on wake it should perform the
transition rather than re-starting the OS.  However, if the OS has set a
wakeup alarm that would wake the machine earlier, it refuses to overwrite
it and allows the system to wake instead.

This fails in the following situation:

1) User configures Intel Rapid Start to transition after (say) 15
minutes
2) User suspends to RAM. Firmware sets the wakeup alarm for 15 minutes
in the future
3) User resumes after 5 minutes. Firmware does not reset the alarm, and
as such it is still set for 10 minutes in the future
4) User suspends after 5 minutes. Firmware notices that the alarm is set
for 5 minutes in the future, which is less than the 15 minute transition
threshold. It therefore assumes that the user wants the machine to wake
in 5 minutes
5) System resumes after 5 minutes

The worst case scenario here is that the user may have put the system in a
bag between (4) and (5), resulting in it running in a confined space and
potentially overheating.  This seems reasonably important.  The Rapid
Start support code got added in 3.11, but it can be configured in the
firmware regardless of kernel support.

Signed-off-by: Gabriele Mazzotta &lt;gabriele.mzt@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: cmos: Clear ACPI-driven alarms upon resume</title>
<updated>2016-09-21T20:08:42+00:00</updated>
<author>
<name>Gabriele Mazzotta</name>
<email>gabriele.mzt@gmail.com</email>
</author>
<published>2016-09-19T23:12:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=983bf1256edb477a376b6ce95adf36e13bc88f9a'/>
<id>983bf1256edb477a376b6ce95adf36e13bc88f9a</id>
<content type='text'>
Currently ACPI-driven alarms are not cleared when they wake the
system. As consequence, expired alarms must be manually cleared to
program a new alarm. Fix this by correctly handling ACPI-driven
alarms.

More specifically, the ACPI specification [1] provides for two
alternative implementations of the RTC. Depending on the
implementation, the driver either clear the alarm from the resume
callback or from ACPI interrupt handler:

 - The platform has the RTC wakeup status fixed in hardware
   (ACPI_FADT_FIXED_RTC is 0). In this case the driver can determine
   if the RTC was the reason of the wakeup from the resume callback
   by reading the RTC status register.

 - The platform has no fixed hardware feature event bits. In this
   case a GPE is used to wake the system and the driver clears the
   alarm from its handler.

[1] http://www.acpi.info/DOWNLOADS/ACPI_5_Errata%20A.pdf

Signed-off-by: Gabriele Mazzotta &lt;gabriele.mzt@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently ACPI-driven alarms are not cleared when they wake the
system. As consequence, expired alarms must be manually cleared to
program a new alarm. Fix this by correctly handling ACPI-driven
alarms.

More specifically, the ACPI specification [1] provides for two
alternative implementations of the RTC. Depending on the
implementation, the driver either clear the alarm from the resume
callback or from ACPI interrupt handler:

 - The platform has the RTC wakeup status fixed in hardware
   (ACPI_FADT_FIXED_RTC is 0). In this case the driver can determine
   if the RTC was the reason of the wakeup from the resume callback
   by reading the RTC status register.

 - The platform has no fixed hardware feature event bits. In this
   case a GPE is used to wake the system and the driver clears the
   alarm from its handler.

[1] http://www.acpi.info/DOWNLOADS/ACPI_5_Errata%20A.pdf

Signed-off-by: Gabriele Mazzotta &lt;gabriele.mzt@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: cmos: Initialize hpet timer before irq is registered</title>
<updated>2016-09-19T22:22:00+00:00</updated>
<author>
<name>Pratyush Anand</name>
<email>panand@redhat.com</email>
</author>
<published>2016-09-15T04:08:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=970fc7f4afd52d638d88aeda985ea03ccd33acee'/>
<id>970fc7f4afd52d638d88aeda985ea03ccd33acee</id>
<content type='text'>
We have observed on few x86 machines with rtc-cmos device that
hpet_rtc_interrupt() is called just after irq registration and before
cmos_do_probe() could call hpet_rtc_timer_init().

So, neither hpet_default_delta nor hpet_t1_cmp is initialized by the time
interrupt is raised in the given situation, and this results in NMI
watchdog LOCKUP.

It has only been observed sporadically on kdump secondary kernels.

See the call trace:
---&lt;-snip-&gt;---
[   27.913194] Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 0
[   27.915371] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-342.el7.x86_64 #1
[   27.917503] Hardware name: HP ProLiant DL160 Gen8, BIOS J03 02/10/2014
[   27.919455]  ffffffff8186a728 0000000059c82488 ffff880034e05af0 ffffffff81637bd4
[   27.921870]  ffff880034e05b70 ffffffff8163144a 0000000000000010 ffff880034e05b80
[   27.924257]  ffff880034e05b20 0000000059c82488 0000000000000000 0000000000000000
[   27.926599] Call Trace:
[   27.927352]  &lt;NMI&gt;  [&lt;ffffffff81637bd4&gt;] dump_stack+0x19/0x1b
[   27.929080]  [&lt;ffffffff8163144a&gt;] panic+0xd8/0x1e7
[   27.930588]  [&lt;ffffffff8111d3e0&gt;] ? restart_watchdog_hrtimer+0x50/0x50
[   27.932502]  [&lt;ffffffff8111d4a2&gt;] watchdog_overflow_callback+0xc2/0xd0
[   27.934427]  [&lt;ffffffff811612c1&gt;] __perf_event_overflow+0xa1/0x250
[   27.936232]  [&lt;ffffffff81161d94&gt;] perf_event_overflow+0x14/0x20
[   27.937957]  [&lt;ffffffff81032ae8&gt;] intel_pmu_handle_irq+0x1e8/0x470
[   27.939799]  [&lt;ffffffff8164164b&gt;] perf_event_nmi_handler+0x2b/0x50
[   27.941649]  [&lt;ffffffff81640d99&gt;] nmi_handle.isra.0+0x69/0xb0
[   27.943348]  [&lt;ffffffff81640f49&gt;] do_nmi+0x169/0x340
[   27.944802]  [&lt;ffffffff816401d3&gt;] end_repeat_nmi+0x1e/0x2e
[   27.946424]  [&lt;ffffffff81056ee5&gt;] ? hpet_rtc_interrupt+0x85/0x380
[   27.948197]  [&lt;ffffffff81056ee5&gt;] ? hpet_rtc_interrupt+0x85/0x380
[   27.949992]  [&lt;ffffffff81056ee5&gt;] ? hpet_rtc_interrupt+0x85/0x380
[   27.951816]  &lt;&lt;EOE&gt;&gt;  &lt;IRQ&gt;  [&lt;ffffffff8108f5a3&gt;] ? run_timer_softirq+0x43/0x340
[   27.954114]  [&lt;ffffffff8111e24e&gt;] handle_irq_event_percpu+0x3e/0x1e0
[   27.955962]  [&lt;ffffffff8111e42d&gt;] handle_irq_event+0x3d/0x60
[   27.957635]  [&lt;ffffffff811210c7&gt;] handle_edge_irq+0x77/0x130
[   27.959332]  [&lt;ffffffff8101704f&gt;] handle_irq+0xbf/0x150
[   27.960949]  [&lt;ffffffff8164a86f&gt;] do_IRQ+0x4f/0xf0
[   27.962434]  [&lt;ffffffff8163faed&gt;] common_interrupt+0x6d/0x6d
[   27.964101]  &lt;EOI&gt;  [&lt;ffffffff8163f43b&gt;] ? _raw_spin_unlock_irqrestore+0x1b/0x40
[   27.966308]  [&lt;fffff8111ff07&gt;] __setup_irq+0x2a7/0x570
[   28.067859]  [&lt;ffffffff81056e60&gt;] ? hpet_cpuhp_notify+0x140/0x140
[   28.069709]  [&lt;ffffffff8112032c&gt;] request_threaded_irq+0xcc/0x170
[   28.071585]  [&lt;ffffffff814b24a6&gt;] cmos_do_probe+0x1e6/0x450
[   28.073240]  [&lt;ffffffff814b2710&gt;] ? cmos_do_probe+0x450/0x450
[   28.074911]  [&lt;ffffffff814b27cb&gt;] cmos_pnp_probe+0xbb/0xc0
[   28.076533]  [&lt;ffffffff8139b245&gt;] pnp_device_probe+0x65/0xd0
[   28.078198]  [&lt;ffffffff813f8ca7&gt;] driver_probe_device+0x87/0x390
[   28.079971]  [&lt;ffffffff813f9083&gt;] __driver_attach+0x93/0xa0
[   28.081660]  [&lt;ffffffff813f8ff0&gt;] ? __device_attach+0x40/0x40
[   28.083662]  [&lt;ffffffff813f6a13&gt;] bus_for_each_dev+0x73/0xc0
[   28.085370]  [&lt;ffffffff813f86fe&gt;] driver_attach+0x1e/0x20
[   28.086974]  [&lt;ffffffff813f8250&gt;] bus_add_driver+0x200/0x2d0
[   28.088634]  [&lt;ffffffff81ade49a&gt;] ? rtc_sysfs_init+0xe/0xe
[   28.090349]  [&lt;ffffffff813f9704&gt;] driver_register+0x64/0xf0
[   28.091989]  [&lt;ffffffff8139b070&gt;] pnp_register_driver+0x20/0x30
[   28.093707]  [&lt;ffffffff81ade4ab&gt;] cmos_init+0x11/0x71
---&lt;-snip-&gt;---

This patch moves hpet_rtc_timer_init() before IRQ registration, so that we
can gracefully handle such spurious interrupts. It also masks HPET RTC
interrupts, in case IRQ registration fails.

We were able to reproduce the problem in maximum 15 trials of kdump
secondary kernel boot on an hp-dl160gen8 FCoE host machine without this
patch.  However, more than 35 trials went fine after applying this patch.

Suggested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Pratyush Anand &lt;panand@redhat.com&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have observed on few x86 machines with rtc-cmos device that
hpet_rtc_interrupt() is called just after irq registration and before
cmos_do_probe() could call hpet_rtc_timer_init().

So, neither hpet_default_delta nor hpet_t1_cmp is initialized by the time
interrupt is raised in the given situation, and this results in NMI
watchdog LOCKUP.

It has only been observed sporadically on kdump secondary kernels.

See the call trace:
---&lt;-snip-&gt;---
[   27.913194] Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 0
[   27.915371] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-342.el7.x86_64 #1
[   27.917503] Hardware name: HP ProLiant DL160 Gen8, BIOS J03 02/10/2014
[   27.919455]  ffffffff8186a728 0000000059c82488 ffff880034e05af0 ffffffff81637bd4
[   27.921870]  ffff880034e05b70 ffffffff8163144a 0000000000000010 ffff880034e05b80
[   27.924257]  ffff880034e05b20 0000000059c82488 0000000000000000 0000000000000000
[   27.926599] Call Trace:
[   27.927352]  &lt;NMI&gt;  [&lt;ffffffff81637bd4&gt;] dump_stack+0x19/0x1b
[   27.929080]  [&lt;ffffffff8163144a&gt;] panic+0xd8/0x1e7
[   27.930588]  [&lt;ffffffff8111d3e0&gt;] ? restart_watchdog_hrtimer+0x50/0x50
[   27.932502]  [&lt;ffffffff8111d4a2&gt;] watchdog_overflow_callback+0xc2/0xd0
[   27.934427]  [&lt;ffffffff811612c1&gt;] __perf_event_overflow+0xa1/0x250
[   27.936232]  [&lt;ffffffff81161d94&gt;] perf_event_overflow+0x14/0x20
[   27.937957]  [&lt;ffffffff81032ae8&gt;] intel_pmu_handle_irq+0x1e8/0x470
[   27.939799]  [&lt;ffffffff8164164b&gt;] perf_event_nmi_handler+0x2b/0x50
[   27.941649]  [&lt;ffffffff81640d99&gt;] nmi_handle.isra.0+0x69/0xb0
[   27.943348]  [&lt;ffffffff81640f49&gt;] do_nmi+0x169/0x340
[   27.944802]  [&lt;ffffffff816401d3&gt;] end_repeat_nmi+0x1e/0x2e
[   27.946424]  [&lt;ffffffff81056ee5&gt;] ? hpet_rtc_interrupt+0x85/0x380
[   27.948197]  [&lt;ffffffff81056ee5&gt;] ? hpet_rtc_interrupt+0x85/0x380
[   27.949992]  [&lt;ffffffff81056ee5&gt;] ? hpet_rtc_interrupt+0x85/0x380
[   27.951816]  &lt;&lt;EOE&gt;&gt;  &lt;IRQ&gt;  [&lt;ffffffff8108f5a3&gt;] ? run_timer_softirq+0x43/0x340
[   27.954114]  [&lt;ffffffff8111e24e&gt;] handle_irq_event_percpu+0x3e/0x1e0
[   27.955962]  [&lt;ffffffff8111e42d&gt;] handle_irq_event+0x3d/0x60
[   27.957635]  [&lt;ffffffff811210c7&gt;] handle_edge_irq+0x77/0x130
[   27.959332]  [&lt;ffffffff8101704f&gt;] handle_irq+0xbf/0x150
[   27.960949]  [&lt;ffffffff8164a86f&gt;] do_IRQ+0x4f/0xf0
[   27.962434]  [&lt;ffffffff8163faed&gt;] common_interrupt+0x6d/0x6d
[   27.964101]  &lt;EOI&gt;  [&lt;ffffffff8163f43b&gt;] ? _raw_spin_unlock_irqrestore+0x1b/0x40
[   27.966308]  [&lt;fffff8111ff07&gt;] __setup_irq+0x2a7/0x570
[   28.067859]  [&lt;ffffffff81056e60&gt;] ? hpet_cpuhp_notify+0x140/0x140
[   28.069709]  [&lt;ffffffff8112032c&gt;] request_threaded_irq+0xcc/0x170
[   28.071585]  [&lt;ffffffff814b24a6&gt;] cmos_do_probe+0x1e6/0x450
[   28.073240]  [&lt;ffffffff814b2710&gt;] ? cmos_do_probe+0x450/0x450
[   28.074911]  [&lt;ffffffff814b27cb&gt;] cmos_pnp_probe+0xbb/0xc0
[   28.076533]  [&lt;ffffffff8139b245&gt;] pnp_device_probe+0x65/0xd0
[   28.078198]  [&lt;ffffffff813f8ca7&gt;] driver_probe_device+0x87/0x390
[   28.079971]  [&lt;ffffffff813f9083&gt;] __driver_attach+0x93/0xa0
[   28.081660]  [&lt;ffffffff813f8ff0&gt;] ? __device_attach+0x40/0x40
[   28.083662]  [&lt;ffffffff813f6a13&gt;] bus_for_each_dev+0x73/0xc0
[   28.085370]  [&lt;ffffffff813f86fe&gt;] driver_attach+0x1e/0x20
[   28.086974]  [&lt;ffffffff813f8250&gt;] bus_add_driver+0x200/0x2d0
[   28.088634]  [&lt;ffffffff81ade49a&gt;] ? rtc_sysfs_init+0xe/0xe
[   28.090349]  [&lt;ffffffff813f9704&gt;] driver_register+0x64/0xf0
[   28.091989]  [&lt;ffffffff8139b070&gt;] pnp_register_driver+0x20/0x30
[   28.093707]  [&lt;ffffffff81ade4ab&gt;] cmos_init+0x11/0x71
---&lt;-snip-&gt;---

This patch moves hpet_rtc_timer_init() before IRQ registration, so that we
can gracefully handle such spurious interrupts. It also masks HPET RTC
interrupts, in case IRQ registration fails.

We were able to reproduce the problem in maximum 15 trials of kdump
secondary kernel boot on an hp-dl160gen8 FCoE host machine without this
patch.  However, more than 35 trials went fine after applying this patch.

Suggested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Pratyush Anand &lt;panand@redhat.com&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: simplify implementations of read_alarm</title>
<updated>2016-07-09T08:24:45+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>uwe@kleine-koenig.org</email>
</author>
<published>2016-06-28T08:43:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=56d86a7e799d3d893cb96f5b17b13de134af8de5'/>
<id>56d86a7e799d3d893cb96f5b17b13de134af8de5</id>
<content type='text'>
Since commit d68778b80dd7 ("rtc: initialize output parameter for read
alarm to "uninitialized"") there is no need to explicitly set
unsupported members to -1. So drop the respective assignments from
drivers.

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;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since commit d68778b80dd7 ("rtc: initialize output parameter for read
alarm to "uninitialized"") there is no need to explicitly set
unsupported members to -1. So drop the respective assignments from
drivers.

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;
</pre>
</div>
</content>
</entry>
<entry>
<title>mn10300: use RTC_DRV_CMOS instead of CONFIG_RTC</title>
<updated>2016-06-25T23:20:08+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-06-01T14:46:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5ee98ab3a8ea94fe24e288dc02c6b489889cf06a'/>
<id>5ee98ab3a8ea94fe24e288dc02c6b489889cf06a</id>
<content type='text'>
nn10300 has a dependency on mc146818_get_time/mc146818_set_time,
which we want to move from the mc146818rtc.h header into the
rtc subsystem, which in turn is not usable on mn10300.

This changes mn10300 to use the modern rtc-cmos driver instead
of the old RTC driver, and that in turn lets us completely
remove the read_persistent_clock/update_persistent_clock callbacks.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
nn10300 has a dependency on mc146818_get_time/mc146818_set_time,
which we want to move from the mc146818rtc.h header into the
rtc subsystem, which in turn is not usable on mn10300.

This changes mn10300 to use the modern rtc-cmos driver instead
of the old RTC driver, and that in turn lets us completely
remove the read_persistent_clock/update_persistent_clock callbacks.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: cmos: move mc146818rtc code out of asm-generic/rtc.h</title>
<updated>2016-06-03T22:20:00+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-05-30T18:57:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5ab788d7383289bfc141ab357767bc6c11bbf77f'/>
<id>5ab788d7383289bfc141ab357767bc6c11bbf77f</id>
<content type='text'>
Drivers should not really include stuff from asm-generic directly,
and the PC-style cmos rtc driver does this in order to reuse the
mc146818 implementation of get_rtc_time/set_rtc_time rather than
the architecture specific one for the architecture it gets built for.

To make it more obvious what is going on, this moves and renames the
two functions into include/linux/mc146818rtc.h, which holds the
other mc146818 specific code. Ideally it would be in a .c file,
but that would require extra infrastructure as the functions are
called by multiple drivers with conflicting dependencies.

With this change, the asm-generic/rtc.h header also becomes much
more generic, so it can be reused more easily across any architecture
that still relies on the genrtc driver.

The only caller of the internal __get_rtc_time/__set_rtc_time
functions is in arch/alpha/kernel/rtc.c, and we just change those
over to the new naming.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Drivers should not really include stuff from asm-generic directly,
and the PC-style cmos rtc driver does this in order to reuse the
mc146818 implementation of get_rtc_time/set_rtc_time rather than
the architecture specific one for the architecture it gets built for.

To make it more obvious what is going on, this moves and renames the
two functions into include/linux/mc146818rtc.h, which holds the
other mc146818 specific code. Ideally it would be in a .c file,
but that would require extra infrastructure as the functions are
called by multiple drivers with conflicting dependencies.

With this change, the asm-generic/rtc.h header also becomes much
more generic, so it can be reused more easily across any architecture
that still relies on the genrtc driver.

The only caller of the internal __get_rtc_time/__set_rtc_time
functions is in arch/alpha/kernel/rtc.c, and we just change those
over to the new naming.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: Use IS_ENABLED() instead of checking for built-in or module</title>
<updated>2016-05-20T10:33:51+00:00</updated>
<author>
<name>Javier Martinez Canillas</name>
<email>javier@osg.samsung.com</email>
</author>
<published>2016-04-26T22:17:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6fca3fc51632685635cb7143065ae74d44673871'/>
<id>6fca3fc51632685635cb7143065ae74d44673871</id>
<content type='text'>
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Signed-off-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Signed-off-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: cmos: prevent kernel warning on IRQ flags mismatch</title>
<updated>2016-01-11T19:38:50+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2015-12-23T17:37:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=079062b28fb4c58e30d024fdf974e00de53158fd'/>
<id>079062b28fb4c58e30d024fdf974e00de53158fd</id>
<content type='text'>
The Microsoft Surface 3 tablet shares interrupt line between RTC and one of SPI
controllers. However, the rtc_cmos driver doesn't allow shared interrupts and
user sees the following warning

genirq: Flags mismatch irq 8. 00000080 (8086228E:02) vs. 00000000 (rtc0)
...
[&lt;ffffffffa004eb01&gt;] pxa2xx_spi_probe+0x151/0x600 [spi_pxa2xx_platform]

Allow RTC driver to use shared interrupts.

Seems we are on the safe side to do just this simple change since
cmos_interrupt() handler checks for the actual hardware status anyway.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Microsoft Surface 3 tablet shares interrupt line between RTC and one of SPI
controllers. However, the rtc_cmos driver doesn't allow shared interrupts and
user sees the following warning

genirq: Flags mismatch irq 8. 00000080 (8086228E:02) vs. 00000000 (rtc0)
...
[&lt;ffffffffa004eb01&gt;] pxa2xx_spi_probe+0x151/0x600 [spi_pxa2xx_platform]

Allow RTC driver to use shared interrupts.

Seems we are on the safe side to do just this simple change since
cmos_interrupt() handler checks for the actual hardware status anyway.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: cmos: clean up cmos_nvram_read()/cmos_nvram_write()</title>
<updated>2015-09-05T11:19:09+00:00</updated>
<author>
<name>Vladimir Zapolskiy</name>
<email>vz@mleia.com</email>
</author>
<published>2015-07-26T21:48:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a3781639e148497d7381d8786aaefe9f8b7e3028'/>
<id>a3781639e148497d7381d8786aaefe9f8b7e3028</id>
<content type='text'>
The change removes redundant sysfs binary file boundary checks, since
this task is already done on caller side in fs/sysfs/file.c

Signed-off-by: Vladimir Zapolskiy &lt;vz@mleia.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The change removes redundant sysfs binary file boundary checks, since
this task is already done on caller side in fs/sysfs/file.c

Signed-off-by: Vladimir Zapolskiy &lt;vz@mleia.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
