Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2693687pxb; Sun, 17 Oct 2021 23:00:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOgXPU0t6D6gE0a8iacNOZKbS1S+9IkP5PqGPyWSle6XGDrWlLOxnBWnaxADLs94mbKajK X-Received: by 2002:a17:90b:4c0d:: with SMTP id na13mr31144409pjb.232.1634536841684; Sun, 17 Oct 2021 23:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634536841; cv=none; d=google.com; s=arc-20160816; b=V2qWtJ9Bo5d1nhMgB5XEpfE4Sf6OSNn1bcUPBLiR2qyzi7ONnY5EViQEmUur8gaOrs IHJDlEtt+4OQzmih+gAF+zv/5nNcSOXqNCXTeoWE5UrammihiotuG98MFepskC0+yqno KZffeec2DIX/tUTA//LRY2um+tAiHAwUzVoaGGSjINR5xaMby6OAaciVC7KPyFYWeXXT tKZt+8nWmLeIYm1kVMhfYM09fwZ3eB31Tvypq+ygB9HbvzgcbcYUrE/mHOho5l1KafMC EoCNdKKXM0VyZJEVdraWkAUUTuhDj1d+L43ZRnK3EsdVWl+84VAvxh49g3ZV7yU83zhB PKWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HmLwtW8qvgJcn3oqGYfmmKLGQ/QPA47hSu68bacJ+Ko=; b=o1mvA3PZJYkB2mS7rR3CEnoHBCWvND1uZtLmttjDasp/8oXD5cX9pfZhVzFU3uay7E EF1lqY9r1rOnNGVYqjUaKWI4tapASJAuklfO65amRlB3BpLyIfpU5ZpeTNNt+7+C9WYy qSnURVkv+BDZC7v2moCaDTN9PX+XoW0l9Jve6RkGxPs29Vb7rZJW2SgA0h4ZG+vqKMlo 3mc8yAYTNvP/QipW7V0qdRM0RMLkNGqJtV7bKCgvzAawLZgVTeFV5BS32BdjvsQd1tYZ JZy8RsvAOmQpyLiZw9jIgXSsZcNfUEPLSPo25GNr9axbIcvvZ/OKTI1r0AY/Jq/qleLD H1hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v4QAs1kK; 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=pass (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 z11si17069171pgr.227.2021.10.17.23.00.15; Sun, 17 Oct 2021 23:00:41 -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=@linuxfoundation.org header.s=korg header.b=v4QAs1kK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbhJRGBH (ORCPT + 99 others); Mon, 18 Oct 2021 02:01:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:45716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbhJRGBG (ORCPT ); Mon, 18 Oct 2021 02:01:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7754960F59; Mon, 18 Oct 2021 05:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634536736; bh=5rYzsvdza9zw7gO2DMRBVkoMGA9Kg9wwVy5zLFnLKZI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=v4QAs1kK+bK+WtH42VpXGgoJ5jSvIxqIPo60uGaU2NrRryAs8LtZnosSocyXN5Wi7 DsG0a/pggIoJc3PbqNadTlfDiVIvKoAJKxc6dX7uCiLCrlm/z6auZn5iV3TX1e9AqF mL2miSkcdr9GJS80a/7107o46nodeRP2OTiM2ji0= Date: Mon, 18 Oct 2021 07:58:50 +0200 From: Greg KH To: Mateusz =?utf-8?Q?Jo=C5=84czyk?= Cc: linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, Alessandro Zummo , Alexandre Belloni , stable@vger.kernel.org Subject: Re: [PATCH RESEND 2/6] rtc-cmos: dont touch alarm registers during update Message-ID: References: <20211017193927.277409-1-mat.jonczyk@o2.pl> <20211017193927.277409-3-mat.jonczyk@o2.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211017193927.277409-3-mat.jonczyk@o2.pl> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 17, 2021 at 09:39:23PM +0200, Mateusz Jończyk wrote: > Some Intel chipsets disconnect the time and date RTC registers when the > clock update is in progress: during this time reads may return bogus > values and writes fail silently. This includes the RTC alarm registers. > [1] > > cmos_read_alarm() and cmos_set_alarm() did not take account for that, > which caused alarm time reads to sometimes return bogus values. This can > be shown with a test patch that I am attaching to this patch series. > Setting the alarm clock also probably did fail sometimes. > > To make this patch suitable for inclusion in stable kernels, I'm using a > simple method for avoiding the RTC update cycle. This method is used in > mach_set_rtc_mmss() in arch/x86/kernel/rtc.c. A more elaborate algorithm > - as in mc146818_get_time() in drivers/rtc/rtc-mc146818-lib.c - would be > too complcated for stable. [2] No, just do it properly the first time, do not worry about stable kernels, we can just take the also-correct version for backporting if needed. thanks, greg k-h