From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Joonyoung Shim <jy0922.shim@samsung.com>, rtc-linux@googlegroups.com
Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
a.zummo@towertech.it, alexandre.belloni@free-electrons.com,
cw00.choi@samsung.com
Subject: Re: [PATCH 4/4] rtc: s3c: enable/disable clocks for alarm
Date: Wed, 12 Aug 2015 09:28:32 +0900 [thread overview]
Message-ID: <55CA9330.9070700@samsung.com> (raw)
In-Reply-To: <1439292502-22912-4-git-send-email-jy0922.shim@samsung.com>
On 11.08.2015 20:28, Joonyoung Shim wrote:
> The clock enable/disable codes for alarm have removed from
What do you mean in this paragraph? The clock code was removing something?
> 'commit 24e1455493da ("drivers/rtc/rtc-s3c.c: delete duplicate clock
Remove the 'apostrophe.
> control")' and the clocks keep disabling even if alarm is set, so alarm
> interrupt can't happen.
...and the clocks are disabled even...
>
> The s3c_rtc_setaie function can be called several times with that
> enabled argument has same value,
...several times with 'enabled' argument having same value
> so it needs to check whether clocks is
> enabled or not.
s/is/are/
>
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Please add Cc-stable and fixes tag. To backport the patch probably
you'll have to remove the dependency on previous patches.
> ---
> drivers/rtc/rtc-s3c.c | 24 ++++++++++++++++++------
> 1 file changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> index abe2a6d..fce078c 100644
> --- a/drivers/rtc/rtc-s3c.c
> +++ b/drivers/rtc/rtc-s3c.c
> @@ -39,6 +39,7 @@ struct s3c_rtc {
> void __iomem *base;
> struct clk *rtc_clk;
> struct clk *rtc_src_clk;
> + bool clk_enabled;
>
> struct s3c_rtc_data *data;
>
> @@ -71,9 +72,12 @@ static void s3c_rtc_enable_clk(struct s3c_rtc *info)
> unsigned long irq_flags;
>
> spin_lock_irqsave(&info->alarm_clk_lock, irq_flags);
> - clk_enable(info->rtc_clk);
> - if (info->data->needs_src_clk)
> - clk_enable(info->rtc_src_clk);
> + if (!info->clk_enabled) {
> + clk_enable(info->rtc_clk);
> + if (info->data->needs_src_clk)
> + clk_enable(info->rtc_src_clk);
> + info->clk_enabled = true;
> + }
> spin_unlock_irqrestore(&info->alarm_clk_lock, irq_flags);
> }
>
> @@ -82,9 +86,12 @@ static void s3c_rtc_disable_clk(struct s3c_rtc *info)
> unsigned long irq_flags;
>
> spin_lock_irqsave(&info->alarm_clk_lock, irq_flags);
> - if (info->data->needs_src_clk)
> - clk_disable(info->rtc_src_clk);
> - clk_disable(info->rtc_clk);
> + if (info->clk_enabled) {
> + if (info->data->needs_src_clk)
> + clk_disable(info->rtc_src_clk);
> + clk_disable(info->rtc_clk);
> + info->clk_enabled = false;
> + }
> spin_unlock_irqrestore(&info->alarm_clk_lock, irq_flags);
> }
>
> @@ -128,6 +135,11 @@ static int s3c_rtc_setaie(struct device *dev, unsigned int enabled)
>
> s3c_rtc_disable_clk(info);
>
> + if (enabled)
> + s3c_rtc_enable_clk(info);
> + else
> + s3c_rtc_disable_clk(info);
> +
> return 0;
> }
During probe the clk_enabled is false, so the clock won't be disabled at
the end of probe with s3c_rtc_disable_clk(). Maybe previous patch
interferes here so it would work after applying all 4 patches but not
when backporting. The patch in current form looks non-backportable.
Best regards,
KRzysztof
next prev parent reply other threads:[~2015-08-12 0:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-11 11:28 [PATCH 1/4] rtc: s3c: add missing clk control Joonyoung Shim
2015-08-11 11:28 ` [PATCH 2/4] rtc: s3c: remove unnecessary NULL assignment Joonyoung Shim
2015-08-12 0:07 ` Krzysztof Kozlowski
2015-08-20 23:07 ` Alexandre Belloni
2015-08-11 11:28 ` [PATCH 3/4] rtc: s3c: use unified functions for enable/disable of clk Joonyoung Shim
2015-08-12 0:10 ` Krzysztof Kozlowski
2015-08-12 10:26 ` Joonyoung Shim
2015-08-11 11:28 ` [PATCH 4/4] rtc: s3c: enable/disable clocks for alarm Joonyoung Shim
2015-08-12 0:28 ` Krzysztof Kozlowski [this message]
2015-08-12 1:09 ` Joonyoung Shim
2015-08-12 0:06 ` [PATCH 1/4] rtc: s3c: add missing clk control Krzysztof Kozlowski
2015-08-20 23:06 ` 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=55CA9330.9070700@samsung.com \
--to=k.kozlowski@samsung.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=cw00.choi@samsung.com \
--cc=jy0922.shim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--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