linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/9] rtc-cmos,rtc-mc146818-lib: fixes
@ 2021-12-10 20:01 Mateusz Jończyk
  2021-12-10 20:01 ` [PATCH v4 1/9] rtc-cmos: take rtc_lock while reading from CMOS Mateusz Jończyk
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Mateusz Jończyk @ 2021-12-10 20:01 UTC (permalink / raw)
  To: linux-rtc, linux-kernel
  Cc: Mateusz Jończyk, Alessandro Zummo, Alexandre Belloni, Greg KH

Hello,

This patch series fixes some issues in the RTC CMOS handling code:

1. A missing spin_lock_irq() / spin_unlock_irq() pair in cmos_set_alarm().
2. A failing presence check of the RTC: the clock was misdetected as
   broken since Linux 5.11 on one of our home systems.
3. Do not touch the RTC alarm registers when the RTC update is in
   progress. (On some Intel chipsets, this causes bogus values being
   read or writes to fail silently.)

This is my first patch series, so please review carefully.

v2: Drop the last patch:
        Revert "rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ"
which was made obsolete by mainlining of 
commit 13be2efc390a ("rtc: cmos: Disable irq around direct invocation of cmos_interrupt()")

v3: Rework solution to problem 3 (I'd like to thank Greg KH for comment),
drop x86 refactoring patches (I'll send them later).

v4: Fixed some issues pointed out by Mr Alexandre Belloni:
    - do not add strings to rtc-mc146818-lib.c - I moved the error printing
      code to callers of mc146818_get_time(). This resulted in two new
      patches in the series,
    - other small issues.

I have noticed that mach_get_cmos_time() in arch/x86/kernel/rtc.c
performs a similar function to mc146818_get_time() in
drivers/rtc/rtc-cmos.c . In the future, I'm going to post a new series
that removes this duplicated code and makes mach_get_cmos_time() use
mc146818_get_time(). This will likely include reducing polling interval
in mc146818_avoid_UIP() from 1ms to 100us to make it more similar to
mach_get_cmos_time()'s current behaviour.

Greetings,
Mateusz

Signed-off-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Greg KH <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-12-10 20:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 20:01 [PATCH v4 0/9] rtc-cmos,rtc-mc146818-lib: fixes Mateusz Jończyk
2021-12-10 20:01 ` [PATCH v4 1/9] rtc-cmos: take rtc_lock while reading from CMOS Mateusz Jończyk
2021-12-10 20:01 ` [PATCH v4 2/9] rtc: change return values of mc146818_get_time() Mateusz Jończyk
2021-12-10 20:01 ` [PATCH v4 3/9] Check return value from mc146818_get_time() Mateusz Jończyk
2021-12-10 20:01 ` [PATCH v4 4/9] rtc-mc146818-lib: fix RTC presence check Mateusz Jończyk
2021-12-10 20:01 ` [PATCH v4 5/9] rtc-mc146818-lib: extract mc146818_avoid_UIP Mateusz Jończyk
2021-12-10 20:01 ` [PATCH v4 6/9] rtc-mc146818-lib: refactor mc146818_get_time Mateusz Jończyk
2021-12-10 20:01 ` [PATCH v4 7/9] rtc-mc146818-lib: refactor mc146818_does_rtc_work Mateusz Jończyk
2021-12-10 20:01 ` [PATCH v4 8/9] rtc-cmos: avoid UIP when reading alarm time Mateusz Jończyk
2021-12-10 20:03   ` [DEBUG PATCH v4] rtc-cmos: cmos_read_alarm bug demonstration Mateusz Jończyk
2021-12-10 20:01 ` [PATCH v4 9/9] rtc-cmos: avoid UIP when writing alarm time Mateusz Jończyk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).