From: Mark Lord <kernel@teksavvy.com>
To: richard -rw- weinberger <richard.weinberger@gmail.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
rtc-linux@googlegroups.com,
Alessandro Zummo <a.zummo@towertech.it>,
Greg Kroah-Hartman <greg@kroah.com>,
stable@vger.kernel.org, John Stultz <john.stultz@linaro.org>,
Rabin Vincent <rabin.vincent@stericsson.com>
Subject: Re: [REGRESSION] rtc/interface.c: kills suspend-to-ram
Date: Mon, 16 Apr 2012 11:57:16 -0400 [thread overview]
Message-ID: <4F8C415C.80806@teksavvy.com> (raw)
In-Reply-To: <CAFLxGvy=3SHKFYoSfUcQrJKsCYWq5Fxpi4q_DTQjjFNDSSnJOw@mail.gmail.com>
On 12-04-16 11:49 AM, richard -rw- weinberger wrote:
> On Mon, Apr 16, 2012 at 5:42 PM, Mark Lord <kernel@teksavvy.com> wrote:
>> On 12-04-16 10:23 AM, richard -rw- weinberger wrote:
>>> On Mon, Apr 16, 2012 at 3:55 PM, Mark Lord <kernel@teksavvy.com> wrote:
>>>> On 12-04-16 12:36 AM, Mark Lord wrote:
>>>>> Something recent has killed suspend-to-ram on a number of machines here.
>>>>> The symptom is that they suspend, but immediately wake up and panic,
>>>>> with just a black screen so no visible messages to go by.
>>>>>
>>>>> The patch below works around the issue -- making things work as they used to work.
>>>>>
>>>>> +++ linux/drivers/rtc/interface.c 2012-04-16 00:09:14.105387382 -0400
>>>>> @@ -773,7 +773,7 @@
>>>>> if (!rtc->ops || !rtc->ops->alarm_irq_enable)
>>>>> return;
>>>>>
>>>>> - rtc->ops->alarm_irq_enable(rtc->dev.parent, false);
>>>>> + //rtc->ops->alarm_irq_enable(rtc->dev.parent, false); // Kills suspend on ZBOX HD-ID41U
>>>>> }
>>
>>
>> How about the line above -- that's the commit that breaks things here.
>
> Download Linus' GIT tree and use git blame. :-)
Too steep a learning curve for a casual user.
But google works:
http://www.mail-archive.com/stable@vger.kernel.org/msg04391.html
> [ 055/175] rtc: Disable the alarm in the hardware (v2)
>
> Greg KH
> Fri, 30 Mar 2012 14:57:53 -0700
>
> 3.3-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Rabin Vincent <rabin.vincent@stericsson.com>
>
> commit 41c7f7424259ff11009449f87c95656f69f9b186 upstream.
>
> Currently, the RTC code does not disable the alarm in the hardware.
>
> This means that after a sequence such as the one below (the files are in the
> RTC sysfs), the box will boot up after 2 minutes even though we've
> asked for the alarm to be turned off.
>
> # echo $((`cat since_epoch`)+120) > wakealarm
> # echo 0 > wakealarm
> # poweroff
>
> Fix this by disabling the alarm when there are no timers to run.
>
> The original version of this patch was reverted. This version
> disables the irq directly instead of setting a disabled timer
> in the future.
>
> Cc: John Stultz <john.stu...@linaro.org>
> Signed-off-by: Rabin Vincent <rabin.vinc...@stericsson.com>
> [Merged in the second revision from Rabin]
> Signed-off-by: John Stultz <john.stu...@linaro.org>
> Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
>
> ---
> drivers/rtc/interface.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> --- a/drivers/rtc/interface.c
> +++ b/drivers/rtc/interface.c
> @@ -763,6 +763,14 @@ static int rtc_timer_enqueue(struct rtc_
> return 0;
> }
>
> +static void rtc_alarm_disable(struct rtc_device *rtc)
> +{
> + if (!rtc->ops || !rtc->ops->alarm_irq_enable)
> + return;
> +
> + rtc->ops->alarm_irq_enable(rtc->dev.parent, false);
> +}
> +
> /**
> * rtc_timer_remove - Removes a rtc_timer from the rtc_device timerqueue
> * @rtc rtc device
> @@ -784,8 +792,10 @@ static void rtc_timer_remove(struct rtc_
> struct rtc_wkalrm alarm;
> int err;
> next = timerqueue_getnext(&rtc->timerqueue);
> - if (!next)
> + if (!next) {
> + rtc_alarm_disable(rtc);
> return;
> + }
> alarm.time = rtc_ktime_to_tm(next->expires);
> alarm.enabled = 1;
> err = __rtc_set_alarm(rtc, &alarm);
> @@ -847,7 +857,8 @@ again:
> err = __rtc_set_alarm(rtc, &alarm);
> if (err == -ETIME)
> goto again;
> - }
> + } else
> + rtc_alarm_disable(rtc);
>
> mutex_unlock(&rtc->ops_lock);
> }
>
next prev parent reply other threads:[~2012-04-16 15:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-16 4:36 [REGRESSION] rtc/interface.c: kills suspend-to-ram Mark Lord
2012-04-16 13:55 ` Mark Lord
2012-04-16 14:23 ` richard -rw- weinberger
2012-04-16 15:42 ` Mark Lord
2012-04-16 15:49 ` richard -rw- weinberger
2012-04-16 15:57 ` Mark Lord [this message]
2012-04-16 19:45 ` John Stultz
2012-04-16 21:43 ` John Stultz
2012-04-17 2:30 ` Mark Lord
2012-04-17 5:13 ` John Stultz
2012-04-17 12:51 ` Mark Lord
2012-04-17 20:11 ` Mark Lord
2012-04-17 20:12 ` Mark Lord
2012-04-17 23:02 ` John Stultz
2012-04-18 1:29 ` Mark Lord
2012-04-18 18:29 ` John Stultz
2012-04-27 14:33 ` Mark Lord
2012-04-27 19:22 ` John Stultz
2012-04-16 19:44 ` John Stultz
2012-04-17 2:27 ` Mark Lord
2012-04-16 14:26 ` [rtc-linux] " Mark Brown
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=4F8C415C.80806@teksavvy.com \
--to=kernel@teksavvy.com \
--cc=a.zummo@towertech.it \
--cc=greg@kroah.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rabin.vincent@stericsson.com \
--cc=richard.weinberger@gmail.com \
--cc=rtc-linux@googlegroups.com \
--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