From: Like Xu <like.xu@linux.intel.com>
To: Giovanni Gherdovich <ggherdovich@suse.cz>
Cc: linux-kernel@vger.kernel.org, Like Xu <like.xu@linux.intel.com>
Subject: [PATCH] x86, smpboot: Disable frequency invariance when it's unsupported
Date: Thu, 16 Apr 2020 10:12:10 +0800 [thread overview]
Message-ID: <20200416021210.170736-1-like.xu@linux.intel.com> (raw)
On the Intel SNR processors such as "Intel Atom(R) C6562", the
turbo_freq for 4C turbo may be zero which causes a divide by zero
exception and blocks the boot process when arch_scale_freq_tick().
When one of the preset base_freq or turbo_freq is meaningless,
we may disable frequency invariance.
Fixes: 1567c3e3467c ("x86, sched: Add support for frequency invariance")
Signed-off-by: Like Xu <like.xu@linux.intel.com>
---
arch/x86/kernel/smpboot.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index fe3ab9632f3b..741367ce4d14 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1958,6 +1958,9 @@ static bool core_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq)
*base_freq = (*base_freq >> 8) & 0xFF; /* max P state */
*turbo_freq = (*turbo_freq >> 24) & 0xFF; /* 4C turbo */
+ if (*turbo_freq == 0 || *base_freq == 0)
+ return false;
+
return true;
}
--
2.21.1
next reply other threads:[~2020-04-16 2:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-16 2:12 Like Xu [this message]
[not found] <20200416020700.167294-1-like.xu@linux.intel.com>
[not found] ` <1587017284.32139.20.camel@suse.cz>
2020-04-16 7:01 ` [PATCH] x86, smpboot: Disable frequency invariance when it's unsupported Like Xu
2020-04-16 8:40 ` Giovanni Gherdovich
2020-04-16 12:54 ` Like Xu
2020-04-16 18:09 ` Giovanni Gherdovich
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=20200416021210.170736-1-like.xu@linux.intel.com \
--to=like.xu@linux.intel.com \
--cc=ggherdovich@suse.cz \
--cc=linux-kernel@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).