From: John Stultz <john.stultz@linaro.org>
To: Borislav Petkov <bp@alien8.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Jiri Kosina <jkosina@suse.cz>, Borislav Petkov <bp@suse.de>,
Thomas Gleixner <tglx@linutronix.de>,
Rabin Vincent <rabin.vincent@stericsson.com>
Subject: Re: [PATCH] RTC: Add an alarm disable quirk
Date: Mon, 22 Jul 2013 15:17:33 -0700 [thread overview]
Message-ID: <51EDAF7D.3000605@linaro.org> (raw)
In-Reply-To: <20130722212746.GE4613@pd.tnic>
On 07/22/2013 02:27 PM, Borislav Petkov wrote:
> On Mon, Jul 22, 2013 at 02:15:57PM -0700, John Stultz wrote:
>> On 07/22/2013 02:12 PM, Borislav Petkov wrote:
>>> On Mon, Jul 22, 2013 at 01:59:01PM -0700, John Stultz wrote:
>>>> So did this work some of the time, but not all? Or was the behavior
>>>> totally unchanged with this?
>>> Yep, some of the time. The first couple of runs it worked and I was
>>> euphoric and then it rebooted and I almost threw the box out the window
>>> :-)
>> I can understand your frustration. :)
>>
>> But its interesting it sort of worked, no? The bit you discovered
>> earlier with the dump_stack debugging call, where we're actually
>> disabling the irq twice was interesting.
>>
>> If you use the debugging patch with this change, does it show any
>> different in logic between the working cases and the instant-reboot
>> case?
> Ok, I'm kinda confused with so many experiments I did, what we actually
> want to try:
>
> Do we want to use the filter thingy:
>
> ---
> diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
> index be06d7150de5..bb265f1651e7 100644
> --- a/drivers/rtc/rtc-cmos.c
> +++ b/drivers/rtc/rtc-cmos.c
> @@ -304,6 +304,9 @@ static void cmos_irq_enable(struct cmos_rtc *cmos, unsigned char mask)
> rtc_control = CMOS_READ(RTC_CONTROL);
> cmos_checkintr(cmos, rtc_control);
>
> + if (rtc_control == mask)
> + return;
> +
> rtc_control |= mask;
> CMOS_WRITE(rtc_control, RTC_CONTROL);
> hpet_set_rtc_irq_bit(mask);
> @@ -316,6 +319,10 @@ static void cmos_irq_disable(struct cmos_rtc *cmos, unsigned char mask)
> unsigned char rtc_control;
>
> rtc_control = CMOS_READ(RTC_CONTROL);
> +
> + if (!(rtc_control & mask))
> + return;
> +
> rtc_control &= ~mask;
> CMOS_WRITE(rtc_control, RTC_CONTROL);
> hpet_mask_rtc_irq_bit(mask);
> --
>
> and also add dump_stack to see what calls cmos_irq_disable?
>
> In the run I had, the first call came from rtc_dev_ioctl so I'm guessing
> userspace and the following one was rtc workqueue rtc_timer_do_work.
>
> Just let me know what exactly we want to try and I'll do it tomorrow, on
> a clear head and not half asleep now :-)
So we probably want to do the following:
* Add your printk debug messages in rtc_cmos_read/write
* Add dump_stack to cmos_irq_disable
* Then on two machines (one working normally, the other broken): Boot
the systems & shut them down after 5 minutes.
* Send out the full logs for both.
* Add the filtering logic above to the broken machine.
* Boot the system, shut it down after 5 minutes. Do this repeatedly
until you get a failure (instant reboot) and a pass (stays off)
* Send out the full logs.
Hopefully from this we can sort out what exactly is going on.
Thanks again for your interest in hunting this down.
thanks
-john
next prev parent reply other threads:[~2013-07-22 22:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-18 15:44 [PATCH] RTC: Add an alarm disable quirk Borislav Petkov
2013-07-18 16:35 ` John Stultz
2013-07-18 22:53 ` Borislav Petkov
2013-07-19 14:26 ` Borislav Petkov
2013-07-19 15:13 ` Borislav Petkov
2013-07-19 21:34 ` Borislav Petkov
2013-07-20 17:00 ` [PATCH -v2] " Borislav Petkov
2013-07-22 21:00 ` John Stultz
2013-07-22 21:19 ` Borislav Petkov
2013-07-22 22:03 ` John Stultz
2013-07-22 20:59 ` [PATCH] " John Stultz
2013-07-22 21:12 ` Borislav Petkov
2013-07-22 21:15 ` John Stultz
2013-07-22 21:27 ` Borislav Petkov
2013-07-22 22:17 ` John Stultz [this message]
2013-07-23 5:03 ` Borislav Petkov
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=51EDAF7D.3000605@linaro.org \
--to=john.stultz@linaro.org \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=rabin.vincent@stericsson.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