From: Serge Belyshev <belyshev@depni.sinp.msu.ru>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Dirk Gouders" <dirk@gouders.net>,
"Mickaël Salaün" <mic@digikod.net>,
LKML <linux-kernel@vger.kernel.org>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Jason Gunthorpe" <jgg@ziepe.ca>,
"Miroslav Lichvar" <mlichvar@redhat.com>,
"John Stultz" <john.stultz@linaro.org>,
"Prarit Bhargava" <prarit@redhat.com>,
"Alessandro Zummo" <a.zummo@towertech.it>,
linux-rtc@vger.kernel.org,
"Peter Zijlstra" <peterz@infradead.org>
Subject: Re: [PATCH V2] rtc: mc146818: Detect and handle broken RTCs
Date: Mon, 01 Feb 2021 16:53:20 +0300 [thread overview]
Message-ID: <877dnrc2sv.fsf@depni.sinp.msu.ru> (raw)
In-Reply-To: <ghft2hwevu.fsf@gouders.net> (Dirk Gouders's message of "Sun, 31 Jan 2021 11:59:49 +0100")
Hi! "Me too":
> --- a/drivers/rtc/rtc-mc146818-lib.c
> +++ b/drivers/rtc/rtc-mc146818-lib.c
> @@ -21,6 +21,13 @@ unsigned int mc146818_get_time(struct rt
>
> again:
> spin_lock_irqsave(&rtc_lock, flags);
> + /* Ensure that the RTC is accessible. Bit 0-6 must be 0! */
> + if (WARN_ON_ONCE((CMOS_READ(RTC_VALID) & 0x7f) != 0)) {
> + spin_unlock_irqrestore(&rtc_lock, flags);
> + memset(time, 0xff, sizeof(*time));
> + return 0;
> + }
> +
... triggers here on a different box (Xiaomi mi notebook air 12.5):
[ 3.524002] ------------[ cut here ]------------
[ 3.528317] WARNING: CPU: 3 PID: 273 at drivers/rtc/rtc-mc146818-lib.c:25 mc146818_get_time+0x1b6/0x210
[ 3.532558] CPU: 3 PID: 273 Comm: udevadm Not tainted 5.11.0-rc6 #760
[ 3.536748] Hardware name: Timi TM1612/TM1612, BIOS A04 08/06/2016
[ 3.540947] RIP: 0010:mc146818_get_time+0x1b6/0x210
[ 3.545103] Code: 76 0b 0f b6 d0 83 ea 13 6b d2 64 01 d5 83 fd 45 89 6b 14 7f 06 83 c5 64 89 6b 14 41 83 ed 01 b8 02 00 00 00 44 89 6b 10 eb 39 <0f> 0b 48 c7 c7 b4 e0 9e 82 48 89 ee e8 29 6b 34 00 48 c7 03 ff ff
[ 3.549883] RSP: 0000:ffffc900012efe30 EFLAGS: 00010002
[ 3.554387] RAX: 0000000000000081 RBX: ffffc900012efe64 RCX: 000000000005b8d7
[ 3.558867] RDX: 0000000000000001 RSI: ffff8881000aa000 RDI: 000000000000000d
[ 3.563333] RBP: 0000000000000046 R08: 0000000000000004 R09: fffffffe5e075ac6
[ 3.567748] iwlwifi 0000:02:00.0: Applying debug destination EXTERNAL_DRAM
[ 3.567822] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[ 3.567827] R13: ffffc900012efedc R14: 0000000000000008 R15: ffff888100051200
[ 3.577223] FS: 0000000000000000(0000) GS:ffff88816ad80000(0000) knlGS:0000000000000000
[ 3.579870] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 3.581947] CR2: 00007fface455e28 CR3: 0000000103244005 CR4: 00000000003706a0
[ 3.583836] Call Trace:
[ 3.585699] hpet_rtc_interrupt+0x1af/0x220
[ 3.587585] __handle_irq_event_percpu+0x5a/0xc0
[ 3.589230] handle_irq_event_percpu+0x1b/0x50
[ 3.590673] handle_irq_event+0x22/0x40
[ 3.592107] handle_edge_irq+0x6b/0x190
[ 3.593545] common_interrupt+0x67/0x130
[ 3.594983] ? asm_common_interrupt+0x8/0x40
[ 3.596432] asm_common_interrupt+0x1e/0x40
[ 3.597618] RIP: 0033:0x7ffaceac9b31
[ 3.598794] Code: 48 83 fe 0a 0f 87 f5 fe ff ff be 41 ff ff 6f 48 29 d6 48 89 04 f1 e9 e4 fe ff ff 48 85 ff 74 79 49 8b 44 24 60 48 85 c0 74 04 <48> 01 78 08 49 8b 44 24 58 48 85 c0 74 04 48 01 78 08 49 8b 44 24
[ 3.600048] RSP: 002b:00007ffc12303b00 EFLAGS: 00010202
[ 3.601343] RAX: 00007fface455e20 RBX: 000000006ffffdff RCX: 00007fface80c040
[ 3.602587] RDX: 0000000000000000 RSI: 0000000000000029 RDI: 00007fface451000
[ 3.603809] RBP: 00007ffc12303c50 R08: 000000006fffffff R09: 00000000effffef5
[ 3.605015] R10: 0000000070000022 R11: 0000000000000032 R12: 00007fface80c000
[ 3.606223] R13: 000000006ffffeff R14: 000000006ffffe35 R15: 00007ffc12303ce0
[ 3.607421] ---[ end trace 5922ddf43b0f7b83 ]---
[ 3.608692] hpet: Lost 3 RTC interrupts
next prev parent reply other threads:[~2021-02-01 14:00 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 21:46 [patch 0/8] ntp/rtc: Fixes and cleanups Thomas Gleixner
2020-12-06 21:46 ` [patch 1/8] rtc: mc146818: Prevent reading garbage Thomas Gleixner
2020-12-11 10:07 ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2021-01-25 18:40 ` [patch 1/8] rtc: mc146818: Prevent reading garbage - bug Mickaël Salaün
2021-01-26 13:26 ` Thomas Gleixner
2021-01-26 14:17 ` Mickaël Salaün
2021-01-26 15:35 ` Thomas Gleixner
2021-01-26 17:02 ` [PATCH V2] rtc: mc146818: Detect and handle broken RTCs Thomas Gleixner
2021-01-26 18:00 ` Alexandre Belloni
2021-01-27 8:41 ` [tip: timers/urgent] " tip-bot2 for Thomas Gleixner
[not found] ` <ghft2hwevu.fsf@gouders.net>
2021-02-01 13:53 ` Serge Belyshev [this message]
2021-02-01 19:09 ` [PATCH] rtc: mc146818: Dont test for bit 0-5 in Register D Thomas Gleixner
2021-02-01 19:24 ` [PATCH V2] " Thomas Gleixner
2021-02-01 19:32 ` Linus Torvalds
2021-02-01 19:40 ` Thomas Gleixner
2021-02-11 23:09 ` Maciej W. Rozycki
2021-02-01 19:38 ` Alexandre Belloni
2021-02-01 20:09 ` Borislav Petkov
2021-02-01 20:15 ` Dirk Gouders
2021-02-02 4:22 ` Len Brown
2021-02-02 19:40 ` [tip: timers/urgent] " tip-bot2 for Thomas Gleixner
2021-02-03 13:00 ` [PATCH V2] " Mickaël Salaün
2020-12-06 21:46 ` [patch 2/8] rtc: mc146818: Reduce spinlock section in mc146818_set_time() Thomas Gleixner
2020-12-11 10:07 ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-12-06 21:46 ` [patch 3/8] rtc: cmos: Make rtc_cmos sync offset correct Thomas Gleixner
2020-12-07 20:50 ` Jason Gunthorpe
2020-12-11 10:07 ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-12-06 21:46 ` [patch 4/8] rtc: core: Make the sync offset default more realistic Thomas Gleixner
2020-12-07 20:55 ` Jason Gunthorpe
2020-12-10 23:59 ` Alexandre Belloni
2020-12-11 0:23 ` Thomas Gleixner
2020-12-11 0:28 ` Alexandre Belloni
2020-12-11 10:07 ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-12-06 21:46 ` [patch 5/8] ntp: Make the RTC synchronization more reliable Thomas Gleixner
2020-12-07 12:47 ` Miroslav Lichvar
2020-12-07 20:59 ` Jason Gunthorpe
2020-12-11 10:07 ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-12-29 19:41 ` [patch 5/8] " Geert Uytterhoeven
2021-01-11 10:12 ` Thomas Gleixner
2021-01-11 10:40 ` Geert Uytterhoeven
2020-12-06 21:46 ` [patch 6/8] ntp, rtc: Move rtc_set_ntp_time() to ntp code Thomas Gleixner
2020-12-07 20:59 ` Jason Gunthorpe
2020-12-09 3:51 ` Alexandre Belloni
2020-12-11 10:07 ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-12-06 21:46 ` [patch 7/8] ntp: Make the RTC sync offset less obscure Thomas Gleixner
2020-12-11 10:07 ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-12-06 21:46 ` [patch 8/8] ntp: Consolidate the RTC update implementation Thomas Gleixner
2020-12-07 21:05 ` Jason Gunthorpe
2020-12-11 9:23 ` Thomas Gleixner
2020-12-11 10:07 ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-12-09 0:33 ` [patch 0/8] ntp/rtc: Fixes and cleanups Thomas Gleixner
2020-12-09 4:01 ` Alexandre Belloni
2020-12-09 12:39 ` Thomas Gleixner
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=877dnrc2sv.fsf@depni.sinp.msu.ru \
--to=belyshev@depni.sinp.msu.ru \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=dirk@gouders.net \
--cc=jgg@ziepe.ca \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=mic@digikod.net \
--cc=mlichvar@redhat.com \
--cc=peterz@infradead.org \
--cc=prarit@redhat.com \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).