Alexandre Belloni
3e74ddaa7c
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 >
2019-11-08 16:14:09 +01:00
Alexandre Belloni
7e7c005b4b
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: 6610e0893b
("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 >
2019-11-08 16:14:09 +01:00
Alexandre Belloni
bb451661db
rtc: fsl-ftm-alarm: avoid struct rtc_time conversions
...
Directly call ktime_get_real_seconds instead of converting the result to a
struct rtc_time and then back to a time64_t.
Link: https://lore.kernel.org/r/20191016201223.30568-4-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-11-08 16:14:09 +01:00
Alexandre Belloni
9323e9631c
rtc: fsl-ftm-alarm: switch to rtc_time64_to_tm/rtc_tm_to_time64
...
Call the 64bit versions of rtc_tm time conversion to avoid the y2038 issue.
Link: https://lore.kernel.org/r/20191016201223.30568-3-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-11-08 16:14:08 +01:00
Alexandre Belloni
db2a4af115
rtc: fsl-ftm-alarm: switch to ktime_get_real_seconds
...
The driver drops the nanoseconds part of the timespec64, there is no need
to call ktime_get_real_ts64.
Link: https://lore.kernel.org/r/20191016201223.30568-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-11-08 16:14:08 +01:00
Martin Hundebøll
62409933b8
rtc: pcf2127: handle boot-enabled watchdog feature
...
Linux should handle when the pcf2127 watchdog feature is enabled by the
bootloader. This is done by checking the watchdog timer value during
init, and set the WDOG_HW_RUNNING flag if the value differs from zero.
Signed-off-by: Martin Hundebøll <martin@geanix.com >
Acked-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20191021080838.2789-1-martin@geanix.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-21 10:24:18 +02:00
Parthiban Nallathambi
f583c341a5
rtc: rv3028: add clkout support
...
rv3028 provides clkout (enabled by default). Add clkout
to clock framework source and control from device tree for
variable frequency with enable and disable functionality.
Signed-off-by: Parthiban Nallathambi <pn@denx.de >
Link: https://lore.kernel.org/r/20191018100425.1687979-1-pn@denx.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 23:16:57 +02:00
Alexandre Belloni
05df557285
rtc: ds1343: cleanup .remove
...
It is not necessary to call device_init_wakeup(dev, false) in .remove as
device_del will take care of that. It is also not necessary to
devm_free_irq. Finally, dev_pm_clear_wake_irq can be called
unconditionally.
Link: https://lore.kernel.org/r/20191019204941.6203-9-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:56:11 +02:00
Alexandre Belloni
0680a6cdab
rtc: ds1343: rework interrupt handling
...
Rework the interrupt handling to avoid caching the values as the core is
already doing that. The core also always ensures the rtc_time passed for
the alarm is fully populated.
The only trick is in read_alarm where status needs to be read before the
alarm registers to ensure the potential irq is not cleared.
Link: https://lore.kernel.org/r/20191019204941.6203-8-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:56:09 +02:00
Alexandre Belloni
a986429095
rtc: ds1343: remove unnecessary mutex
...
Use rtc_lock and rtc_unlock to lock the rtc from the interrupt handler.
This removes the need for a driver specific lock.
Link: https://lore.kernel.org/r/20191019204941.6203-7-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:56:07 +02:00
Alexandre Belloni
ce0fd9db65
rtc: ds1343: check regmap_read return value
...
Check whether regmap_read fails before continuing in the sysfs .show
callbacks.
Link: https://lore.kernel.org/r/20191019204941.6203-6-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:56:05 +02:00
Alexandre Belloni
ac08888b25
rtc: ds1343: use regmap_update_bits for glitch filter
...
Use regmap_update_bits to update DS1343_CONTROL_REG in a race free manner
when setting the glitch filter.
Link: https://lore.kernel.org/r/20191019204941.6203-5-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:56:03 +02:00
Alexandre Belloni
580daaf43a
rtc: ds1343: use rtc_add_group
...
Use rtc_add_group to add the sysfs group in a race free manner.
This has the side effect of moving the files to their proper location.
Link: https://lore.kernel.org/r/20191019204941.6203-4-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:56:01 +02:00
Alexandre Belloni
f308b68202
rtc: ds1343: use burst write to set time
...
To avoid possible race condition, use regmap_bulk_write to write all the
date/time registers at once instead of sequentially.
Link: https://lore.kernel.org/r/20191019204941.6203-3-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:56:00 +02:00
Alexandre Belloni
8c9a88fae2
rtc: ds1343: remove dead code
...
RTC_SET_CHARGE doesn't exist, the ioctl code is never used.
Link: https://lore.kernel.org/r/20191019204941.6203-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:55:58 +02:00
Alexandre Belloni
21783322fe
rtc: ds1343: set range
...
This is a standard BCD rtc with a useless century bit (no leap year
correction after 2099).
Link: https://lore.kernel.org/r/20191019204941.6203-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:55:56 +02:00
Alexandre Belloni
ae48668843
rtc: introduce lock helpers
...
Introduce rtc_lock and rtc_unlock to shorten the code when locking and
unlocking ops_lock from drivers.
Link: https://lore.kernel.org/r/20191019205034.6382-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:55:46 +02:00
Alexandre Belloni
1a064850b5
rtc: vt8500: let the core handle rtc range
...
Let the rtc core check the date/time against the RTC range.
Link: https://lore.kernel.org/r/20191016201626.31309-5-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:33:15 +02:00
Alexandre Belloni
d8bced4b72
rtc: vt8500: convert to devm_rtc_allocate_device
...
This allows further improvement of the driver.
Link: https://lore.kernel.org/r/20191016201626.31309-4-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:33:13 +02:00
Alexandre Belloni
3e7d639720
rtc: vt8500: remove superfluous error message
...
The RTC core now has error messages in case of registration failure, there
is no need to have other messages in the drivers.
Link: https://lore.kernel.org/r/20191016201626.31309-3-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:33:11 +02:00
Alexandre Belloni
e979d0490a
rtc: vt8500: remove useless label
...
err_return doesn't do anything special, simply return instead of goto.
Link: https://lore.kernel.org/r/20191016201626.31309-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:33:09 +02:00
Alexandre Belloni
8d6ac1cec7
rtc: add timestamp for end of 2199
...
Some RTCs handle date up to 2199.
Link: https://lore.kernel.org/r/20191016201626.31309-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:33:07 +02:00
Alexandre Belloni
9e8a968fe3
rtc: s35390a: set range
...
This is a standard BCD RTC that will fail in 2100.
Link: https://lore.kernel.org/r/20191016200848.30246-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:33:05 +02:00
Alexandre Belloni
ed6c6dfdbe
rtc: s35390a: convert to devm_rtc_allocate_device
...
This allows further improvement of the driver and removes the need to
forward declare s35390a_driver.
Link: https://lore.kernel.org/r/20191016200848.30246-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-19 22:33:03 +02:00
Alexandre Belloni
cb0b97d682
rtc: meson-vrtc: move config option to proper location
...
The correct location for this option is under platform driver, not i2c
drivers.
Link: https://lore.kernel.org/r/20191014155840.22554-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-16 10:39:00 +02:00
Thomas Bogendoerfer
299b610117
rtc: ds1685: add indirect access method and remove plat_read/plat_write
...
SGI Octane (IP30) doesn't have RTC register directly mapped into CPU
address space, but accesses RTC registers with an address and data
register. This is now supported by additional access functions, which
are selected by a new field in platform data. Removed plat_read/plat_write
since there is no user and their usage could introduce lifetime issue,
when functions are placed in different modules.
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de >
Acked-by: Joshua Kinard <kumba@gentoo.org >
Reviewed-by: Joshua Kinard <kumba@gentoo.org >
Link: https://lore.kernel.org/r/20191014214621.25257-1-tbogendoerfer@suse.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-16 10:39:00 +02:00
Thomas Bogendoerfer
af818031f4
rtc: ds1685: use devm_platform_ioremap_resource helper
...
Simplify ioremapping of registers by using devm_platform_ioremap_resource.
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de >
Acked-by: Joshua Kinard <kumba@gentoo.org >
Link: https://lore.kernel.org/r/20191011150546.9186-2-tbogendoerfer@suse.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-14 17:49:22 +02:00
Thomas Bogendoerfer
9e420d7f12
rts: ds1685: remove not needed fields from private struct
...
A few of the fields in struct ds1685_priv aren't needed at all,
so we can remove it.
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de >
Acked-by: Joshua Kinard <kumba@gentoo.org >
Link: https://lore.kernel.org/r/20191011150546.9186-1-tbogendoerfer@suse.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-14 17:49:21 +02:00
Srinivas Goud
d53bf24db3
rtc: xilinx: Fix calibval variable type
...
This patch fixes the warnings reported by static code analysis.
Updated calibval variable type to unsigned type from signed.
Signed-off-by: Srinivas Goud <srinivas.goud@xilinx.com >
Signed-off-by: Michal Simek <michal.simek@xilinx.com >
Link: https://lore.kernel.org/r/20765c4c27aa92c75426b82fd2815ebef6471492.1570544738.git.michal.simek@xilinx.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-14 17:49:19 +02:00
Nick Crews
9aa0d0be38
rtc: wilco-ec: Handle reading invalid times
...
If the RTC HW returns an invalid time, the rtc_year_days()
call would crash. This patch adds error logging in this
situation, and removes the tm_yday and tm_wday calculations.
These fields should not be relied upon by userspace
according to man rtc, and thus we don't need to calculate
them.
Signed-off-by: Nick Crews <ncrews@chromium.org >
Reviewed-by: Daniel Campello <campello@chromium.org >
Link: https://lore.kernel.org/r/20191004142608.170159-1-ncrews@chromium.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-14 17:49:17 +02:00
Alexandre Belloni
147dae76db
rtc: ds1347: handle century register
...
The DS1347 can handle years from 0 to 9999, add century register support.
Link: https://lore.kernel.org/r/20191007134724.15505-10-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:38 +02:00
Alexandre Belloni
860c45b56d
rtc: ds1347: use regmap_update_bits
...
Use regmap_update_bits instead of open coding. Also add proper error
handling.
Link: https://lore.kernel.org/r/20191007134724.15505-9-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:36 +02:00
Alexandre Belloni
d9dcfa5f70
rtc: ds1347: properly handle oscillator failures
...
The comment in the probe function stating that it disables oscillator stop
detection and glitch filtering is incorrect as it sets bits 3 and 4 while
it should be setting 5 and 6 to achieve that. Then, it is safe to assume
that the oscillator failure detection is actually enabled.
Properly handle oscillator failures by returning -EINVAL when the time and
date are know to be incorrect and reset the flag when the time is set.
Link: https://lore.kernel.org/r/20191007134724.15505-8-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:35 +02:00
Alexandre Belloni
3ce20a23e2
rtc: ds1347: set range
...
The DS1347 handle dates from year 0000 to 9999. Leap years are claimed to
be handled correctly in the datasheet.
Link: https://lore.kernel.org/r/20191007134724.15505-7-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:33 +02:00
Alexandre Belloni
554692d56d
rtc: ds1347: convert to devm_rtc_allocate_device
...
This allows further improvement of the driver.
Link: https://lore.kernel.org/r/20191007134724.15505-6-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:31 +02:00
Alexandre Belloni
088443c79c
rtc: ds1347: mask ALM OUT when reading time
...
Bit 7 of the minutes registers is ALM OUT. It indicates an alarm fired.
Mask it out when reading the time.
Link: https://lore.kernel.org/r/20191007134724.15505-5-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:29 +02:00
Alexandre Belloni
ff7f9e0533
rtc: ds1347: simplify getting .driver_data
...
Get 'driver_data' from 'struct device' directly. Going via spi_device is an
unnecessary step.
Link: https://lore.kernel.org/r/20191007134724.15505-4-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:28 +02:00
Alexandre Belloni
1d84eca6d5
rtc: ds1347: remove useless read
...
DS1347_SECONDS_REG is read at probe time but the value is simply discarded.
Remove that useless read.
Link: https://lore.kernel.org/r/20191007134724.15505-3-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:26 +02:00
Alexandre Belloni
590062f479
rtc: ds1347: remove verbose messages
...
Printing debugging (and opaque) information is not useful and only clutters
the boot log. Remove those messages.
Link: https://lore.kernel.org/r/20191007134724.15505-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:24 +02:00
Alexandre Belloni
f00eaa38eb
rtc: add a timestamp for year 0
...
A few RTCs handle dates from year 0 to year 9999. Add a timestamp even if
years before 1970 will probably never be used.
Link: https://lore.kernel.org/r/20191007134724.15505-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:22 +02:00
Stephen Boyd
cd7629b27b
rtc: armada38x: Use of_device_get_match_data()
...
Use the more modern API to get the match data out of the of match table.
This saves some code, lines, and nicely avoids referencing the match
table when it is undefined with configurations where CONFIG_OF=n.
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Andrew Lunn <andrew@lunn.ch >
Cc: Gregory Clement <gregory.clement@bootlin.com >
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com >
Cc: Alessandro Zummo <a.zummo@towertech.it >
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: Frank Rowand <frowand.list@gmail.com >
Cc: <linux-rtc@vger.kernel.org >
Signed-off-by: Stephen Boyd <swboyd@chromium.org >
Link: https://lore.kernel.org/r/20191004214334.149976-4-swboyd@chromium.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:20 +02:00
Krzysztof Kozlowski
7da83f1bba
rtc: da9063: Handle invalid IRQ from platform_get_irq_byname()
...
platform_get_irq_byname() might return -errno which later would be
cast to an unsigned int and used in request_irq().
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org >
Tested-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com >
Link: https://lore.kernel.org/r/20191004150510.6278-1-krzk@kernel.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:18 +02:00
Alexandre Belloni
cf79e7c3c9
rtc: m41t80: set range
...
This is a standard BCD RTC that will fail in 2100. The century bits don't
help because 2100 will be considered a leap year while it is not.
Link: https://lore.kernel.org/r/20191003213544.5359-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 15:49:16 +02:00
YueHaibing
09ef18bcd5
rtc: use devm_platform_ioremap_resource() to simplify code
...
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Signed-off-by: YueHaibing <yuehaibing@huawei.com >
Link: https://lore.kernel.org/r/20191006102953.57536-2-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-3-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-4-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-5-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-6-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-7-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-8-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-9-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-10-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-11-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-12-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-13-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-14-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-15-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-16-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-17-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-18-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-19-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-20-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-21-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-22-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-23-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-24-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-25-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-26-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-27-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-28-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-29-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-30-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-31-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-32-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-33-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-34-yuehaibing@huawei.com
Link: https://lore.kernel.org/r/20191006102953.57536-35-yuehaibing@huawei.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-07 01:07:35 +02:00
Markus Elfring
89576bebbc
rtc: Use devm_platform_ioremap_resource()
...
Simplify probe by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net >
Link: https://lore.kernel.org/r/4552ef52-f218-93b1-6dfa-668d137676f8@web.de
Link: https://lore.kernel.org/r/5ecfcf43-d6b2-1a38-dee8-b8806f30bc83@web.de
Link: https://lore.kernel.org/r/25448e11-c43f-9ae0-4c43-6f789accc026@web.de
Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com >
Link: https://lore.kernel.org/r/8c17a59c-82ff-aa6b-5653-a38d786d3e83@web.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-06 21:04:51 +02:00
Emmanuel Nicolet
eaa6ef563d
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 >
2019-10-03 21:55:17 +02:00
Claudiu Beznea
288d9cf176
rtc: at91rm9200: use of_device_get_match_data()
...
Use of_device_get_match_data() since all platforms should now use DT
bindings. AVR32 architecture has been removed in
commit 26202873bb
("avr32: remove support for AVR32 architecture").
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com >
Link: https://lore.kernel.org/r/1569500132-21164-1-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2019-10-03 21:50:47 +02:00
Linus Torvalds
54ecb8f702
Linux 5.4-rc1
2019-09-30 10:35:40 -07:00
Linus Torvalds
bb48a59135
Merge tag 'for-5.4-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
...
Pull btrfs fixes from David Sterba:
"A bunch of fixes that accumulated in recent weeks, mostly material for
stable.
Summary:
- fix for regression from 5.3 that prevents to use balance convert
with single profile
- qgroup fixes: rescan race, accounting leak with multiple writers,
potential leak after io failure recovery
- fix for use after free in relocation (reported by KASAN)
- other error handling fixups"
* tag 'for-5.4-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: qgroup: Fix reserved data space leak if we have multiple reserve calls
btrfs: qgroup: Fix the wrong target io_tree when freeing reserved data space
btrfs: Fix a regression which we can't convert to SINGLE profile
btrfs: relocation: fix use-after-free on dead relocation roots
Btrfs: fix race setting up and completing qgroup rescan workers
Btrfs: fix missing error return if writeback for extent buffer never started
btrfs: adjust dirty_metadata_bytes after writeback failure of extent buffer
Btrfs: fix selftests failure due to uninitialized i_mode in test inodes
2019-09-30 10:25:24 -07:00
Linus Torvalds
80b29b6b8c
Merge tag 'csky-for-linus-5.4-rc1' of git://github.com/c-sky/csky-linux
...
Pull csky updates from Guo Ren:
"This round of csky subsystem just some fixups:
- Fix mb() synchronization problem
- Fix dma_alloc_coherent with PAGE_SO attribute
- Fix cache_op failed when cross memory ZONEs
- Optimize arch_sync_dma_for_cpu/device with dma_inv_range
- Fix ioremap function losing
- Fix arch_get_unmapped_area() implementation
- Fix defer cache flush for 610
- Support kernel non-aligned access
- Fix 610 vipt cache flush mechanism
- Fix add zero_fp fixup perf backtrace panic
- Move static keyword to the front of declaration
- Fix csky_pmu.max_period assignment
- Use generic free_initrd_mem()
- entry: Remove unneeded need_resched() loop"
* tag 'csky-for-linus-5.4-rc1' of git://github.com/c-sky/csky-linux:
csky: Move static keyword to the front of declaration
csky: entry: Remove unneeded need_resched() loop
csky: Fixup csky_pmu.max_period assignment
csky: Fixup add zero_fp fixup perf backtrace panic
csky: Use generic free_initrd_mem()
csky: Fixup 610 vipt cache flush mechanism
csky: Support kernel non-aligned access
csky: Fixup defer cache flush for 610
csky: Fixup arch_get_unmapped_area() implementation
csky: Fixup ioremap function losing
csky: Optimize arch_sync_dma_for_cpu/device with dma_inv_range
csky/dma: Fixup cache_op failed when cross memory ZONEs
csky: Fixup dma_alloc_coherent with PAGE_SO attribute
csky: Fixup mb() synchronization problem
2019-09-30 10:16:17 -07:00