From: Pratyush Anand <panand@redhat.com>
To: mingo@kernel.org, alexandre.belloni@free-electrons.com
Cc: rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org,
prarit@redhat.com, Pratyush Anand <panand@redhat.com>,
Alessandro Zummo <a.zummo@towertech.it>
Subject: [PATCH RFC 2/2] rtc/rtc-cmos: Initialize software counters before irq is registered
Date: Tue, 21 Jun 2016 10:25:36 +0530 [thread overview]
Message-ID: <26cd375a8d7ef97db5f8d12ecda6ee6676aca211.1466484019.git.panand@redhat.com> (raw)
In-Reply-To: <cover.1466484019.git.panand@redhat.com>
In-Reply-To: <cover.1466484019.git.panand@redhat.com>
We have observed on few machines with rtc-cmos device that
hpet_rtc_interrupt() is called before cmos_do_probe() could call
hpet_rtc_timer_init(). It has not been observed during normal boot/reboot
of machines. It *sometime* happens when system is booted with kdump
secondary kernel. So, neither hpet_default_delta nor hpet_t1_cmp is
initialized by the time interrupt is raised in the given situation.
Therefore while loop of hpet_cnt_ahead() in hpet_rtc_timer_reinit() never
completes. This leads to "NMI watchdog: Watchdog detected hard LOCKUP on
cpu 0".
I am still clueless, how can an interrupt be raised before RTC is enabled.
But I do not have any idea about this device, so I am putting this patch as
RFC to get feedback from hpet/rtc-cmos developer.
I am initializing software counters in this patch so that LOCKUP could be
avoided. Even if it resolves the issue, I understand that proposed patch
may not be the best way to solve this issue.
Signed-off-by: Pratyush Anand <panand@redhat.com>
---
drivers/rtc/rtc-cmos.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index fbe9c72438e1..101dc948295f 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -129,6 +129,16 @@ static inline int hpet_rtc_dropped_irq(void)
return 0;
}
+static inline int hpet_rtc_timer_counter_init(void)
+{
+ return 0;
+}
+
+static inline int hpet_rtc_timer_enable(void)
+{
+ return 0;
+}
+
static inline int hpet_rtc_timer_init(void)
{
return 0;
@@ -710,6 +720,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
goto cleanup1;
}
+ hpet_rtc_timer_counter_init();
if (is_valid_irq(rtc_irq)) {
irq_handler_t rtc_cmos_int_handler;
@@ -732,7 +743,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
goto cleanup1;
}
}
- hpet_rtc_timer_init();
+ hpet_rtc_timer_enable();
/* export at least the first block of NVRAM */
nvram.size = address_space - NVRAM_OFFSET;
--
2.5.5
next prev parent reply other threads:[~2016-06-21 4:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-21 4:55 [PATCH RFC 0/2] rtc-cmos: Workaround unwanted interrupt generation Pratyush Anand
2016-06-21 4:55 ` [PATCH RFC 1/2] rtc/hpet: Factorize hpet_rtc_timer_init() Pratyush Anand
2016-06-23 8:33 ` Thomas Gleixner
2016-06-23 14:37 ` Pratyush Anand
2016-06-21 4:55 ` Pratyush Anand [this message]
2016-06-27 4:49 ` [PATCH RFC 0/2] rtc-cmos: Workaround unwanted interrupt generation Pratyush Anand
2016-07-04 16:19 ` Pratyush Anand
2016-07-18 11:47 ` Pratyush Anand
2016-07-19 14:29 ` Alexandre Belloni
2016-07-20 3:56 ` Pratyush Anand
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=26cd375a8d7ef97db5f8d12ecda6ee6676aca211.1466484019.git.panand@redhat.com \
--to=panand@redhat.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=prarit@redhat.com \
--cc=rtc-linux@googlegroups.com \
/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
all inboxes | Powered by JetHome®