From: JeffyChen <jeffy.chen@rock-chips.com>
To: Brian Norris <briannorris@chromium.org>
Cc: linux-kernel@vger.kernel.org, zyw@rock-chips.com,
briannorris@google.com, dianders@google.com,
jwerner@chromium.org, linux-rtc@vger.kernel.org,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Alessandro Zummo <a.zummo@towertech.it>
Subject: Re: [PATCH] rtc: cros-ec: return -ETIME when refused to set alarms in the past
Date: Tue, 27 Feb 2018 10:54:27 +0800 [thread overview]
Message-ID: <5A94C863.5060504@rock-chips.com> (raw)
In-Reply-To: <20180226183727.GC225858@rodete-desktop-imager.corp.google.com>
Hi Brian,
Thanks for your reply.
On 02/27/2018 02:37 AM, Brian Norris wrote:
>> >+ /* Don't set an alarm in the past. */
>> >+ if ((u32)alarm_time <= current_time)
>> >+ return -ETIME;
>> >+
>> > if (!alrm->enabled) {
>> > /*
>> > * If the alarm is being disabled, send an alarm
>> >@@ -196,11 +200,7 @@ static int cros_ec_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
>> > alarm_offset = EC_RTC_ALARM_CLEAR;
>> > cros_ec_rtc->saved_alarm = (u32)alarm_time;
>> > } else {
>> >- /* Don't set an alarm in the past. */
>> >- if ((u32)alarm_time < current_time)
> It's probably worth noting in the commit message that you're also fixing
> the case where 'alarm_time == current_time'; in the current driver
> source, it*looks* like you're setting a 0-second alarm. But in fact, 0
> means EC_RTC_ALARM_CLEAR, which would disable the alarm. So you are
> (correctly) returning -ETIME in that case.
Right, i'll rewrite the commit message, and move the check back here:)
>
> Brian
>
prev parent reply other threads:[~2018-02-27 2:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-25 8:18 [PATCH] rtc: cros-ec: return -ETIME when refused to set alarms in the past Jeffy Chen
2018-02-26 18:01 ` Brian Norris
2018-02-26 18:24 ` Brian Norris
2018-02-26 18:37 ` Brian Norris
2018-02-27 2:54 ` JeffyChen [this message]
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=5A94C863.5060504@rock-chips.com \
--to=jeffy.chen@rock-chips.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=briannorris@chromium.org \
--cc=briannorris@google.com \
--cc=dianders@google.com \
--cc=jwerner@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=zyw@rock-chips.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