- 01 Mar, 2018 31 commits
-
-
Alexandre Belloni authored
Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Instead of adding a binary sysfs attribute from the driver, use the core to register an nvmem device. This allows to use the in-kernel interface to access the nvram. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
The probe function is not allowed to fail after registering the RTC because the following may happen: CPU0: CPU1: sys_load_module() do_init_module() do_one_initcall() cmos_do_probe() rtc_device_register() __register_chrdev() cdev->owner = struct module* open("/dev/rtc0") rtc_device_unregister() module_put() free_module() module_free(mod->module_core) /* struct module *module is now freed */ chrdev_open() spin_lock(cdev_lock) cdev_get() try_module_get() module_is_live() /* dereferences already freed struct module* */ Switch to devm_rtc_allocate_device/rtc_register_device to register the rtc as late as possible. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Currently, the IRQs are disabled when the rtc driver is removed (e.g. when shutting down the platform). This means that the RTC will be unable to wakeup the platform. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
sirfsoc_rtc_ioctl() doesn't implement any actual ioctl, remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
A documented ABI already exists to get information about the alarm. It is the only one that is used. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Avoid using memset as gcc can properly initialize structures. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Because nvmem_config is only used and copied at nvmem registration, remove it from struct rtc_device. All the rtc drivers using nvmem are now calling rtc_nvmem_register directly. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
The probe function is not allowed to fail after registering the RTC. Call rtc_register_device() at the end. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Avoid allocating memory for struct nvmem_config. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Avoid allocating memory for struct nvmem_config. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Move m48t86_nvmem_cfg to the stack of m48t86_rtc_probe. This results in a very small code size reduction and make it safer on systems with two similar RTCs: text data bss dec hex filename 1733 164 0 1897 769 drivers/rtc/rtc-m48t86.o.before 1793 100 0 1893 765 drivers/rtc/rtc-m48t86.o.after Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Move ds1511_nvmem_cfg to the stack of ds1511_rtc_probe. This results in a very small code size reduction and make it safer on systems with two similar RTCs: text data bss dec hex filename 2128 164 4 2296 8f8 drivers/rtc/rtc-ds1511.o.before 2175 100 4 2279 8e7 drivers/rtc/rtc-ds1511.o.after Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Avoid allocating memory for struct nvmem_config as it is only necessary at the nvmem registration. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
This makes to code safer on system using two similar RTCs. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Export rtc_nvmem_register() so it can be called from drivers instead of only the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Switch the parent of the nvmem device to the parent of the rtc device so it can be registered before the RTC. This is a small change in the ABI as the nvmem moves out of the /sys/class/rtc/rtcX folder to be under the parent device folder (that is where the previous nvram files where registered). However, it is still available under its correct location, /sys/bus/nvmem/devices which is the one that should be used by userspace applications. The other benefit is that the nvmem device can stay registered even if the rtc registration fails. Or it is possible to not register the rtc if the nvmem registration failed. Finally, it makes a lot of sense for devices that actually have different i2c or spi addresses for the RTC and the EEPROM. That is basically how it would end up when using MFD or even completely separate devices. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 14 Feb, 2018 4 commits
-
-
Alexandre Belloni authored
Make rtc_nvmem_register return -EBUSY when an nvmem is already registered for that RTC. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
In case of error, make rtc_nvmem_register() able to return an error value to its caller. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
To be able to remove nvmem_config from struct rtc_device, pass it as a parameter to rtc_nvmem_register. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
The nvmem interface appaeared in linux 4.13 Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 13 Feb, 2018 4 commits
-
-
Colin Ian King authored
Pointe bp is being initialized and this value is never read, it is being updated to the same value later just before it is going to be used. Remove the initialization as it is never read and keep the setting of bp closer to the use of bp. Cleans up clang warnings: drivers/rtc/rtc-ds1302.c:115:7: warning: Value stored to 'bp' during its initialization is never read drivers/rtc/rtc-ds1302.c:46:7: warning: Value stored to 'bp' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
James Hogan authored
Fix the following warning in MIPS allmodconfig by adding a MODULE_LICENSE() at the end of rtc-goldfish.c, based on the file header comment which says GNU General Public License version 2: WARNING: modpost: missing MODULE_LICENSE() in drivers/rtc/rtc-goldfish.o Fixes: f22d9cdc ("rtc: goldfish: Add RTC driver for Android emulator") Signed-off-by: James Hogan <jhogan@kernel.org> Cc: Miodrag Dinic <miodrag.dinic@mips.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: linux-rtc@vger.kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Baolin Wang authored
If we convert one large time values to rtc_time, in the original formula 'days * 86400' can be overflowed in 'unsigned int' type to make the formula get one incorrect remain seconds value. Thus we can use div_s64_rem() function to avoid this situation. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Baolin Wang authored
It will be more helpful to add some tracepoints to track RTC actions when debugging RTC driver. Below sample is that we set/read the RTC time, then set 2 alarms, so we can see the trace logs: set/read RTC time: kworker/0:1-67 [000] 21.814245: rtc_set_time: UTC (1510301580) (0) kworker/0:1-67 [000] 21.814312: rtc_read_time: UTC (1510301580) (0) set the first alarm timer: kworker/0:1-67 [000] 21.829238: rtc_timer_enqueue: RTC timer:(ffffffc15eb49bc8) expires:1510301700000000000 period:0 kworker/0:1-67 [000] 22.018279: rtc_set_alarm: UTC (1510301700) (0) set the second alarm timer: kworker/0:1-67 [000] 22.230284: rtc_timer_enqueue: RTC timer:(ffffff80088e6430) expires:1510301820000000000 period:0 the first alarm timer was expired: kworker/0:1-67 [000] 145.155584: rtc_timer_dequeue: RTC timer:(ffffffc15eb49bc8) expires:1510301700000000000 period:0 kworker/0:1-67 [000] 145.155593: rtc_timer_fired: RTC timer:(ffffffc15eb49bc8) expires:1510301700000000000 period:0 kworker/0:1-67 [000] 145.172504: rtc_set_alarm: UTC (1510301820) (0) the second alarm timer was expired: kworker/0:1-67 [000] 269.102353: rtc_timer_dequeue: RTC timer:(ffffff80088e6430) expires:1510301820000000000 period:0 kworker/0:1-67 [000] 269.102360: rtc_timer_fired: RTC timer:(ffffff80088e6430) expires:1510301820000000000 period:0 disable alarm irq: kworker/0:1-67 [000] 269.102469: rtc_alarm_irq_enable: disable RTC alarm IRQ (0) Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 11 Feb, 2018 1 commit
-
-
Linus Torvalds authored
-