Linux RTC
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	rtc-linux@googlegroups.com,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	matthew.garrett@nebula.com
Subject: [rtc-linux] Re: [PATCH 1/2] rtc-cmos: Clear expired alarm after resume
Date: Sat, 4 Jun 2016 19:48:54 +0200	[thread overview]
Message-ID: <20160604174854.GN4594@piout.net> (raw)
In-Reply-To: <CABFtUbQ7OWChggMPxYfpUeVCdTTtM74YpkqTF3--RT+wWkPoWQ@mail.gmail.com>

On 04/06/2016 at 18:58:59 +0200, Gabriele Mazzotta wrote :
> 2016-06-04 16:46 GMT+02:00 Alexandre Belloni
> <alexandre.belloni@free-electrons.com>:
> > On 01/06/2016 at 17:40:14 +0200, Gabriele Mazzotta wrote :
> >> If the system wakes up because of a wake alarm, the internal state
> >> of the alarm is not updated. As consequence, the state no longer
> >> reflects the actual state of the hardware and setting a new alarm
> >> is not possible until the expired alarm is cleared.
> >>
> >
> > I'm not completely sure to understand what is happening but could you
> > check whether that one is solved by
> > 2b2f5ff00f63847d95adad6289bd8b05f5983dd5 in my tree (rtc-next).
> >
> 
> I picked 2b2f5ff00f63847d95adad6289bd8b05f5983dd5 and applied it
> on top of 4.7-rc1, but that didn't fix the problem.
> 
> Let me explain the problem by showing you how I reproduce it:
> 
> root@localhost:~# cat /proc/driver/rtc | grep alarm_IRQ
> alarm_IRQ       : no
> root@localhost:~# echo +10 > /sys/class/rtc/rtc0/wakealarm
> root@localhost:~# echo mem > /sys/power/state  # wait for auto-resume
> root@localhost:~# echo +10 > /sys/class/rtc/rtc0/wakealarm
> bash: echo: write error: Device or resource busy
> root@localhost:~# cat /proc/driver/rtc | grep alarm_IRQ
> alarm_IRQ       : yes
> 
> To set another alarm, I have to first write 0 to wakealarm. After that
> I can set what I want. This doesn't happen if the alarm fires while
> the system is awake, it happens only if the system is suspended and
> the alarm wakes it.
> 
> I actually forgot to say that maybe this problem is not limited
> to rtc-cmos and that maybe a general solution could be used.
> 
> I've just looked better into what is causing this and the problem
> seems to be caused by the fact that rtc_timer_do_work() is not
> executed if the timer expires while the system is suspended.
> 

I doubt this is a driver independent issues as I don't get that
behaviour on many other RTCs. I'll have a look.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  reply	other threads:[~2016-06-04 17:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 15:40 [rtc-linux] [PATCH 1/2] rtc-cmos: Clear expired alarm after resume Gabriele Mazzotta
2016-06-01 15:40 ` [rtc-linux] [PATCH 2/2] rtc-cmos: Restore " Gabriele Mazzotta
2016-06-01 16:11 ` [rtc-linux] Re: [PATCH 1/2] rtc-cmos: Clear expired " Gabriele Mazzotta
2016-06-04 14:46 ` Alexandre Belloni
2016-06-04 16:58   ` Gabriele Mazzotta
2016-06-04 17:48     ` Alexandre Belloni [this message]
2016-08-25 14:54       ` Gabriele Mazzotta
2016-08-30 23:28         ` Alexandre Belloni
2016-08-31 15:05           ` Gabriele Mazzotta
2016-08-31 16:08             ` Alexandre Belloni

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=20160604174854.GN4594@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=a.zummo@towertech.it \
    --cc=gabriele.mzt@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.garrett@nebula.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