#
99eb4449 |
| 19-Jun-2024 |
Csókás, Bence <csokas.bence@prolan.hu> |
rtc: interface: Add RTC offset to alarm after fix-up
[ Upstream commit 463927a8902a9f22c3633960119410f57d4c8920 ]
`rtc_add_offset()` is called by `__rtc_read_time()` and `__rtc_read_alarm()` to add
rtc: interface: Add RTC offset to alarm after fix-up
[ Upstream commit 463927a8902a9f22c3633960119410f57d4c8920 ]
`rtc_add_offset()` is called by `__rtc_read_time()` and `__rtc_read_alarm()` to add the RTC's offset to the raw read-outs from the device drivers. However, in the latter case, a fix-up algorithm is run if the RTC device does not report a full `struct rtc_time` alarm value. In that case, the offset was forgot to be added.
Fixes: fd6792bb022e ("rtc: fix alarm read and set offset")
Signed-off-by: Csókás, Bence <csokas.bence@prolan.hu> Link: https://lore.kernel.org/r/20240619140451.2800578-1-csokas.bence@prolan.hu Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
#
348c11a7 |
| 27-Aug-2023 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: stop warning for invalid alarms when the alarm is disabled
When the alarm is not enabled, it may never have been set and so we can't expect it to be valid. This will prevent the apparition of b
rtc: stop warning for invalid alarms when the alarm is disabled
When the alarm is not enabled, it may never have been set and so we can't expect it to be valid. This will prevent the apparition of boot messages like this one:
rtc rtc0: invalid alarm value: 2023-7-8 45:85:85
Link: https://lore.kernel.org/r/20230827221532.543353-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
a783c962 |
| 14-Feb-2023 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: allow rtc_read_alarm without read_alarm callback
.read_alarm is not necessary to read the current alarm because it is recorded in the aie_timer and so rtc_read_alarm() will never call rtc_read_
rtc: allow rtc_read_alarm without read_alarm callback
.read_alarm is not necessary to read the current alarm because it is recorded in the aie_timer and so rtc_read_alarm() will never call rtc_read_alarm_internal() which is the only function calling the callback.
Reported-by: Zhipeng Wang <zhipeng.wang_1@nxp.com> Reported-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Fixes: 7ae41220ef58 ("rtc: introduce features bitfield") Tested-by: Philippe Schenker <philippe.schenker@toradex.com> Link: https://lore.kernel.org/r/20230214222754.582582-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
b9354487 |
| 08-Aug-2022 |
shaomin Deng <dengshaomin@cdjrlc.com> |
rtc: remove duplicated words in comments
Signed-off-by: shaomin Deng <dengshaomin@cdjrlc.com> Link: https://lore.kernel.org/r/20220808152354.3641-1-dengshaomin@cdjrlc.com Link: https://lore.kernel.o
rtc: remove duplicated words in comments
Signed-off-by: shaomin Deng <dengshaomin@cdjrlc.com> Link: https://lore.kernel.org/r/20220808152354.3641-1-dengshaomin@cdjrlc.com Link: https://lore.kernel.org/r/20220808153454.6844-1-dengshaomin@cdjrlc.com Link: https://lore.kernel.org/r/20220808152822.5012-1-dengshaomin@cdjrlc.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
915593a7 |
| 26-Mar-2022 |
Tom Rix <trix@redhat.com> |
rtc: check if __rtc_read_time was successful
Clang static analysis reports this issue interface.c:810:8: warning: Passed-by-value struct argument contains uninitialized data now = rtc_tm_to_ktim
rtc: check if __rtc_read_time was successful
Clang static analysis reports this issue interface.c:810:8: warning: Passed-by-value struct argument contains uninitialized data now = rtc_tm_to_ktime(tm); ^~~~~~~~~~~~~~~~~~~
tm is set by a successful call to __rtc_read_time() but its return status is not checked. Check if it was successful before setting the enabled flag. Move the decl of err to function scope.
Fixes: 2b2f5ff00f63 ("rtc: interface: ignore expired timers when enqueuing new timers") Signed-off-by: Tom Rix <trix@redhat.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220326194236.2916310-1-trix@redhat.com
show more ...
|
#
d87f741d |
| 07-Nov-2021 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: handle alarms with a minute resolution
Handle alarms with a minute resolution in the core. Until now drivers have been open coding the seconds part removal and have been doing that wrongly. Mos
rtc: handle alarms with a minute resolution
Handle alarms with a minute resolution in the core. Until now drivers have been open coding the seconds part removal and have been doing that wrongly. Most of them are rounding up which means the allow the system to miss deadlines. So, round down and let __rtc_set_alarm return immediately if the time has already passed.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20211107225458.111068-1-alexandre.belloni@bootlin.com
show more ...
|
#
adb17a05 |
| 18-Oct-2021 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: expose RTC_FEATURE_UPDATE_INTERRUPT
Set RTC_FEATURE_UPDATE_INTERRUPT by default and clear it when it is not supported.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: ht
rtc: expose RTC_FEATURE_UPDATE_INTERRUPT
Set RTC_FEATURE_UPDATE_INTERRUPT by default and clear it when it is not supported.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20211018152337.78732-1-alexandre.belloni@bootlin.com
show more ...
|
#
c55c3a51 |
| 17-Apr-2021 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: rtc_update_irq_enable: rework UIE emulation
Now that the core is aware of whether alarms are available, it is possible to decide whether UIE emulation is required before actually trying to set
rtc: rtc_update_irq_enable: rework UIE emulation
Now that the core is aware of whether alarms are available, it is possible to decide whether UIE emulation is required before actually trying to set the alarm.
This greatly simplifies rtc_update_irq_enable because there is now only one error value to track and is not relying on the return value of __rtc_set_alarm anymore.
Tested-by: Łukasz Stelmach <l.stelmach@samsung.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210418000023.995758-3-alexandre.belloni@bootlin.com
show more ...
|
#
7ae41220 |
| 10-Jan-2021 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: introduce features bitfield
Introduce a bitfield to allow the drivers to announce the available features for an RTC.
The main use case would be to better handle alarms, that could be present o
rtc: introduce features bitfield
Introduce a bitfield to allow the drivers to announce the available features for an RTC.
The main use case would be to better handle alarms, that could be present or not or have a minute resolution or may need a correct week day to be set.
Use the newly introduced RTC_FEATURE_ALARM bit to then test whether alarms are available instead of relying on the presence of ops->set_alarm.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210110231752.1418816-2-alexandre.belloni@bootlin.com
show more ...
|
#
55dcf7a2 |
| 27-Nov-2019 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: interface: fix kerneldoc comments
Fix kerneldoc warnings:
drivers/rtc/interface.c:619: warning: Function parameter or member 'num' not described in 'rtc_handle_legacy_irq' drivers/rtc/interfac
rtc: interface: fix kerneldoc comments
Fix kerneldoc warnings:
drivers/rtc/interface.c:619: warning: Function parameter or member 'num' not described in 'rtc_handle_legacy_irq' drivers/rtc/interface.c:619: warning: Function parameter or member 'mode' not described in 'rtc_handle_legacy_irq' drivers/rtc/interface.c:804: warning: Function parameter or member 'rtc' not described in 'rtc_timer_enqueue' drivers/rtc/interface.c:804: warning: Function parameter or member 'timer' not described in 'rtc_timer_enqueue' drivers/rtc/interface.c:864: warning: Function parameter or member 'rtc' not described in 'rtc_timer_remove' drivers/rtc/interface.c:864: warning: Function parameter or member 'timer' not described in 'rtc_timer_remove' drivers/rtc/interface.c:900: warning: Function parameter or member 'work' not described in 'rtc_timer_do_work' drivers/rtc/interface.c:1035: warning: Function parameter or member 'rtc' not described in 'rtc_read_offset' drivers/rtc/interface.c:1035: warning: Function parameter or member 'offset' not described in 'rtc_read_offset' drivers/rtc/interface.c:1070: warning: Function parameter or member 'rtc' not described in 'rtc_set_offset' drivers/rtc/interface.c:1070: warning: Function parameter or member 'offset' not described in 'rtc_set_offset'
Link: https://lore.kernel.org/r/20191127082932.666869-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
3e74ddaa |
| 21-Oct-2019 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: disallow update interrupts when time is invalid
Never enable update interrupts when the time set on the rtc is invalid. In that case, also avoid enabling the emulation because it will fail for
rtc: disallow update interrupts when time is invalid
Never enable update interrupts when the time set on the rtc is invalid. In that case, also avoid enabling the emulation because it will fail for the same reason.
Link: https://lore.kernel.org/r/20191021155631.3342-2-alexandre.belloni@bootlin.com Link: https://lore.kernel.org/r/CA+ASDXMarBG5C1Kz42B9i_iVZ1=i6GgH9Yja2cdmSueKD_As_g@mail.gmail.com Reported-by: Jeffy Chen <jeffy.chen@rock-chips.com> Reported-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
7e7c005b |
| 20-Oct-2019 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: disable uie before setting time and enable after
When setting the time in the future with the uie timer enabled, rtc_timer_do_work will loop for a while because the expiration of the uie timer
rtc: disable uie before setting time and enable after
When setting the time in the future with the uie timer enabled, rtc_timer_do_work will loop for a while because the expiration of the uie timer was way before the current RTC time and a new timer will be enqueued until the current rtc time is reached.
If the uie timer is enabled, disable it before setting the time and enable it after expiring current timers (which may actually be an alarm).
This is the safest thing to do to ensure the uie timer is still synchronized with the RTC, especially in the UIE emulation case.
Reported-by: syzbot+08116743f8ad6f9a6de7@syzkaller.appspotmail.com Fixes: 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events") Link: https://lore.kernel.org/r/20191020231320.8191-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
eaa6ef56 |
| 27-Sep-2019 |
Emmanuel Nicolet <emmanuel.nicolet@gmail.com> |
rtc: interface: use timeu64_t for range_max
For rtc drivers where rtc->range_max is set U64_MAX, like the PS3 rtc, rtc_valid_range() always returns -ERANGE. This is because the local variable range_
rtc: interface: use timeu64_t for range_max
For rtc drivers where rtc->range_max is set U64_MAX, like the PS3 rtc, rtc_valid_range() always returns -ERANGE. This is because the local variable range_max has type time64_t, so the test if (time < range_min || time > range_max) return -ERANGE; becomes (time < range_min || time > -1), which always evaluates to true. timeu64_t should be used, since it's the type of rtc->range_max.
Signed-off-by: Emmanuel Nicolet <emmanuel.nicolet@gmail.com> Link: https://lore.kernel.org/r/20190927110446.GA6289@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
6cda08a2 |
| 23-Jul-2019 |
Suzuki K Poulose <suzuki.poulose@arm.com> |
drivers: Introduce device lookup variants by name
Add a helper to match the device name for device lookup. Also reuse this generic exported helper for the existing bus_find_device_by_name(). and add
drivers: Introduce device lookup variants by name
Add a helper to match the device name for device lookup. Also reuse this generic exported helper for the existing bus_find_device_by_name(). and add similar variants for driver/class.
Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexander Aring <alex.aring@gmail.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Dan Murphy <dmurphy@ti.com> Cc: Harald Freudenberger <freude@linux.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com> Cc: Lee Jones <lee.jones@linaro.org> Cc: linux-leds@vger.kernel.org Cc: linux-rtc@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: linux-wpan@vger.kernel.org Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Peter Oberparleiter <oberpar@linux.ibm.com> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Stefan Schmidt <stefan@datenfreihafen.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20190723221838.12024-2-suzuki.poulose@arm.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
#
3126790d |
| 17-Jun-2019 |
Puranjay Mohan <puranjay12@gmail.com> |
rtc: interface: Change type of 'count' from int to u64
Callers of hrtimer_forward_now() should save the return value in u64. function rtc_pie_update_irq() stores it in variable 'count' of type int c
rtc: interface: Change type of 'count' from int to u64
Callers of hrtimer_forward_now() should save the return value in u64. function rtc_pie_update_irq() stores it in variable 'count' of type int change type of count from unsigned long to u64 to solve the issue.
Signed-off-by: Puranjay Mohan <puranjay12@gmail.com> Link: https://lore.kernel.org/r/20190618042351.9692-1-puranjay12@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
a01ab066 |
| 30-Apr-2019 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: drop set_mms and set_mmss64
There are no users of set_mms and set_mmss64 as they have all been converted to set_time and are handling the tm to time conversion on their own.
Signed-off-by: Ale
rtc: drop set_mms and set_mmss64
There are no users of set_mms and set_mmss64 as they have all been converted to set_time and are handling the tm to time conversion on their own.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
c48cadf5 |
| 03-Apr-2019 |
Wolfram Sang <wsa+renesas@sang-engineering.com> |
rtc: don't reference bogus function pointer in kdoc
The mentioned function pointer is long gone since early 2011. Remove the reference in the comment and reword it slightly.
Fixes: 51ba60c5bb3b ("R
rtc: don't reference bogus function pointer in kdoc
The mentioned function pointer is long gone since early 2011. Remove the reference in the comment and reword it slightly.
Fixes: 51ba60c5bb3b ("RTC: Cleanup rtc_class_ops->update_irq_enable()") Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
606cc43c |
| 20-Mar-2019 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: core: correct trivial checkpatch warnings
Correct trivial checkpatch warnings, mostly whitespace issues and unbalanced braces.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
|
#
cdf7545a |
| 13-Mar-2019 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: convert core to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text. Also fix the block comment alignment.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin
rtc: convert core to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text. Also fix the block comment alignment.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
9a032011 |
| 18-Dec-2018 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: enforce rtc_timer_init private_data type
All the remaining users of rtc_timers are passing the rtc_device as private data. Enforce that and rename private_data to rtc.
Suggested-by: Arnd Bergm
rtc: enforce rtc_timer_init private_data type
All the remaining users of rtc_timers are passing the rtc_device as private data. Enforce that and rename private_data to rtc.
Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
5548cbf7 |
| 04-Dec-2018 |
Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
rtc: Switch to use %ptR
Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format.
Note, we drop the validation option. This is only used in a deprecated A
rtc: Switch to use %ptR
Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format.
Note, we drop the validation option. This is only used in a deprecated ABI and is mostly wrong as many RTCs will still be valid after 2100.
Cc: Arnd Bergmann <arnd@arndb.de> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
f1c8bc33 |
| 12-Sep-2018 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: remove irq_task from kerneldoc
Stale mentions of irq_task are left in the kerneldoc after its removal. Remove them.
There is still one indirect mention left but commit 3c8bb90efb6e ("rtc: Fix
rtc: remove irq_task from kerneldoc
Stale mentions of irq_task are left in the kerneldoc after its removal. Remove them.
There is still one indirect mention left but commit 3c8bb90efb6e ("rtc: Fix hrtimer deadlock") can probably be reverted now.
Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
show more ...
|
#
5a5ba10f |
| 26-Jul-2018 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: remove struct rtc_task
Include rtc_task members directly in rtc_timer member.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
|
#
c842697c |
| 25-Jul-2018 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: unexport rtc_irq_set_*
Make the rtc_irq_set interface internale to the RTC subsystem.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
|
#
8719d3c9 |
| 25-Jul-2018 |
Alexandre Belloni <alexandre.belloni@bootlin.com> |
rtc: simplify rtc_irq_set_state/rtc_irq_set_freq
The PIE doesn't handle tasks anymore, remove the pointer from the interface.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
|