aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-10-04rtc: cmos: Remove the `use_acpi_alarm' module parameter for !ACPIMaciej W. Rozycki1-7/+20
Fix a problem with commit 311ee9c151ad ("rtc: cmos: allow using ACPI for RTC alarm instead of HPET") defining `use_acpi_alarm' module parameter even for non-ACPI platforms, which ignore it. Wrap the definition into #ifdef CONFIG_ACPI and use a static inline wrapper function, hardcoded to return 0 and consequently optimized away for !ACPI, following the existing pattern with HPET handling functions. Signed-off-by: Maciej W. Rozycki <[email protected]> Fixes: 311ee9c151ad ("rtc: cmos: allow using ACPI for RTC alarm instead of HPET") Cc: [email protected] # 4.18+ Signed-off-by: Alexandre Belloni <[email protected]>
2018-10-04rtc: cmos: Fix non-ACPI undefined reference to `hpet_rtc_interrupt'Maciej W. Rozycki1-1/+1
Fix a commit 311ee9c151ad ("rtc: cmos: allow using ACPI for RTC alarm instead of HPET") `rtc-cmos' regression causing a link error: drivers/rtc/rtc-cmos.o: In function `cmos_platform_probe': rtc-cmos.c:(.init.text+0x33c): undefined reference to `hpet_rtc_interrupt' rtc-cmos.c:(.init.text+0x3f4): undefined reference to `hpet_rtc_interrupt' with non-ACPI platforms using this driver. The cause is the change of the condition guarding the use of `hpet_rtc_interrupt'. Previously it was a call to `is_hpet_enabled'. That function is static inline and has a hardcoded 0 result for non-ACPI platforms, which imply !HPET_EMULATE_RTC. Consequently the compiler optimized the whole block away including the reference to `hpet_rtc_interrupt', which never made it to the link stage. Now the guarding condition is a call to `use_hpet_alarm', which is not static inline and therefore the compiler may not be able to prove that it actually always returns 0 for non-ACPI platforms. Consequently the build breaks with an unsatisfied reference, because `hpet_rtc_interrupt' is nowhere defined at link time. Fix the problem by marking `use_hpet_alarm' inline. As the `inline' keyword serves as an optimization hint rather than a requirement the compiler is still free to choose whether inlining will be beneficial or not for ACPI platforms. Signed-off-by: Maciej W. Rozycki <[email protected]> Fixes: 311ee9c151ad ("rtc: cmos: allow using ACPI for RTC alarm instead of HPET") Cc: [email protected] # 4.18+ Signed-off-by: Alexandre Belloni <[email protected]>
2018-10-03rtc: mv: let the core handle invalid alarmsAlexandre Belloni1-6/+2
Instead of lying to the core when the alarm is invalid, let it handle that by returning the error. Signed-off-by: Alexandre Belloni <[email protected]> Tested-by: Gregory CLEMENT <[email protected]> (on Armada 375 DB) Signed-off-by: Alexandre Belloni <[email protected]>
2018-10-03rtc: vr41xx: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-6/+3
Call the 64bit versions of rtc_time_to_tm now that the range is enforced by the core. Also remove the open coded rtc_tm_to_time64. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: ab8500: remove useless checkAlexandre Belloni1-1/+1
rtc_time_to_tm always rturns a valid tm, there is no need to validate it. Signed-off-by: Alexandre Belloni <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: ab8500: let the core handle rangeAlexandre Belloni1-49/+4
Let the core handle offsetting and windowing the RTC range. The RTC has a 24 bit counter for minutes plus a seconds counter. Keep the epoch at the beginning of 2000. Signed-off-by: Alexandre Belloni <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: ab8500: use rtc_add_groupAlexandre Belloni1-24/+17
Use rtc_add_group to add the sysfs group in a race free manner. Signed-off-by: Alexandre Belloni <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: rs5c348: report error when time is invalidAlexandre Belloni1-22/+21
Instead of resetting the RTC to an bogus valid time, let userspace know that the time is invalid when XSTP is set. Reset XSTP when setting the time again. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: rs5c348: remove forward declarationAlexandre Belloni1-6/+4
The name passed to devm_rtc_device_register is now unused. anyway, switch to devm_rtc_allocate_device to avoid forward declaring rs5c348_driver. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: rs5c348: remove useless labelAlexandre Belloni1-11/+7
Since commit 8fb1ecb36f7e ("rtc: rtc-rs5c348: use devm_*() functions") the kfree_exit label simply returns ret. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: armada38x: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-16/+6
Call the 64bit versions of rtc_time_to_tm and rtc_tm_to_time now that the range is enforced by the core. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: armada38x: add rangeAlexandre Belloni1-0/+2
The RTC is a 32bit seconds counter. Signed-off-by: Alexandre Belloni <[email protected]> Tested-by: Gregory CLEMENT <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: armada38x: fix possible race conditionAlexandre Belloni1-11/+11
The IRQ is requested before the struct rtc is allocated and registered, but this struct is used in the IRQ handler. This may lead to a NULL pointer dereference. Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc before requesting the IRQ. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: lib: correct documentation typoAlexandre Belloni1-1/+1
rtc_time64_to_tm has not been called rtc_time_to_tm64 Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: ds1307: use rtc_add_groupAlexandre Belloni1-39/+14
Register frequency test using rtc_add_group to avoid a possible race condition and simplify the code. This also moves the attribute to its proper location under the rtc device instead of the i2c parent device. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: ds1685: use rtc_add_groupAlexandre Belloni1-39/+1
Use rtc_add_group to add the sysfs group in a race free manner. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: ds1685: use generic nvmemAlexandre Belloni1-67/+25
Instead of adding a binary sysfs attribute from the driver, use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: ds1685: drop RTC_DS1685_PROC_REGSAlexandre Belloni2-72/+0
/proc is not the correct ABI to display debugging info. Remove RTC_DS1685_PROC_REGS as the driver hasn't seen any real development since it was included. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: test: Switch to SPDX identifierAlexandre Belloni1-4/+1
Replace the license boilerplate by an SPDX identifier Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: test: make license text and module license match.Alexandre Belloni1-1/+1
The license text is specifying GPL v2 only but the MODULE_LICENSE is set to GPL which means GNU Public License v2 or later. When MODULE_LICENSE and boiler plate does not match, go for boiler plate license. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: tx4939: fixup nvmem name and register sizeAlexandre Belloni1-3/+1
The default word_size and stride of 1 are correct for the tx4939. Also fix the nvmem folder name. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: isl1208: don't include core header fileAlexandre Belloni1-4/+3
The core header file is reserved for the core, stop including it. Also reorder includes alphabetically. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: move rtc_add_group/s definitionsAlexandre Belloni2-14/+16
Move rtc_add_group and rtc_add_groups definition to rtc.h that is available for all RTC drivers. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: reorder Makefile entriesAlexandre Belloni1-6/+6
A few entries are not placed correctly, reorder them. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: ds1307: add frequency_test_enable attribute on m41txxGiulio Benetti1-0/+92
On m41txx you can enable open-drain OUT pin to check if offset is ok. Enabling OUT pin with frequency_test_enable attribute, OUT pin will tick 512 times faster than 1s tick base. Enable or Disable FT bit on CONTROL register if freq_test is 1 or 0. Signed-off-by: Giulio Benetti <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: ds1307: add offset sysfs for mt41txx chips.Giulio Benetti1-0/+77
m41txx chips can hold a calibration value to get correct clock bias. Add offset handling (ranging between -63ppm and 126ppm) via sysfs. Signed-off-by: Giulio Benetti <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-28rtc: isl1208: avoid possible sysfs raceAlexandre Belloni1-17/+10
Use rtc_add_group to add the common sysfs group to avoid a possible race condition. [[email protected]: use to_i2c_client(dev->parent)] Signed-off-by: Denis Osterland <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> The move of atrim, dtrim usr sysfs properties from i2c device to rtc device require to access them via dev->parent. This patch also aligns timestamp0.
2018-09-13rtc: remove irq_task from kerneldocAlexandre Belloni1-3/+0
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 <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-13rtc: unexport non devm managed registrationAlexandre Belloni2-12/+5
Ensure the non managed version of the un/registration functions is not used anymore. No driver is using it anymore and they should not be necessary. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-12Merge tag 'ib-mfd-rtc-v4.20' of ↵Alexandre Belloni1-4/+9
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into rtc-next Immutable branch between MFD and RTC due for the v4.20 merge window Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-12rtc: abx80x: add basic watchdog supportJeremy Gebben2-4/+113
The abx804 and abx805 chips have support for a simple watchdog function that can trigger an external reset. Signed-off-by: Jeremy Gebben <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-12rtc: abx80x: use a 'priv' struct for client dataJeremy Gebben1-8/+19
This will allow additional data to be tracked, for future improvements. Signed-off-by: Jeremy Gebben <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-11mfd: menelaus: Fix possible race condition and leakAlexandre Belloni1-4/+9
The IRQ work is added before the struct rtc is allocated and registered, but this struct is used in the IRQ handler. This may lead to a NULL pointer dereference. Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc before calling menelaus_add_irq_work. Also, this solves a possible leak as the RTC is never released. Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2018-09-11rtc: pl031: switch to devm_rtc_allocate_device/rtc_register_deviceAlexandre Belloni1-9/+9
Switch to devm_rtc_allocate_device to simplify the erro and driver removal paths. Acked-by: Linus Walleij <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-11rtc: pl030: fix possible race conditionAlexandre Belloni1-6/+9
The IRQ is requested before the struct rtc is allocated and registered, but this struct is used in the IRQ handler. This may lead to a NULL pointer dereference. Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc before requesting the IRQ. Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-11rtc: mt6397: fix possible race conditionAlexandre Belloni1-5/+8
The IRQ is requested before the struct rtc is allocated and registered, but this struct is used in the IRQ handler. This may lead to a NULL pointer dereference. Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc before requesting the IRQ. Acked-by: Eddie Huang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-09-08rtc: mips: default to rtc-cmos on mipsArnd Bergmann2-2/+2
The old rtc driver is getting in the way of some compat_ioctl simplification. Looking up the loongson64 git history, it seems that everyone uses the more modern but compatible RTC_CMOS driver anyway, so let's remove the special case for loongson64. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-31rtc: mrst: remove set but not used variable 'valid'YueHaibing1-2/+1
Fixes gcc '-Wunused-but-set-variable' warning: drivers/rtc/rtc-mrst.c: In function 'mrst_procfs': drivers/rtc/rtc-mrst.c:264:29: warning: variable 'valid' set but not used [-Wunused-but-set-variable] unsigned char rtc_control, valid; Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-27rtc: rv8803: add Epson RX8803 supportAlexandre Belloni1-0/+5
The Epson rx8803 is mostly similar to the Microcrystal RV8803 but the size of the offset register is 4 bits vs 6 bits but it has a configurable temperature compensation. Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-27rtc: rv8803: fix the rv8803 id in the OF tableAlexandre Belloni1-1/+1
The ID for RV8803 must be rv_8803 Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-27rtc: sysfs: fix NULL check in rtc_add_groups()Dan Carpenter1-2/+2
devm_kcalloc() returns NULL, it never returns error pointers. In the current code we would return PTR_ERR(NULL) which is success, instead of returning the -ENOMEM error code. Fixes: a0a1a1ba3032 ("rtc: sysfs: facilitate attribute add to rtc device") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-27rtc: sun6i: Use struct_size() in kzalloc()Gustavo A. R. Silva1-2/+1
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; void *entry[]; }; instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL); Signed-off-by: Gustavo A. R. Silva <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-27rtc: jz4740: Drop dependency on MACH_INGENICPaul Cercueil1-1/+1
Depending on MACH_INGENIC prevent us from creating a generic kernel that works on more than one MIPS board. Instead, we just depend on MIPS being set. Signed-off-by: Paul Cercueil <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-27rtc: omap: Cut down the shutdown time from 2 seconds to 1 secKeerthy1-10/+15
Cut down the shutdown time from 2 seconds to 1 sec. In case of roll over try again. Signed-off-by: Keerthy <[email protected]> Reviewed-by: Johan Hovold <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-27rtc: omap: use of_device_is_system_power_controller functionKeerthy1-2/+1
Use of_device_is_system_power_controller instead of manually reading the system-power-controller property from the device tree node. Reviewed-by: Johan Hovold <[email protected]> Signed-off-by: Keerthy <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-27rtc: rtc-mrst: Replace mdelay() with msleep() in mrst_read_time()Jia-Ju Bai1-1/+1
mrst_read_time() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-26Linux 4.19-rc1Linus Torvalds1-2/+2
2018-08-26Merge branch 'timers-urgent-for-linus' of ↵Linus Torvalds1-0/+15
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer update from Thomas Gleixner: "New defines for the compat time* types so they can be shared between 32bit and 64bit builds. Not used yet, but merging them now allows the actual conversions to be merged through different maintainer trees without dependencies We still have compat interfaces for 32bit on 64bit even with the new 2038 safe timespec/val variants because pointer size is different. And for the old style timespec/val interfaces we need yet another 'compat' interface for both 32bit native and 32bit on 64bit" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: y2038: Provide aliases for compat helpers
2018-08-26Merge branch 'ida-4.19' of git://git.infradead.org/users/willy/linux-daxLinus Torvalds28-679/+485
Pull IDA updates from Matthew Wilcox: "A better IDA API: id = ida_alloc(ida, GFP_xxx); ida_free(ida, id); rather than the cumbersome ida_simple_get(), ida_simple_remove(). The new IDA API is similar to ida_simple_get() but better named. The internal restructuring of the IDA code removes the bitmap preallocation nonsense. I hope the net -200 lines of code is convincing" * 'ida-4.19' of git://git.infradead.org/users/willy/linux-dax: (29 commits) ida: Change ida_get_new_above to return the id ida: Remove old API test_ida: check_ida_destroy and check_ida_alloc test_ida: Convert check_ida_conv to new API test_ida: Move ida_check_max test_ida: Move ida_check_leaf idr-test: Convert ida_check_nomem to new API ida: Start new test_ida module target/iscsi: Allocate session IDs from an IDA iscsi target: fix session creation failure handling drm/vmwgfx: Convert to new IDA API dmaengine: Convert to new IDA API ppc: Convert vas ID allocation to new IDA API media: Convert entity ID allocation to new IDA API ppc: Convert mmu context allocation to new IDA API Convert net_namespace to new IDA API cb710: Convert to new IDA API rsxx: Convert to new IDA API osd: Convert to new IDA API sd: Convert to new IDA API ...
2018-08-26Merge tag 'gcc-plugins-v4.19-rc1-fix' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull gcc plugin fix from Kees Cook: "Lift gcc test into Kconfig. This is for better behavior when the kernel is built with Clang, reported by Stefan Agner" * tag 'gcc-plugins-v4.19-rc1-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: gcc-plugins: Disable when building under Clang