From: Ralf Baechle <ralf@linux-mips.org>
To: Huacai Chen <chenhc@lemote.com>
Cc: "Steven J. Hill" <Steven.Hill@imgtec.com>,
linux-mips@linux-mips.org, Fuxin Zhang <zhangfx@lemote.com>,
Zhangjin Wu <wuzhangjin@gmail.com>,
linux-pm@vger.kernel.org, Hongliang Tao <taohl@lemote.com>
Subject: Re: [PATCH V8 8/8] MIPS: Loongson: Make CPUFreq usable for Loongson-3
Date: Thu, 26 Mar 2015 14:05:18 +0100 [thread overview]
Message-ID: <20150326130517.GD9705@linux-mips.org> (raw)
In-Reply-To: <1426213836-28600-1-git-send-email-chenhc@lemote.com>
On Fri, Mar 13, 2015 at 10:30:36AM +0800, Huacai Chen wrote:
> Loongson-3A/3B support frequency scaling. But due to hardware
> limitation, Loongson-3A's frequency scaling is not independent for
> each core, we suggest enable Loongson-3A's CPUFreq only when there is
> one core online. Loongson-3B can adjust frequency independently for
> each core, so it can be always enabled.
>
> Each package has only one register (ChipConfig or FreqCtrl) to control
> frequency, so we need spinlocks to protect register access for multi-
> cores. However, we cannot use spinlock when a core becomes into "wait"
> status (frequency = 0), so we only enable "wait" when there is one core
> in a package online.
>
> arch/mips/kernel/smp.c is modified to guarantee udelay_val has the
> correct value while both CPU hotplug and CPUFreq are enabled.
With clockscaling you have a fundamental problem with udelay. If the clock
is increased for a CPU that already has computed the number of iterations
of the delay loop for the old, lower clock rate, it is possible that
udelay won't wait for long enough.
The opposite case would result in waiting too long but that's not a big
problem as udelay only guarantees a minimum waiting time.
So you probably need a different delay mechanism than the classic delay
loop on SMP with clockscaling.
Ralf
next prev parent reply other threads:[~2015-03-26 13:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-13 2:30 [PATCH V8 8/8] MIPS: Loongson: Make CPUFreq usable for Loongson-3 Huacai Chen
2015-03-26 13:05 ` Ralf Baechle [this message]
2015-03-27 3:45 ` Huacai Chen
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=20150326130517.GD9705@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=Steven.Hill@imgtec.com \
--cc=chenhc@lemote.com \
--cc=linux-mips@linux-mips.org \
--cc=linux-pm@vger.kernel.org \
--cc=taohl@lemote.com \
--cc=wuzhangjin@gmail.com \
--cc=zhangfx@lemote.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 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.