From: Florian Fainelli <f.fainelli@gmail.com>
To: Justin Chen <justin.chen@broadcom.com>, linux-rtc@vger.kernel.org
Cc: a.zummo@towertech.it, alexandre.belloni@free-electrons.com,
computersforpeace@gmail.com, gregory.0xf0@gmail.com,
f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Justin Chen <justinpopo6@gmail.com>
Subject: Re: [PATCH] rtc: brcmstb-waketimer: Set wktmr prescaler
Date: Fri, 23 Feb 2018 11:01:04 -0800 [thread overview]
Message-ID: <e991b6b5-3f3d-f9da-2655-008921eee2a7@gmail.com> (raw)
In-Reply-To: <1519262155-15580-1-git-send-email-justin.chen@broadcom.com>
On 02/21/2018 05:15 PM, Justin Chen wrote:
> The HW default is one tick per second, however instead of assuming this,
> lets make sure the waketimer is actually one tick per second before
> arming the alarm.
>
> Signed-off-by: Justin Chen <justinpopo6@gmail.com>
> ---
> drivers/rtc/rtc-brcmstb-waketimer.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/rtc/rtc-brcmstb-waketimer.c b/drivers/rtc/rtc-brcmstb-waketimer.c
> index 796ac79..46116b7 100644
> --- a/drivers/rtc/rtc-brcmstb-waketimer.c
> +++ b/drivers/rtc/rtc-brcmstb-waketimer.c
> @@ -60,6 +60,10 @@ static void brcmstb_waketmr_set_alarm(struct brcmstb_waketmr *timer,
> {
> brcmstb_waketmr_clear_alarm(timer);
>
> + /* Make sure we are actually counting in seconds */
> + writel_relaxed(BRCMSTB_WKTMR_DEFAULT_FREQ,
> + timer->base + BRCMSTB_WKTMR_PRESCALER);
The change is correct, however you would likely want to use timer->rate
which makes sure that we either got the clock rate information from the
LCCF, or we got the correct fixed rate frequency. With that fixed:
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
prev parent reply other threads:[~2018-02-23 19:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 1:15 [PATCH] rtc: brcmstb-waketimer: Set wktmr prescaler Justin Chen
2018-02-23 19:01 ` Florian Fainelli [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=e991b6b5-3f3d-f9da-2655-008921eee2a7@gmail.com \
--to=f.fainelli@gmail.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=computersforpeace@gmail.com \
--cc=gregory.0xf0@gmail.com \
--cc=justin.chen@broadcom.com \
--cc=justinpopo6@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@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;
as well as URLs for NNTP newsgroup(s).