summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* rtc: rs5c348: remove useless labelAlexandre Belloni2018-09-281-11/+7
| | | | | | | Since commit 8fb1ecb36f7e ("rtc: rtc-rs5c348: use devm_*() functions") the kfree_exit label simply returns ret. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: armada38x: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni2018-09-281-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 <alexandre.belloni@bootlin.com>
* rtc: armada38x: add rangeAlexandre Belloni2018-09-281-0/+2
| | | | | | | | The RTC is a 32bit seconds counter. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: armada38x: fix possible race conditionAlexandre Belloni2018-09-281-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 <alexandre.belloni@bootlin.com>
* rtc: lib: correct documentation typoAlexandre Belloni2018-09-281-1/+1
| | | | | | rtc_time64_to_tm has not been called rtc_time_to_tm64 Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1307: use rtc_add_groupAlexandre Belloni2018-09-281-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 <alexandre.belloni@bootlin.com>
* rtc: ds1685: use rtc_add_groupAlexandre Belloni2018-09-281-39/+1
| | | | | | Use rtc_add_group to add the sysfs group in a race free manner. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1685: use generic nvmemAlexandre Belloni2018-09-281-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 <alexandre.belloni@bootlin.com>
* rtc: ds1685: drop RTC_DS1685_PROC_REGSAlexandre Belloni2018-09-282-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 <alexandre.belloni@bootlin.com>
* rtc: test: Switch to SPDX identifierAlexandre Belloni2018-09-281-4/+1
| | | | | | Replace the license boilerplate by an SPDX identifier Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: test: make license text and module license match.Alexandre Belloni2018-09-281-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 <alexandre.belloni@bootlin.com>
* rtc: tx4939: fixup nvmem name and register sizeAlexandre Belloni2018-09-281-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 <alexandre.belloni@bootlin.com>
* rtc: isl1208: don't include core header fileAlexandre Belloni2018-09-281-4/+3
| | | | | | | | The core header file is reserved for the core, stop including it. Also reorder includes alphabetically. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: move rtc_add_group/s definitionsAlexandre Belloni2018-09-282-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 <alexandre.belloni@bootlin.com>
* rtc: reorder Makefile entriesAlexandre Belloni2018-09-281-6/+6
| | | | | | A few entries are not placed correctly, reorder them. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1307: add frequency_test_enable attribute on m41txxGiulio Benetti2018-09-281-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 <giulio.benetti@micronovasrl.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1307: add offset sysfs for mt41txx chips.Giulio Benetti2018-09-281-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 <giulio.benetti@micronovasrl.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: isl1208: avoid possible sysfs raceAlexandre Belloni2018-09-281-17/+10
| | | | | | | | | | | | | Use rtc_add_group to add the common sysfs group to avoid a possible race condition. [Denis.Osterland@diehl.com: use to_i2c_client(dev->parent)] Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> 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.
* rtc: remove irq_task from kerneldocAlexandre Belloni2018-09-131-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 <torvalds@linux-foundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: unexport non devm managed registrationAlexandre Belloni2018-09-132-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 <alexandre.belloni@bootlin.com>
* Merge tag 'ib-mfd-rtc-v4.20' of ↵Alexandre Belloni2018-09-121-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 <alexandre.belloni@bootlin.com>
| * mfd: menelaus: Fix possible race condition and leakAlexandre Belloni2018-09-111-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 <alexandre.belloni@bootlin.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* | rtc: abx80x: add basic watchdog supportJeremy Gebben2018-09-122-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 <jgebben@sweptlaser.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: abx80x: use a 'priv' struct for client dataJeremy Gebben2018-09-121-8/+19
| | | | | | | | | | | | | | | | This will allow additional data to be tracked, for future improvements. Signed-off-by: Jeremy Gebben <jgebben@sweptlaser.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: pl031: switch to devm_rtc_allocate_device/rtc_register_deviceAlexandre Belloni2018-09-111-9/+9
| | | | | | | | | | | | | | | | Switch to devm_rtc_allocate_device to simplify the erro and driver removal paths. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: pl030: fix possible race conditionAlexandre Belloni2018-09-111-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 <alexandre.belloni@bootlin.com>
* | rtc: mt6397: fix possible race conditionAlexandre Belloni2018-09-111-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 <eddie.huang@mediatek.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: mips: default to rtc-cmos on mipsArnd Bergmann2018-09-082-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 <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: mrst: remove set but not used variable 'valid'YueHaibing2018-08-311-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 <yuehaibing@huawei.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: rv8803: add Epson RX8803 supportAlexandre Belloni2018-08-271-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 <alexandre.belloni@bootlin.com>
* | rtc: rv8803: fix the rv8803 id in the OF tableAlexandre Belloni2018-08-271-1/+1
| | | | | | | | | | | | The ID for RV8803 must be rv_8803 Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: sysfs: fix NULL check in rtc_add_groups()Dan Carpenter2018-08-271-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 <dan.carpenter@oracle.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: sun6i: Use struct_size() in kzalloc()Gustavo A. R. Silva2018-08-271-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 <gustavo@embeddedor.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: jz4740: Drop dependency on MACH_INGENICPaul Cercueil2018-08-271-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 <paul@crapouillou.net> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: omap: Cut down the shutdown time from 2 seconds to 1 secKeerthy2018-08-271-10/+15
| | | | | | | | | | | | | | | | | | Cut down the shutdown time from 2 seconds to 1 sec. In case of roll over try again. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: omap: use of_device_is_system_power_controller functionKeerthy2018-08-271-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 <johan@kernel.org> Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: rtc-mrst: Replace mdelay() with msleep() in mrst_read_time()Jia-Ju Bai2018-08-271-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 <baijiaju1990@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* Linux 4.19-rc1v4.19-rc1Linus Torvalds2018-08-261-2/+2
|
* Merge branch 'timers-urgent-for-linus' of ↵Linus Torvalds2018-08-261-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
| * y2038: Provide aliases for compat helpersArnd Bergmann2018-08-221-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the system call rework for 64-bit time_t, we are restructuring the way that compat syscalls deal with 32-bit time_t, reusing the implementation for 32-bit architectures. Christoph Hellwig suggested a rename of the associated types and interfaces to avoid the confusing usage of the 'compat' prefix for 32-bit architectures. To prepare for doing that in linux-4.20, add a set of macros that allows to convert subsystems separately to the new names and avoids some of the nastier merge conflicts. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Christoph Hellwig <hch@lst.de> Cc: y2038@lists.linaro.org Cc: John Stultz <john.stultz@linaro.org> Cc: Deepa Dinamani <deepa.kernel@gmail.com> Link: https://lkml.kernel.org/r/20180821203329.2089473-1-arnd@arndb.de
* | Merge branch 'ida-4.19' of git://git.infradead.org/users/willy/linux-daxLinus Torvalds2018-08-2628-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 ...
| * | ida: Change ida_get_new_above to return the idMatthew Wilcox2018-08-211-18/+12
| | | | | | | | | | | | | | | | | | | | | This calling convention makes more sense for the implementation as well as the callers. It even shaves 32 bytes off the compiled code size. Signed-off-by: Matthew Wilcox <willy@infradead.org>
| * | ida: Remove old APIMatthew Wilcox2018-08-213-67/+11
| | | | | | | | | | | | | | | | | | | | | | | | Delete ida_pre_get(), ida_get_new(), ida_get_new_above() and ida_remove() from the public API. Some of these functions still exist as internal helpers, but they should not be called by consumers. Signed-off-by: Matthew Wilcox <willy@infradead.org>
| * | test_ida: check_ida_destroy and check_ida_allocMatthew Wilcox2018-08-212-66/+58
| | | | | | | | | | | | | | | | | | | | | Move these tests from the userspace test-suite to the kernel test-suite. Also convert check_ida_random to the new API. Signed-off-by: Matthew Wilcox <willy@infradead.org>
| * | test_ida: Convert check_ida_conv to new APIMatthew Wilcox2018-08-212-46/+40
| | | | | | | | | | | | | | | | | | | | | | | | Move as much as possible to kernel space; leave the parts in user space that rely on checking memory allocation failures to detect the transition between an exceptional entry and a bitmap. Signed-off-by: Matthew Wilcox <willy@infradead.org>
| * | test_ida: Move ida_check_maxMatthew Wilcox2018-08-212-28/+23
| | | | | | | | | | | | | | | | | | Convert to new API and move to kernel space. Signed-off-by: Matthew Wilcox <willy@infradead.org>
| * | test_ida: Move ida_check_leafMatthew Wilcox2018-08-212-27/+25
| | | | | | | | | | | | | | | | | | | | | Convert to new API and move to kernel space. Take the opportunity to test the situation a little more thoroughly (ie at different offsets). Signed-off-by: Matthew Wilcox <willy@infradead.org>
| * | idr-test: Convert ida_check_nomem to new APIMatthew Wilcox2018-08-211-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | We can't move this test to kernel space because there's no way to force kmalloc to fail. But we can use the new API and check this works when the test is in userspace. Signed-off-by: Matthew Wilcox <willy@infradead.org>
| * | ida: Start new test_ida moduleMatthew Wilcox2018-08-217-7/+71
| | | | | | | | | | | | | | | | | | | | | Start transitioning the IDA tests into kernel space. Framework heavily cribbed from test_xarray.c. Signed-off-by: Matthew Wilcox <willy@infradead.org>
| * | target/iscsi: Allocate session IDs from an IDAMatthew Wilcox2018-08-213-30/+10
| | | | | | | | | | | | | | | | | | | | | Since the session is never looked up by ID, we can use the more space-efficient IDA instead of the IDR. Signed-off-by: Matthew Wilcox <willy@infradead.org>