From: Stephen Boyd <sboyd@codeaurora.org>
To: Tero Kristo <t-kristo@ti.com>
Cc: linux-clk@vger.kernel.org, mturquette@baylibre.com,
linux-omap@vger.kernel.org, tony@atomide.com
Subject: Re: [PATCH 04/27] clk: ti: clkctrl: use fallback udelay approach if timekeeping is suspended
Date: Fri, 3 Nov 2017 08:43:17 -0700 [thread overview]
Message-ID: <20171103154317.GV11011@codeaurora.org> (raw)
In-Reply-To: <1509368685-29112-5-git-send-email-t-kristo@ti.com>
On 10/30, Tero Kristo wrote:
> This will happen on certain platforms when entering / leaving suspend
> and the system attempts to disable certain clocks at very early/late
> phase, burping out a warning from timekeeping core. Avoid the issue
> by checking if the timekeeping is suspended and using the fallback
> udelay approach for checking timeouts.
>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
> drivers/clk/ti/clkctrl.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c
> index 284ba449..91ddc92 100644
> --- a/drivers/clk/ti/clkctrl.c
> +++ b/drivers/clk/ti/clkctrl.c
> @@ -21,6 +21,7 @@
> #include <linux/of_address.h>
> #include <linux/clk/ti.h>
> #include <linux/delay.h>
> +#include <linux/timekeeping.h>
> #include "clock.h"
>
> #define NO_IDLEST 0x1
> @@ -90,7 +91,7 @@ static bool _omap4_is_ready(u32 val)
>
> static bool _omap4_is_timeout(union omap4_timeout *time, u32 timeout)
> {
> - if (unlikely(_early_timeout)) {
> + if (unlikely(_early_timeout || timekeeping_suspended)) {
> if (time->cycles++ < timeout) {
This would be the second user of timekeeping_suspended outside of
timekeeping core. Why don't we just udelay(1) every time we call
this function? The loop on ktime without any sort of delay in it
may actually spin faster, especially because we can't get
interrupted here (irqs are off). And irqs + preemption enabled is
typically where you would want to use ktime instead of counting
udelay() calls to see if you hit a timeout.
This code seems over-complicated given the constraints at the
call-sites.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2017-11-03 15:43 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-30 13:04 [PATCH 00/27] clk: ti: clkctrl fixes and support for additional SoCs Tero Kristo
2017-10-30 13:04 ` [PATCH 01/27] clk: ti: clkctrl: fix error messages to print out node name properly Tero Kristo
2017-10-30 20:45 ` Sebastian Reichel
2017-10-30 13:04 ` [PATCH 02/27] clk: ti: clkctrl: add support for clkdm init for clkctrl clocks Tero Kristo
2017-10-30 13:04 ` [PATCH 03/27] clk: ti: add support for clkctrl aliases Tero Kristo
2017-11-03 15:27 ` Stephen Boyd
2017-11-06 7:46 ` Tero Kristo
2017-11-06 22:07 ` Stephen Boyd
2017-10-30 13:04 ` [PATCH 04/27] clk: ti: clkctrl: use fallback udelay approach if timekeeping is suspended Tero Kristo
2017-11-03 15:43 ` Stephen Boyd [this message]
2017-11-06 7:33 ` Tero Kristo
2017-11-06 22:18 ` Stephen Boyd
2017-11-07 7:06 ` Tero Kristo
2017-10-30 13:04 ` [PATCH 05/27] clk: ti: clkctrl: add support for retrying failed init Tero Kristo
2017-11-03 17:04 ` Stephen Boyd
2017-11-06 7:42 ` Tero Kristo
2017-10-30 13:04 ` [PATCH 06/27] clk: ti: clkctrl: fix flags for mux and divider opt clocks Tero Kristo
2017-10-30 13:04 ` [PATCH 07/27] clk: ti: omap4: cleanup unnecessary clock aliases Tero Kristo
2017-10-30 13:04 ` [PATCH 08/27] clk: ti: dra7: drop " Tero Kristo
2017-10-30 13:04 ` [PATCH 09/27] clk: ti: omap5: cleanup " Tero Kristo
2017-10-30 13:04 ` [PATCH 10/27] clk: ti: dm814x: " Tero Kristo
2017-10-30 13:04 ` [PATCH 11/27] clk: ti: dm816x: " Tero Kristo
2017-10-30 13:04 ` [PATCH 12/27] clk: ti: am33xx: " Tero Kristo
2017-10-30 13:04 ` [PATCH 13/27] clk: ti: am43xx: " Tero Kristo
2017-10-30 13:04 ` [PATCH 14/27] clk: ti: omap3: " Tero Kristo
2017-10-30 13:04 ` [PATCH 15/27] dt-bindings: clk: add omap5 clkctrl definitions Tero Kristo
2017-10-30 13:04 ` [PATCH 16/27] clk: ti: omap5: add clkctrl clock data Tero Kristo
2017-10-30 13:04 ` [PATCH 17/27] dt-bindings: clk: add dra7 clkctrl definitions Tero Kristo
2017-10-30 13:04 ` [PATCH 18/27] clk: ti: dra7: add clkctrl clock data Tero Kristo
2017-10-30 13:04 ` [PATCH 19/27] dt-bindings: clk: add am33xx clkctrl definitions Tero Kristo
2017-10-30 13:04 ` [PATCH 20/27] clk: ti: am33xx: add clkctrl clock data Tero Kristo
2017-10-30 13:04 ` [PATCH 21/27] dt-bindings: clk: add am43xx clkctrl definitions Tero Kristo
2017-10-30 13:04 ` [PATCH 22/27] clk: ti: am43xx: add clkctrl clock data Tero Kristo
2017-10-30 13:04 ` [PATCH 23/27] dt-bindings: clk: add dm814 clkctrl definitions Tero Kristo
2017-10-30 13:04 ` [PATCH 24/27] clk: ti: dm814: add clkctrl clock data Tero Kristo
2017-10-30 13:04 ` [PATCH 25/27] dt-bindings: clk: add dm816 clkctrl definitions Tero Kristo
2017-10-30 13:04 ` [PATCH 26/27] clk: ti: dm816: add clkctrl clock data Tero Kristo
2017-10-30 13:04 ` [PATCH 27/27] clk: ti: omap4: clkctrl data fixes for opt-clocks Tero Kristo
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=20171103154317.GV11011@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=t-kristo@ti.com \
--cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).