From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B631C433EF for ; Mon, 24 Jan 2022 13:09:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242942AbiAXNJU (ORCPT ); Mon, 24 Jan 2022 08:09:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242781AbiAXNJT (ORCPT ); Mon, 24 Jan 2022 08:09:19 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48AF1C06173B for ; Mon, 24 Jan 2022 05:09:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DA8EF61222 for ; Mon, 24 Jan 2022 13:09:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B75A2C340E4; Mon, 24 Jan 2022 13:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643029758; bh=/gegC5sCVdndN0TetZT2tt45DzGyhp3ys7PDp5UOjf0=; h=Subject:To:Cc:From:Date:From; b=CxetzKxgn355AAHMyKa5xEiP1TeNT0s5WJMWUp4VTygrhUl8VptZTsAZVliFcxrwg iAw2Sn0xEpkGJAdnV20ZVcryly+hFtwfYP+pmcRFMDCHW0uLLKFSRvD+X726ufsiQv 8gHL+L8eQ/pA2vhXoPAlQ4CINAQ0gSewCbMTGx8c= Subject: FAILED: patch "[PATCH] rtc: cmos: Evaluate century appropriate" failed to apply to 4.19-stable tree To: luriwen@kylinos.cn, alexandre.belloni@bootlin.com, e@80x24.org, mat.jonczyk@o2.pl Cc: From: Date: Mon, 24 Jan 2022 14:09:04 +0100 Message-ID: <16430297443844@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From ff164ae39b82ee483b24579c8e22a13a8ce5bd04 Mon Sep 17 00:00:00 2001 From: Riwen Lu Date: Thu, 6 Jan 2022 16:46:09 +0800 Subject: [PATCH] rtc: cmos: Evaluate century appropriate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's limiting the year to 2069. When setting the rtc year to 2070, reading it returns 1970. Evaluate century starting from 19 to count the correct year. $ sudo date -s 20700106 Mon 06 Jan 2070 12:00:00 AM CST $ sudo hwclock -w $ sudo hwclock -r 1970-01-06 12:00:49.604968+08:00 Fixes: 2a4daadd4d3e5071 ("rtc: cmos: ignore bogus century byte") Signed-off-by: Riwen Lu Acked-by: Eric Wong Reviewed-by: Mateusz Jończyk Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220106084609.1223688-1-luriwen@kylinos.cn diff --git a/drivers/rtc/rtc-mc146818-lib.c b/drivers/rtc/rtc-mc146818-lib.c index 7f689f1bafc5..ae9f131b43c0 100644 --- a/drivers/rtc/rtc-mc146818-lib.c +++ b/drivers/rtc/rtc-mc146818-lib.c @@ -159,7 +159,7 @@ int mc146818_get_time(struct rtc_time *time) #endif #ifdef CONFIG_ACPI - if (p.century > 20) + if (p.century > 19) time->tm_year += (p.century - 19) * 100; #endif