Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1243646pxa; Thu, 20 Aug 2020 06:35:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygVTPxH1JYGPBbpH+y8jQTpUZPDyE0KN//vY0/Aq7SjLUNNoAG75QJpfPI8zDuoFsUUIqt X-Received: by 2002:aa7:d410:: with SMTP id z16mr2848695edq.287.1597930546626; Thu, 20 Aug 2020 06:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597930546; cv=none; d=google.com; s=arc-20160816; b=QNYUk7+jO2HAiS6IyOCVmtsVKjFaKd2+AXKXlUndJ3WnuIJFt6z6FLCyg/uCAtDnzX yKAgv+6Ee4lJJEzC183h6Sr4adWE/mhhLDAp9+zjlMp0fS8nBemb8e56rKuHOMHeyYg3 DthrzvyJzV9Y5Glm5imu50VS81gbXTxz0HCzwvBWjToyoMwjtWLlUqkXiM+kYAC9mRFk +1vmanLSyEwy5sS6koA46Ao2lUk0LfGj58E5/noFJyB6pg386ZezlZapJID493nBHrtC qgfXNvsC4HG3UDEuIq0zmWvkEayUYwlfMzeE/h3yujHm7vUuVDM0fWzDDbqNmOrpx3T/ jXFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kqIT23iLwXEjDi1kUPfLmCZDRLtit1aq2pgXTHb/3D4=; b=yWVryC8aEsNviTDfp31ICMOBLMc0BxwOONz1s53qq5oKfSLGCCCDkJ4AXXrKlsqyDW lW/vESmFSgQm5lRV5Wofqx3O2iR3LIHBPgezqz7UbSCR41aB8PjPkSYKx0IljbAxHPs4 oEKE+pBkDpL/Ze2NM1lJMfITOlKkB+cLLdwRK3Q+irMp+VT3WTdIlbiVqS2NnT/qMHhc bV3P40PIhEdwyF9fwaohfUItegD/IURrII/SdqC+pFE/2r1g3VApQzSyvBMIsR+ZG/sp 0qhMxTl4SUPWa7Bygc4QpIQgo0LybupbeGC3NTiyGMClxEGUyPLvN6mcYW9/6N8UXbp1 Mobw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pTVoGRVL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mb9si1207446ejb.536.2020.08.20.06.35.22; Thu, 20 Aug 2020 06:35:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pTVoGRVL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729515AbgHTNdA (ORCPT + 99 others); Thu, 20 Aug 2020 09:33:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:41348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728027AbgHTJbI (ORCPT ); Thu, 20 Aug 2020 05:31:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C411F20855; Thu, 20 Aug 2020 09:31:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915868; bh=vKgxG8WeJeP6CWDsoICmWqROrUHc7Mxhq5QDNjEq+kM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pTVoGRVLFcP/I7zh0Dpo5DNbCqBumVe2M17lReklrCm31UYcaTlSbwmMhoqy3/9VZ PxHyyQEqZm/T/LqQlHhygeJilW/prvQcy0Jupr+sMg7yK/Dt0nUPZn7MSRcBivUQJH k/a/ByQnEDIy+IsoWbCqyybkg8esn201PSBxIfz4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Sicelo A. Mhlongo" , Dev Null , Sebastian Reichel , Alexandre Belloni , Merlijn Wajer , Tony Lindgren , Sasha Levin Subject: [PATCH 5.8 123/232] rtc: cpcap: fix range Date: Thu, 20 Aug 2020 11:19:34 +0200 Message-Id: <20200820091618.773946743@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Reichel [ 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 Reported-by: Dev Null Signed-off-by: Sebastian Reichel Signed-off-by: Alexandre Belloni Tested-by: Merlijn Wajer Acked-by: Tony Lindgren Acked-by: Merlijn Wajer Link: https://lore.kernel.org/r/20200629114123.27956-1-sebastian.reichel@collabora.com Signed-off-by: Sasha Levin --- drivers/rtc/rtc-cpcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.25.1