This is a note to let you know that I've just added the patch titled rtc: cpcap: fix range to the 5.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: rtc-cpcap-fix-range.patch and it can be found in the queue-5.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 8efe783211695007a182e83786af78baa50d9b6a Author: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx> Date: Mon Jun 29 13:41:23 2020 +0200 rtc: cpcap: fix range [ Upstream commit 3180cfabf6fbf982ca6d1a6eb56334647cc1416b ] Unbreak CPCAP driver, which has one more bit in the day counter increasing the max. range from 2014 to 2058. The original commit introducing the range limit was obviously wrong, since the driver has only been written in 2017 (3 years after 14 bits would have run out). Fixes: d2377f8cc5a7 ("rtc: cpcap: set range") Reported-by: Sicelo A. Mhlongo <absicsz@xxxxxxxxx> Reported-by: Dev Null <devnull@xxxxxxxx> Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx> Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx> Tested-by: Merlijn Wajer <merlijn@xxxxxxxxxx> Acked-by: Tony Lindgren <tony@xxxxxxxxxxx> Acked-by: Merlijn Wajer <merlijn@xxxxxxxxxx> Link: https://lore.kernel.org/r/20200629114123.27956-1-sebastian.reichel@xxxxxxxxxxxxx Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/rtc/rtc-cpcap.c b/drivers/rtc/rtc-cpcap.c index a603f1f211250..800667d73a6fb 100644 --- a/drivers/rtc/rtc-cpcap.c +++ b/drivers/rtc/rtc-cpcap.c @@ -261,7 +261,7 @@ static int cpcap_rtc_probe(struct platform_device *pdev) return PTR_ERR(rtc->rtc_dev); rtc->rtc_dev->ops = &cpcap_rtc_ops; - rtc->rtc_dev->range_max = (1 << 14) * SECS_PER_DAY - 1; + rtc->rtc_dev->range_max = (timeu64_t) (DAY_MASK + 1) * SECS_PER_DAY - 1; err = cpcap_get_vendor(dev, rtc->regmap, &rtc->vendor); if (err)