From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 3/8] cpufreq: kirkwood: Remove use of the clk provider API
Date: Wed, 27 Aug 2014 00:36:37 +0200 [thread overview]
Message-ID: <20140826223637.GA5324@lunn.ch> (raw)
In-Reply-To: <20140826214631.5251.66177@quantum>
> > Not quite true. u-boot might of touch the clock. Weird things happen
> > with some kirkwood boards. Some don't have the ability to control
> > there power supplies. So some boards implement "power off" by
> > rebooting, and letting u-boot spin until a button is pressed. I hope
> > such a u-boot powers off as much as possible, and e.g. drops the CPU
> > clock to the lower frequency. One would also hope it puts it back to
> > high speed before calling the kernel.
>
> I have a doubt about this.
>
> The powersave clock in drivers/clk/mvebu/kirkwood.c does not set
> CLK_IGNORE_UNUSED, nor do any of the clocks in kirkwood_gating_desc[].
>
> So regardless of what U-boot does, if no driver has called clk_enable() on
> powersave_clk by late_initcall-time then clk_disable_unused() will
> disable it as a power-saving mechanism.
>
> So are kirkwood systems that use cpufreq simply getting lucky and not
> hanging?
Hi Mike
Its a good question.
However, the reset value of the clock is off. off means the CPU is
running at its high speed. Turning this clock on, actually reduces the
clock speed! So for 99% of the time, the late_initcall does nothing.
It gets more interesting when uboot, or a previous kernel has turned
the clock on. I admit, i don't expect this to happen very often, but
if it does, and there is no cpufreq driver, interesting things could
happen. The cpufreq driver can only be builtin, not a module. So if it
is available, it should be guaranteed to claim the clock before the
late_initcall could turn it off. And since it reads the hardware
state, it will do the right thing.
Andrew
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew@lunn.ch>
To: Mike Turquette <mturquette@linaro.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
Tomeu Vizoso <tomeu.vizoso@collabora.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Peter De Schrijver <pdeschrijver@nvidia.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
linux-kernel@vger.kernel.org, Rabin Vincent <rabin@rab.in>,
Tomasz Figa <t.figa@samsung.com>,
Thierry Reding <thierry.reding@gmail.com>,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v7 3/8] cpufreq: kirkwood: Remove use of the clk provider API
Date: Wed, 27 Aug 2014 00:36:37 +0200 [thread overview]
Message-ID: <20140826223637.GA5324@lunn.ch> (raw)
In-Reply-To: <20140826214631.5251.66177@quantum>
> > Not quite true. u-boot might of touch the clock. Weird things happen
> > with some kirkwood boards. Some don't have the ability to control
> > there power supplies. So some boards implement "power off" by
> > rebooting, and letting u-boot spin until a button is pressed. I hope
> > such a u-boot powers off as much as possible, and e.g. drops the CPU
> > clock to the lower frequency. One would also hope it puts it back to
> > high speed before calling the kernel.
>
> I have a doubt about this.
>
> The powersave clock in drivers/clk/mvebu/kirkwood.c does not set
> CLK_IGNORE_UNUSED, nor do any of the clocks in kirkwood_gating_desc[].
>
> So regardless of what U-boot does, if no driver has called clk_enable() on
> powersave_clk by late_initcall-time then clk_disable_unused() will
> disable it as a power-saving mechanism.
>
> So are kirkwood systems that use cpufreq simply getting lucky and not
> hanging?
Hi Mike
Its a good question.
However, the reset value of the clock is off. off means the CPU is
running at its high speed. Turning this clock on, actually reduces the
clock speed! So for 99% of the time, the late_initcall does nothing.
It gets more interesting when uboot, or a previous kernel has turned
the clock on. I admit, i don't expect this to happen very often, but
if it does, and there is no cpufreq driver, interesting things could
happen. The cpufreq driver can only be builtin, not a module. So if it
is available, it should be guaranteed to claim the clock before the
late_initcall could turn it off. And since it reads the hardware
state, it will do the right thing.
Andrew
next prev parent reply other threads:[~2014-08-26 22:36 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-18 15:30 [PATCH v7 0/8] Per-user clock constraints Tomeu Vizoso
2014-08-18 15:30 ` Tomeu Vizoso
2014-08-18 15:30 ` [PATCH v7 1/8] clk: Add temporary mapping to the existing API Tomeu Vizoso
2014-08-18 15:30 ` Tomeu Vizoso
2014-08-20 14:50 ` Mike Turquette
2014-08-21 18:04 ` Tony Lindgren
2014-08-21 18:04 ` Tony Lindgren
2014-08-21 18:10 ` Jason Cooper
2014-08-21 18:10 ` Jason Cooper
2014-08-22 3:49 ` Simon Horman
2014-08-22 3:49 ` Simon Horman
2014-08-25 9:18 ` Sebastian Hesselbarth
2014-08-25 9:18 ` Sebastian Hesselbarth
2014-08-18 15:30 ` [PATCH v7 2/8] clk: provide public clk_is_enabled function Tomeu Vizoso
2014-08-18 15:30 ` Tomeu Vizoso
2014-08-18 15:30 ` [PATCH v7 3/8] cpufreq: kirkwood: Remove use of the clk provider API Tomeu Vizoso
2014-08-18 15:30 ` Tomeu Vizoso
[not found] ` <20140820225513.5251.284@quantum>
2014-08-21 7:53 ` Tomeu Vizoso
2014-08-21 7:53 ` Tomeu Vizoso
2014-08-21 13:38 ` Andrew Lunn
2014-08-21 13:38 ` Andrew Lunn
2014-08-22 19:29 ` Mike Turquette
2014-08-22 19:29 ` Mike Turquette
2014-08-22 20:11 ` Andrew Lunn
2014-08-22 20:11 ` Andrew Lunn
2014-08-22 20:27 ` Andrew Lunn
2014-08-22 20:27 ` Andrew Lunn
2014-08-26 21:46 ` Mike Turquette
2014-08-26 22:36 ` Andrew Lunn [this message]
2014-08-26 22:36 ` Andrew Lunn
2014-08-26 23:30 ` Mike Turquette
2014-08-27 0:35 ` Andrew Lunn
2014-08-27 0:35 ` Andrew Lunn
2014-08-27 5:04 ` Mike Turquette
2014-08-27 5:04 ` Mike Turquette
2014-08-27 15:58 ` Jason Gunthorpe
2014-08-27 15:58 ` Jason Gunthorpe
2014-08-18 15:30 ` [PATCH v7 4/8] ASoC: mxs-saif: fix mixed use of public and provider clk API Tomeu Vizoso
2014-08-18 15:30 ` Tomeu Vizoso
2014-08-18 15:30 ` [PATCH v7 6/8] clk: use struct clk only for external API Tomeu Vizoso
2014-08-18 15:30 ` Tomeu Vizoso
2014-08-18 15:30 ` [PATCH v7 7/8] clk: per-user clock accounting for debug Tomeu Vizoso
2014-08-18 15:30 ` Tomeu Vizoso
2014-08-27 20:54 ` Mike Turquette
2014-08-18 15:30 ` [PATCH v7 8/8] clk: Add floor and ceiling constraints to clock rates Tomeu Vizoso
2014-08-18 15:30 ` Tomeu Vizoso
2014-08-21 2:12 ` [PATCH v7 0/8] Per-user clock constraints Andrew Lunn
2014-08-21 2:12 ` Andrew Lunn
2014-08-21 7:10 ` Tomeu Vizoso
2014-08-21 7:10 ` Tomeu Vizoso
2014-08-26 13:20 ` Heiko Stübner
2014-08-26 13:20 ` Heiko Stübner
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=20140826223637.GA5324@lunn.ch \
--to=andrew@lunn.ch \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.