public inbox for linux-rtc@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Mateusz Jończyk" <mat.jonczyk@o2.pl>
Cc: linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org,
	Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH RESEND 2/6] rtc-cmos: dont touch alarm registers during update
Date: Mon, 18 Oct 2021 07:58:50 +0200	[thread overview]
Message-ID: <YW0NGiZDhZf2RrjN@kroah.com> (raw)
In-Reply-To: <20211017193927.277409-3-mat.jonczyk@o2.pl>

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

  parent reply	other threads:[~2021-10-18  5:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-17 19:39 [PATCH RESEND v2 0/6] rtc,x86: CMOS RTC fixes Mateusz Jończyk
2021-10-17 19:39 ` [PATCH RESEND 1/6] rtc-cmos: take rtc_lock while reading from CMOS Mateusz Jończyk
2021-10-17 19:39 ` [PATCH RESEND 2/6] rtc-cmos: dont touch alarm registers during update Mateusz Jończyk
2021-10-17 19:41   ` [TEST PATCH] rtc-cmos: cmos_read_alarm bug demonstration Mateusz Jończyk
2021-10-18  5:58   ` Greg KH [this message]
2021-10-17 19:39 ` [PATCH RESEND v2 3/6] rtc-mc146818-lib: fix RTC presence check Mateusz Jończyk
2021-10-17 19:39 ` [PATCH RESEND 4/6] rtc-mc146818-lib: reduce RTC_UIP polling period Mateusz Jończyk
2021-10-17 19:39 ` [PATCH RESEND 5/6] x86/rtc: mach_get_cmos_time - rm duplicated code Mateusz Jończyk
2021-10-17 19:39 ` [PATCH RESEND 6/6] x86/rtc: rename mach_set_rtc_mmss Mateusz Jończyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YW0NGiZDhZf2RrjN@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=mat.jonczyk@o2.pl \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox