- 22 9月, 2016 3 次提交
-
-
由 Gabriele Mazzotta 提交于
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: NGabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Gabriele Mazzotta 提交于
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.pdfSigned-off-by: NGabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Marcin Niestroj 提交于
Support configuration of ext_wakeup sources. This patch makes it possible to enable ext_wakeup and set it's polarity, depending on board configuration. AM335x's dedicated PMIC (tps65217) uses ext_wakeup to notify about power-button presses. Handling power-button presses enables to recover from RTC-only power states correctly. Signed-off-by: NMarcin Niestroj <m.niestroj@grinn-global.com> Acked-by: NTony Lindgren <tony@atomide.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 20 9月, 2016 1 次提交
-
-
由 Pratyush Anand 提交于
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: ---<-snip->--- [ 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] <NMI> [<ffffffff81637bd4>] dump_stack+0x19/0x1b [ 27.929080] [<ffffffff8163144a>] panic+0xd8/0x1e7 [ 27.930588] [<ffffffff8111d3e0>] ? restart_watchdog_hrtimer+0x50/0x50 [ 27.932502] [<ffffffff8111d4a2>] watchdog_overflow_callback+0xc2/0xd0 [ 27.934427] [<ffffffff811612c1>] __perf_event_overflow+0xa1/0x250 [ 27.936232] [<ffffffff81161d94>] perf_event_overflow+0x14/0x20 [ 27.937957] [<ffffffff81032ae8>] intel_pmu_handle_irq+0x1e8/0x470 [ 27.939799] [<ffffffff8164164b>] perf_event_nmi_handler+0x2b/0x50 [ 27.941649] [<ffffffff81640d99>] nmi_handle.isra.0+0x69/0xb0 [ 27.943348] [<ffffffff81640f49>] do_nmi+0x169/0x340 [ 27.944802] [<ffffffff816401d3>] end_repeat_nmi+0x1e/0x2e [ 27.946424] [<ffffffff81056ee5>] ? hpet_rtc_interrupt+0x85/0x380 [ 27.948197] [<ffffffff81056ee5>] ? hpet_rtc_interrupt+0x85/0x380 [ 27.949992] [<ffffffff81056ee5>] ? hpet_rtc_interrupt+0x85/0x380 [ 27.951816] <<EOE>> <IRQ> [<ffffffff8108f5a3>] ? run_timer_softirq+0x43/0x340 [ 27.954114] [<ffffffff8111e24e>] handle_irq_event_percpu+0x3e/0x1e0 [ 27.955962] [<ffffffff8111e42d>] handle_irq_event+0x3d/0x60 [ 27.957635] [<ffffffff811210c7>] handle_edge_irq+0x77/0x130 [ 27.959332] [<ffffffff8101704f>] handle_irq+0xbf/0x150 [ 27.960949] [<ffffffff8164a86f>] do_IRQ+0x4f/0xf0 [ 27.962434] [<ffffffff8163faed>] common_interrupt+0x6d/0x6d [ 27.964101] <EOI> [<ffffffff8163f43b>] ? _raw_spin_unlock_irqrestore+0x1b/0x40 [ 27.966308] [<fffff8111ff07>] __setup_irq+0x2a7/0x570 [ 28.067859] [<ffffffff81056e60>] ? hpet_cpuhp_notify+0x140/0x140 [ 28.069709] [<ffffffff8112032c>] request_threaded_irq+0xcc/0x170 [ 28.071585] [<ffffffff814b24a6>] cmos_do_probe+0x1e6/0x450 [ 28.073240] [<ffffffff814b2710>] ? cmos_do_probe+0x450/0x450 [ 28.074911] [<ffffffff814b27cb>] cmos_pnp_probe+0xbb/0xc0 [ 28.076533] [<ffffffff8139b245>] pnp_device_probe+0x65/0xd0 [ 28.078198] [<ffffffff813f8ca7>] driver_probe_device+0x87/0x390 [ 28.079971] [<ffffffff813f9083>] __driver_attach+0x93/0xa0 [ 28.081660] [<ffffffff813f8ff0>] ? __device_attach+0x40/0x40 [ 28.083662] [<ffffffff813f6a13>] bus_for_each_dev+0x73/0xc0 [ 28.085370] [<ffffffff813f86fe>] driver_attach+0x1e/0x20 [ 28.086974] [<ffffffff813f8250>] bus_add_driver+0x200/0x2d0 [ 28.088634] [<ffffffff81ade49a>] ? rtc_sysfs_init+0xe/0xe [ 28.090349] [<ffffffff813f9704>] driver_register+0x64/0xf0 [ 28.091989] [<ffffffff8139b070>] pnp_register_driver+0x20/0x30 [ 28.093707] [<ffffffff81ade4ab>] cmos_init+0x11/0x71 ---<-snip->--- 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: NThomas Gleixner <tglx@linutronix.de> Signed-off-by: NPratyush Anand <panand@redhat.com> Acked-by: NThomas Gleixner <tglx@linutronix.de> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 05 9月, 2016 2 次提交
-
-
由 Alexandre Belloni 提交于
The rtc-asm9260 driver uses a discrete spinlock (wrongly uninitialized). Use the rtc mutex to lock mmio accesses instead. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Alexandre Belloni 提交于
The rtc-asm9260 driver compiles correctly on other architectures, add COMPILE_TEST to improve code coverage. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 02 9月, 2016 1 次提交
-
-
由 Julia Lawall 提交于
Check for rtc_class_ops structures that are only passed to devm_rtc_device_register, rtc_device_register, platform_device_register_data, all of which declare the corresponding parameter as const. Declare rtc_class_ops structures that have these properties as const. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct rtc_class_ops i@p = { ... }; @ok@ identifier r.i; expression e1,e2,e3,e4; position p; @@ ( devm_rtc_device_register(e1,e2,&i@p,e3) | rtc_device_register(e1,e2,&i@p,e3) | platform_device_register_data(e1,e2,e3,&i@p,e4) ) @bad@ position p != {r.p,ok.p}; identifier r.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct rtc_class_ops i = { ... }; // </smpl> Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr> Acked-by: NBaruch Siach <baruch@tkos.co.il> Acked-by: NHans Ulli Kroll <ulli.kroll@googlemail.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 01 9月, 2016 10 次提交
-
-
由 Chen-Yu Tsai 提交于
The ac100 device tree binding specifies the usage of clock-output-names to specify the names of its 3 clock outputs. This is needed for orphan clock resolution, when the ac100 is probed much later than any clocks that consume any of its outputs. This wasn't supported by the driver. Add support for this. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Alexandre Belloni 提交于
.owner is already set by the spi core. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Markus Elfring 提交于
The field "owner" is set by core. Thus delete an extra initialisation. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Jan Östlund 提交于
While the oscillator failure flag is set, the RTC registers should be considered invalid. bq32k_rtc_read_time() now returns an error instead of an invalid time. The failure flag is cleared the next time the clock is set. Signed-off-by: NJan Östlund <jao@hms.se> Signed-off-by: NDaniel Romell <daro@hms.se> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Jan Östlund 提交于
The BQ32K_SECONDS_MASK and BQ32K_MINUTES_MASK both has the same value. This is no functional change. Signed-off-by: NJan Östlund <jao@hms.se> Signed-off-by: NDaniel Romell <daro@hms.se> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 LABBE Corentin 提交于
The char pointer buf_ptr is assigned an address from a const char pointer buf (parameter of wakealarm_store). The data pointer by buf_ptr is never modified. So casting it to a (char *) is useless. This patch remove this cast, and transform buf_ptr to a const char pointer. Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Alexandre Belloni 提交于
The Intersil isl12057 is now supported by the ds1307 driver. Acked-by: NArnaud Ebalard <arno@natisbad.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Alexandre Belloni 提交于
Intersil ISL12057 is a drop-in replacement for DS1337. It can be supported by the ds1307 driver. Acked-by: NArnaud Ebalard <arno@natisbad.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Alexandre Belloni 提交于
Add an option to properly support the century bit of ds1337 and compatibles and ds1340. Because the driver had a bug until now, it is not possible to switch users to the fixed code directly as RTCs in the field will wrongly have the century bit set. Acked-by: NArnaud Ebalard <arno@natisbad.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Christophe JAILLET 提交于
It is likely that checking the result of 'pcf2123_write_reg' is expected here. Also fix a small style issue. The '{' at the beginning of the function is misplaced. Fixes: 809b453b ("rtc: pcf2123: clean up writes to the rtc chip") Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 08 8月, 2016 2 次提交
-
-
由 Chen-Yu Tsai 提交于
The AC100's RTC side has 3 clock outputs on external pins, which can provide a clock signal to the SoC or other modules, such as WiFi or GSM modules. Support this with a custom clk driver integrated with the rtc driver. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: NLee Jones <lee.jones@linaro.org>
-
由 Chen-Yu Tsai 提交于
X-Powers AC100 is a codec / RTC combo chip. This driver supports the RTC sub-device. The RTC block also has clock outputs and non-volatile storage. Non-volatile storage wthin the RTC hardware is not supported. Clock output support is added in the next patch. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: NLee Jones <lee.jones@linaro.org>
-
- 28 7月, 2016 6 次提交
-
-
由 Benoît Thébaudeau 提交于
V1F indicates that the time accuracy may have been compromised because of a voltage drop (possibly only temporary) below VLOW1, which stops the temperature compensation. When the time is set, the accuracy is restored, so V1F should be cleared in order to indicate this and to be able to detect the next temperature compensation loss. This is the same principle as for V2F, which is cleared when the time is set to indicate that the time is no longer invalid and to be able to detect the next data loss. Signed-off-by: NBenoît Thébaudeau <benoit@wsystem.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Benoît Thébaudeau 提交于
According to the application manual of the RX8900, the RESET bit must be set to 1 to prevent a timer update while setting the time. This also resets the subsecond counter. The application manual of the RV-8803 does not mention such a requirement, and it says that the 100th Seconds register is cleared when writing to the Seconds register, but using the RESET bit for the RV-8803 too should not be an issue and is probably safer. This change also ensures that the RESET bit is initialized properly in all cases. Indeed, all the registers must be initialized if the voltage has been lower than VLOW2 (triggering V2F), but not low enough to trigger a POR. Signed-off-by: NBenoît Thébaudeau <benoit@wsystem.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Benoît Thébaudeau 提交于
The I²C NACK issue of the RV-8803 may occur after any I²C START condition, depending on the timings. Consequently, the workaround must be applied for all the I²C transfers. This commit abstracts the I²C transfer code into register access functions. This avoids duplicating the I²C workaround everywhere. This also avoids the duplication of the code handling the return value of i2c_smbus_read_i2c_block_data(). Error messages are issued in case of definitive register access failures (if the workaround fails). This change also makes the I²C transfer return value checks consistent. Signed-off-by: NBenoît Thébaudeau <benoit@wsystem.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Benoît Thébaudeau 提交于
The Weekday register is encoded as 2^tm_wday, with tm_wday in 0..6, so using tm_wday = ffs(reg) to fill tm_wday from the register value is wrong because this gives the expected value + 1. This could be fixed as tm_wday = ffs(reg) - 1, but tm_wday = ilog2(reg) works as well and is more direct. Signed-off-by: NBenoît Thébaudeau <benoit@wsystem.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Benoît Thébaudeau 提交于
The RTC core always calls rtc_valid_tm() after ->read_time() in case of success (in __rtc_read_time()), so do not call it twice. Signed-off-by: NBenoît Thébaudeau <benoit@wsystem.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Benoît Thébaudeau 提交于
This driver supports the Epson RX8900, but this was not indicated in Kconfig. Signed-off-by: NBenoît Thébaudeau <benoit@wsystem.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 27 7月, 2016 1 次提交
-
-
由 Wei Yongjun 提交于
Remove .owner field if calls are used which set it automatically. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: NWei Yongjun <weiyj.lk@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 26 7月, 2016 1 次提交
-
-
由 Wei Yongjun 提交于
The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly. This is detected by Coccinelle semantic patch. Signed-off-by: NWei Yongjun <weiyj.lk@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 22 7月, 2016 2 次提交
-
-
由 Stefan Christ 提交于
Allow the alarm IRQ of RTC to be used as a wakeup source for the system suspend. Signed-off-by: NStefan Christ <s.christ@phytec.de> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Stefan Christ 提交于
It should be a real error message, when the driver cannot enable the IRQ of the device. Signed-off-by: NStefan Christ <s.christ@phytec.de> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 20 7月, 2016 4 次提交
-
-
由 Chris DeBruin 提交于
The current rtc-pcf85063 driver only supports the PCF85063TP device. Using the existing driver on a PCF85063A will result in the time being set correctly into the RTC, but the RTC is held in the stopped state. Therefore, the time will no longer advance and no error is indicated. The PCF85063A device has a bigger memory map than the PCF85063TP. The existing driver make use of an address rollover condition, but the rollover point is different in the two devices. Signed-off-by: NChris DeBruin <cdeb5783@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Alexandre Belloni 提交于
The year range is not validated properly As the driver has been mainlined in 2014, it is not an issue to stop handling dates between 1970 and 2000 with the benefit of handling dates up to 2100. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Uwe Kleine-König 提交于
Set .tm_sec to 0 instead of -1 to signal minute accuracy. Signed-off-by: NUwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Uwe Kleine-König 提交于
Since all time members of the alarm data is initialized to -1 the drivers are responsible to set the tm_sec member to 0. Fixes: d68778b8 ("rtc: initialize output parameter for read alarm to "uninitialized"") Signed-off-by: NUwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 19 7月, 2016 4 次提交
-
-
由 Alim Akhtar 提交于
As per code flow s3c_rtc_setfreq() will get called with rtc clock disabled and in set_freq we perform h/w registers read/write, which results in a kernel crash on exynos7 platform while probing rtc driver. Below is code flow: s3c_rtc_probe() clk_prepare_enable(info->rtc_clk) // rtc clock enabled s3c_rtc_gettime() // will enable clk if not done, and disable it upon exit s3c_rtc_setfreq() //then this will be called with clk disabled This patch take cares of such issue by adding s3c_rtc_{enable/disable}_clk in s3c_rtc_setfreq(). Fixes: 24e14554 ("drivers/rtc/rtc-s3c.c: delete duplicate clock control") Cc: <stable@vger.kernel.org> Signed-off-by: NAlim Akhtar <alim.akhtar@samsung.com> Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: NPankaj Dubey <pankaj.dubey@samsung.com> Tested-by: NPankaj Dubey <pankaj.dubey@samsung.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Alim Akhtar 提交于
At the end of s3c_rtc_probe(), s3c_rtc_disable_clk() being called with rtc clock already disabled (by s3c_rtc_gettime()), which looks extra and unnecessary call. Lets clean it up. Signed-off-by: NAlim Akhtar <alim.akhtar@samsung.com> Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: NPankaj Dubey <pankaj.dubey@samsung.com> Tested-by: NPankaj Dubey <pankaj.dubey@samsung.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Sudip Mukherjee 提交于
If devm_add_action() fails we are explicitly calling the cleanup to free the resources allocated. Lets use the helper devm_add_action_or_reset() and return directly in case of error, as we know that the cleanup function has been already called by the helper if there was any error. Signed-off-by: NSudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Sudip Mukherjee 提交于
If devm_add_action() fails we are explicitly calling the cleanup to free the resources allocated. Lets use the helper devm_add_action_or_reset() and return directly in case of error, as we know that the cleanup function has been already called by the helper if there was any error. Signed-off-by: NSudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 12 7月, 2016 3 次提交
-
-
由 Uwe Kleine-König 提交于
Signed-off-by: NUwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Uwe Kleine-König 提交于
Be more explicit in some comments. Signed-off-by: NUwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Uwe Kleine-König 提交于
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: NUwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-